P21799 [GeeksforGeeks] Pairs which are divisible by 41920
普及-
题目描述

Given an array, if ‘n’ positive integers, count the number of pairs of integers in the array that have the sum divisible by 4.
Example 1:
Input : Arr[] = {2, 2, 1, 7, 5}
Output : 3
Explanation:
(2,2), (1,7) and(7,5) are the 3 pairs.
Example 2:
Input : Arr[] = {2, 2, 3, 5, 6}
Output : 4

Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function count4Divisibiles() that takes an array (arr), sizeOfArray (n), and return the number of pairs. The driver code takes care of the printing.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).
Constraints:
1 ≤ N ≤ 10^{5}
1 ≤ arr[] ≤ 10^{5}

输入格式

见题面

输出格式

见题面

样例输入
Arr[] = {2, 2, 1, 7, 5}
样例输出
3