func main() const max: int :: 100000 var isPrime: []bool :: sieve(max) var cum: []int :: #[max + 1]int for i(1, max) do cum[i] :: cum[i - 1] + (isPrime[i] ?(1, 0)) end for var t: int :: cui@inputInt() for(1, t) var n: int :: cui@inputInt() do cui@print("\{cum[n]}\n") end for func sieve(n: int): []bool if(n < 2) ret[false].repeat(n + 1) end if var isPrime: []bool :: [true].repeat(n + 1) do isPrime[0] :: false do isPrime[1] :: false for i(2, n) if(isPrime[i]) var j: int :: i * i while(j <= n) do isPrime[j] :: false do j :+ i end while end if end for ret isPrime end func end func