#K63147. Frequency Counter

    ID: 31689 Type: Default 1000ms 256MiB

Frequency Counter

Frequency Counter

You are given a list of integers. Your task is to count the frequency of each integer in the list and output the result as a dictionary. The keys in the dictionary are the integers and the values are their respective counts. Formally, let \( A = [a_1, a_2, \dots, a_n] \) be the list of integers. You need to compute a mapping such that for every integer \( x \) in \( A \), its frequency is \( f(x) = \#\{ i : a_i = x \} \).

If the list is empty, output an empty dictionary: {}.

The output should display the keys in increasing order. For example, if the input is 6 followed by 1 2 2 3 3 3, the output should be:

{1: 1, 2: 2, 3: 3}

inputFormat

The first line of input contains an integer \( n \) which represents the number of elements in the list. If \( n > 0 \), the second line contains \( n \) space-separated integers. If \( n = 0 \), there is no second line and the list is considered empty.

outputFormat

Output a single line representing the frequency dictionary. The dictionary should be printed in the format {k1: v1, k2: v2, ...} where the keys are in increasing order. If the list is empty, output {}.

## sample
0
{}