You are on page 1of 4

E

COMP6047 – Algorithm and Programming

T
T
NO
BU
University Bazaar
It’s been a year since Theo graduated from high school, but he still doesn’t know where to
study for his bachelor degree. So Theo came to ICE BSD to see the university exhibition.
Theo’s job is to find as much information as possible about the place of study and to
make it easier for him to make a decision, he will then sort by location and the name of

I
the university.

R
O
To solve this problem, Theo asks your help to use your programming skills and figured
out how to sort all university based on the location first and then with the name of the
university.
T
D
S
Format Input
This section explains about the provided input’s format. It is guaranteed that the
DI

provided input always follow the given formatting. In this case, the input of this problem
starts with an integer T as the number of test case on this problem. Then, the following
T lines contain a word for the university’s location(A), and a word or more for the name
of the university(B).
OT
UT
RE

Format Output
This section explains about the output’s format from your program. If your output
does not meet the requirements, then your answer will be judged as WRONG ANSWER.
Display all of the sorted data in ascending order and the format is to display the location,
N
IB
and all university in that particular location. Make sure to add numbering before the
location’s name, and add “> ” before the university’s name. The example of the output
will be given in the sample output section.

Constraints
TR
DO

This section contains some given constraints. The judges guaranteed that the provided
input always satisfy the constraints of its problems.

• 1 ≤ T ≤ 1000
IS

• 1 ≤ LengthA, LengthB ≤ 255


ED

© School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
COMP6047 – Algorithm and Programming

Sample Input (standard input)


10
Jakarta University of Mashhad Payame Noor
Pekalongan Universidad Catolica de Santiago de Guayaquil
Rembang University of Lahore
Pekalongan European Management School
Semarang Pokhara University
Pekalongan Amherst College
Semarang Kellogg Community College
Aceh Montana State University - Bozeman
Palu Southwest Forestry University
Magelang Maryam Institute of Higher Education

Sample Output (standard output)


1. Aceh
> Montana State University - Bozeman
2. Jakarta
> University of Mashhad Payame Noor
3. Magelang
> Maryam Institute of Higher Education
4. Palu
> Southwest Forestry University
5. Pekalongan
> Amherst College
> European Management School
> Universidad Catolica de Santiago de Guayaquil
6. Rembang
> University of Lahore
7. Semarang
> Kellogg Community College
> Pokhara University

© School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
COMP6047 – Algorithm and Programming

University Bazaar
Sudah 1 tahun semenjak Theo lulus dari SMA, tetapi dia masih bingung mau kuliah
dimana. Maka datanglah Theo ke ICE BSD untuk melihat pameran universitas. Tugasnya
Theo adalah mencari info sebanyak-banyaknya mengenai tempat kuliah dan untuk memudahkannya
dalam melakukan penentuan, maka dia akan mengurutkan berdasarkan daerah dan nama
universitasnya.

Untuk mengatasi masalah ini, Theo meminta bantuan Anda untuk menggunakan keterampilan
pemrograman Anda dan menemukan cara untuk mengurutkan semua universitas berdasarkan
lokasi terlebih dahulu dan dilanjuti dengan nama universitas.

Format Input
Bagian ini menjelaskan tentang format input yang disediakan. Dijamin input yang
diberikan selalu mengikuti format yang diberikan. Dalam hal ini, input masalah ini
dimulai dengan bilangan T sebagai jumlah kasus uji pada masalah ini. Kemudian,
sebanyak T baris berikut akan berisikan satu kata untuk lokasi universitas(A), dan satu
kata atau lebih untuk nama universitas(B).

Format Output
Bagian ini menjelaskan format output yang harus dihasilkan oleh program. Apabila
terdapat format yang tidak sesuai dengan permintaan soal, maka jawaban anda akan
mendapatkan hasil WRONG ANSWER. Tampilkan semua data yang sudah diurutkan
dalam urutan kecil ke besar dan formatnya adalah tampilkan nama lokasi, dan diikuti
dengan semua universitas di lokasi tersebut. Pastikan untuk menambahkan penomoran
sebelum nama lokasi, dan tambahkan “> ” sebelum nama universitas. Contoh output
akan diberikan di bagian sampel output.

Constraints
Bagian ini merupakan batasan-batasan yang diberikan oleh juri. Juri menjamin bahwa
input yang diberikan sesuai dengan batasan yang tertera pada bagian constraint dari
setiap soal.

• 1 ≤ T ≤ 1000

• 1 ≤ LengthA, LengthB ≤ 255

© School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
COMP6047 – Algorithm and Programming

Sample Input (standard input)


10
Jakarta University of Mashhad Payame Noor
Pekalongan Universidad Catolica de Santiago de Guayaquil
Rembang University of Lahore
Pekalongan European Management School
Semarang Pokhara University
Pekalongan Amherst College
Semarang Kellogg Community College
Aceh Montana State University - Bozeman
Palu Southwest Forestry University
Magelang Maryam Institute of Higher Education

Sample Output (standard output)


1. Aceh
> Montana State University - Bozeman
2. Jakarta
> University of Mashhad Payame Noor
3. Magelang
> Maryam Institute of Higher Education
4. Palu
> Southwest Forestry University
5. Pekalongan
> Amherst College
> European Management School
> Universidad Catolica de Santiago de Guayaquil
6. Rembang
> University of Lahore
7. Semarang
> Kellogg Community College
> Pokhara University

© School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.

You might also like