Programming contests

DEIK Regionális Programozó Csapatverseny, egyetemi kategória, 2025. december 7.

December 7, 2025, 10:30 AM – December 7, 2025, 3:30 PM

primes-1

We call a positive number of the form ab2c3a b^2 c^3, where a<b<ca < b < c are prime numbers, a 123123 number. How many 123123 numbers are there in the interval [1,N][1, N] (YY)?

Input specification

The first line contains TT, the number of test cases. Then TT lines follow with the numbers Nk(k=1T)N_k ~~ (k=1\ldots T).

Output specification

TT lines with the requested numbers Yk(k=1T)Y_k~~(k=1\ldots T).

Constraints

1T1001\le T \le 100
1Nk1_000_000_000_000_0001\le N_k \le 1\_000\_000\_000\_000\_000

Sample input 1

  1. 8
  2. 10000
  3. 100000
  4. 1000000
  5. 10000000
  6. 100000000
  7. 1000000000
  8. 10000000000
  9. 100000000000
download as text file

Sample output 1

  1. 2
  2. 9
  3. 33
  4. 105
  5. 316
  6. 900
  7. 2482
  8. 6762
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024