3 - MarisaOJ: Marisa Online Judge

3

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers, count the nummber of pairs of indices $i < j$ that $A_i + A_j$ is divisible by $3$. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print a single integer, which is the number of satisfied pairs. ### Constraints - $1 \le n \le 10^5$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 3 1 2 3 ``` Output: ``` 1 ```