Counting frequences P63414


Statement
 

pdf   zip

Write a program that reads a sequence of natural numbers and that prints, for each one, how many times it appears.

Input

Input consists of a natural number nn, followed by nn natural numbers between 1000000000 and 1000001000 (both included).

Output

For each number xx that appears in the sequence, print how many times it appears, following the format of the example. The output must be sorted in increasing order by xx.

Public test cases
  • Input

    7
    1000000001 1000000011 1000000011 1000000004 1000000004 1000000200 1000000004
    

    Output

    1000000001 : 1
    1000000004 : 3
    1000000011 : 2
    1000000200 : 1
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java JavaScript Python