You must have heard of Goldbach's conjecture, a well-known unsolved problem in number theory. It is stated that every even integer greater than 2 can be written as a sum of two prime numbers. Simple, yet extremely hard! No mathematician has been able to prove this conjecture for nearly 300 years. For example:
4 = 2 + 2 14 = 3 + 116 = 3 + 3 = 7 + 7
8 = 3 + 5 16 = 3 + 13
10 = 3 + 7 = 5 + 11
= 5 + 5 18 = 5 + 13
12 = 5 + 7 = 7 + 11
...
G(i) = 1, 1, 1, 2, 1, 2, 2, 2 for i = 2..9
Given a number N, your task is to write a program to compute the following sum:
F(N) = G(2) + G(3) + ... + G(N)
The input file consists of several data sets. The first line of the input file contains the number of data sets which is a positive integer and is not bigger than 20. The following lines describe the data sets.
Each data set consists of only one line which contains an integer N (3 ≤ N ≤ 500000).
For each data set, write in a single line the sum F(N).
3 7 4 9
8 3 12
Migrated from old NTUJ.
The ACM-ICPC 2010 Asia Regional Contest, Site Hanoi
No. | Testdata Range | Score |
---|