Problem

15 /23


Based on the Unified State Examination 2018 - 2

Problem

The input of the program is a natural number N (\(N<= 100000\)), and then N lines, each containing one integer. It is necessary to count the number of pairs of numbers whose indices differ by at least three and the product is a multiple of 29.
Write a memory and time efficient program.

 

Examples
# Input Output
1 6
29
7
8
29
4
5
3