#K34092. Earthquake Magnitude Counter

    ID: 25232 Type: Default 1000ms 256MiB

Earthquake Magnitude Counter

Earthquake Magnitude Counter

Given a sequence of earthquake events, each event is described by three values: a magnitude, a latitude, and a longitude. Your task is to count the number of events, grouping them by the integer value of their magnitude obtained by rounding using the standard rounding rule. In other words, for each event with magnitude \(m\), compute \(\text{round}(m)\) and count the frequency of each resulting integer.

The final output should list each unique rounded magnitude in ascending order along with its corresponding count.

Note: The rounding follows standard rules, i.e., values ending with .5 or higher are rounded up, and those below .5 are rounded down. Formally, the rounded magnitude is given by \(\text{Rounded magnitude} = \text{round}(m)\).

inputFormat

The input is provided via standard input (stdin) with the following format:

  • The first line contains an integer \(N\) — the number of earthquake events.
  • Each of the next \(N\) lines contains three space-separated floating-point numbers representing the magnitude, latitude, and longitude of an event.

outputFormat

For each unique rounded magnitude, output a line containing two space-separated integers: the rounded magnitude and the count of events with that rounded magnitude. The lines should be ordered in ascending order of the magnitude.

## sample
6
4.1 34.5 -117.5
6.7 40.7 -74.0
4.3 34.5 -118.5
6.9 -33.9 151.2
4.2 36.3 -120.1
6.8 38.0 -122.1
4 3

7 3

</p>