Preparing NOJ

# Pythons

1000ms 65536K

## Description:

The fish and game commission in South Florida has been catching and measuring

Burmese Pythons in the Everglades. Needless to say, this is a little scary, since these

critters have been rumored to swallow alligators and young computer programmers. The

game officers have been collecting information about their catches, listing the weight in

pounds, along with the date when the snake was caught. Your job is to produce a list of

snakes in ascending order by weight. For any snakes that have the same weight, they

must be listed in ascending order by date.

## Input:

The first line contains N, indicating the number of data sets that will follow. For each

dataset, the next line contains S, which indicates the number of snake samples in the

current data set. Then, for each value of S, each of the following lines contain two values:

each Python's weight, followed by the date when the python was caught (in mm/dd/yyyy

order), separated by one space. The dates within each data set are guaranteed to be in

ascending order. Here is a sample dataset:

## Output:

For each dataset, display the snake's weight, followed by a single space, followed by the

date when the snake was caught. Display the values in order by weight from lowest to

highest. This is called the primary sort. But for any duplicate weight values, the dates

should be in increasing order. For example, in the following sample output, notice the

specific ordering of the dates for the three snakes weighing 120 pounds. Follow ever data

set with a blank line. Here is a sample that matches the sample input data:

## Sample Input:

2385 10/22/200866 3/1/200976 5/12/20096120 4/10/2009120 6/5/200930 8/21/200985 9/2/200962 10/22/2009120 1/12/2010

## Sample Output:

66 3/1/200976 5/12/200985 10/22/2008By Kip Irvine30 8/21/200962 10/22/200985 9/2/2009120 4/10/2009120 6/5/2009120 1/12/2010

## Note:

undefined

Info

Provider NOJ

Code NOJ1387

Tags

Submitted 1

Passed 1

AC Rate 100%

Date 04/20/2019 10:03:10

Related

Nothing Yet