Counting frequences P63414


Statement
 

pdf   zip

thehtml

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 n, followed by n natural numbers between 1000000000 and 1000001000 (both included).

Output

For each number x 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 x.

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 Python