2702 - I2P(I)2022_Yang_lab11 Scoreboard

Time

2022/12/20 18:30:00 2022/12/20 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12523 Inventory
13776 Doraemon visits NTHU

12523 - Inventory   

Description

You are going to implement a Pokemon Go Inventory Display System. Given the name, current hp, and max hp of pokemons, you are going to sort them in the following order.

  1. The pokemon whose hp is not full (i.e. current hp < max hp) goes to the front

  2. The pokemon whose current hp is less goes to the front

  3. The pokemon whose max hp is less goes to the front

Please print the names, current hp, and max hp of the pokemons after you finish sorting. Refer to IO for format.

You are suggested to practice "struct"!

Input

The input is given in the following format :

 n
 name_1 c_1 m_1
 ...
 name_n c_n m_n

The first line contains an integer n (1 <= n <= 100). The next n lines are the names, current hp and max hp for each pokemon.

It is guaranteed that :

  • there will be no two pokemons with both same current hp and same max hp

  • 1 <= length of pokemon name <= 20, pokemon name contains English Alphabets only.

  • 0 <= current hp <= max hp <= 1000 for each pokemon

Output

Please print the names, current hp, and max hp of the pokemons after you finish sorting. Each line contains the pokemon's name, current hp, max hp, separated by space. There is no trailing space after max hp. Please add a new line character in the end of each line.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




13776 - Doraemon visits NTHU   

Description

           

 

Doraemon is planning a trip to Hsinchu and visiting the best university in Taiwan, the National Tsing Hua University. Unfortunately, after Doraemon arrives, what he wouldn't expect is it seems that all the building there is under construction! He discovers it has signs everywhere saying "Build Up Tsing Hua in the future". Therefore, Doraemon decides to see the real Tsing Hua by himself, so he takes the time machine to go to the future and see the beautiful campus in person.

Unfortunately, he discovers that it must have at least one place is under construction for every moment in NTHU, so he decides to count how many different construction projects he can see, and record them in his note.


In this problem, please notice the following description:

  • There are several lines in the note written by Doraemon, each line of it is in the following format: "<name of place 1>: <comment for place 1>, <name of place 2>: <comment for place 2>, ..., <name of place n>: <comment for place n>"
  • <name of place x> and <comment for place x> consist of lower-case and upper-case alphabets A-Z/a-z, dash -, parenthesis (), spaces  , and periods ., and both of them won't be empty strings.
  • In this problem, we say that if a place's comment contains the word "under construction" (case-insensitive), it means that the corresponding place is still being constructed. 
  • Read through all the lines, and output the name of the place which is still being constructed by the given order. Also, you will need to ignore the duplicate one, that is, only output the place the first time you see it being constructed.

Hint. You may use some string-related function to deal with this problem, this is the reference of some functions that might be helpful.

 

 

Input

The input contains several lines and ends with EOF (end of file).

Test case constraints

  • There are at most 15 lines
  • The length of each line is at most 1000
  • The length of <name of place x> and <comment for place x> is at most 30.

 

Output

For each place that is under construction, output one line contains the name of the places. Remember not to output the duplicate one.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss