Problem

12 /23


Based on the exam 2018 - 1

Problem

The input of the program is a sequence of N positive integers, all numbers in the sequence are different. All pairs of distinct elements are considered  sequences (the elements of a pair do not have to be side by side in the sequence, the order of the elements in the pair is not important). It is necessary to determine the number of pairs for which the product of elements is divisible by 26.
 
Input
The first line of the input specifies the number of numbers N (\(1 < N <= 100000\)). Each of the following N lines contains one positive integer not exceeding 10,000.

Imprint
As a result, the program should print one number: the number of pairs in which the product of elements is a multiple of 26.
 

 

Examples
# Input Output
1
4
2
6
13
39
4

Explanation. From the four given numbers, 6 pairwise products can be made: 2*6, 2*13, 2*39, 6*13, 6*39, 13*39 (results: 12, 26, 78, 78, 234, 507). Of these, 4 works are divided into 26 (2*13=26; 2*39=78; 6*13=78; 6*39=234).