Raw click events arrive as (user, timestamp) pairs in ARBITRARY order. For
each user, sort their events by timestamp and split them into sessions: a
new session starts when the gap since the user's previous event is MORE than
1800 seconds (exactly 1800 stays in the same session).
Count each user's sessions.
Input Format:
Line 1: n (number of events)
Lines 2 to n+1: "<user> <timestamp>" — user is a word, timestamp is an
integer epoch-seconds value
Output Format:
One line per user, sorted alphabetically by user:
<user> <session_count>