Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EIUATTEND2 - Lesson Attendance

You are given an attendance list of a class. Suppose that there are some students attend all lessons, and every student joinned at least one lessons.

Your task is to write a program to print out class’s start time, attendance rate.

Input

-          The first line contains an integer M – attendance list size (1 £ M £ 105).

-          Each line in the next M lines represents 3 integers: class’s start time (in milliseconds format), student ID and class ID followed by a boolean isCheckin (0 - absence or 1 - present) . All integers don’t exceed 1018.

Output

The required sorted list. Each line in the output contains class’s start time, attendance rate (rounded to 2 decimal places, String.format("%.2f",…)). The list should be sorted in descending order of attendance rate and ascending order of class’s start time.

Sample

Input

Output

5

1656894600000 001 0001 1

1656894600000 002 0001 1

1657153800000 001 0001 1

1657499400000 001 0001 1

1657499400000 002 0001 0

1656894600000 1.00

1657153800000 0.50

1657499400000 0.50

 


Added by:Ha Minh Ngoc
Date:2022-08-29
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: GOSU
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.