from bisect import bisect_right as br a = [] for i in range(1,10**15,2): if i*i>10**15:break a.append(i*i) p = [1<