File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
# Complete the squares function below.
10+
def squares(a, b):
11+
count = math.floor(math.sqrt(b)) - math.floor(math.sqrt(a - 1))
12+
return count
13+
14+
if __name__ == '__main__':
15+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
16+
17+
q = int(input())
18+
19+
for q_itr in range(q):
20+
ab = input().split()
21+
22+
a = int(ab[0])
23+
24+
b = int(ab[1])
25+
26+
result = squares(a, b)
27+
28+
fptr.write(str(result) + '\n')
29+
30+
fptr.close()

0 commit comments

Comments
 (0)