func main() var nums: []int :: primeNums(100000) var t: int :: cui@inputInt() for(1, t) do cui@print("\{nums[cui@inputInt()]}\n") end for func primeNums(n: int): []int if(n < 2) ret[0].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 var res: []int :: #[n + 1]int for i(1, n) do res[i] :: res[i - 1] + (isPrime[i] ?(1, 0)) end for ret res end func end func