1. Problem
2. My Solution
import sys
import math
r = int(sys.stdin.readline().strip())
result1 = math.pi * (r**2)
result2 = 2*r*r
print(f"{result1:.6f}")
print(f"{result2:.6f}")
3. Learned
1. Problem
2. My Solution
import sys
import math
test_n = int(sys.stdin.readline().strip())
for i in range(test_n):
x1,y1,r1,x2,y2,r2 = map(int,sys.stdin.readline().strip().split())
d = math.sqrt((x1-x2)**2 + (y1-y2)**2)
if abs(r1 + r2) == d or abs(r1 - r2) == d:
print(1)
elif d == 0 and r1 == r2 :
print(-1)
elif abs(r1 - r2) < d < abs(r1 + r2):
print(2)
else:
print(0)
3. Others' Solutions
import sys
import math
test_n = int(sys.stdin.readline().strip())
for i in range(test_n):
x1,y1,r1,x2,y2,r2 = map(int,sys.stdin.readline().strip().split())
d = math.sqrt((x1-x2)**2 + (y1-y2)**2)
if d == 0 and r1 == r2 :
print(-1)
elif abs(r1 + r2) == d or abs(r1 - r2) == d:
print(1)
elif abs(r1 - r2) < d < abs(r1 + r2):
print(2)
else:
print(0)
4. Learned
if abs(r1 + r2) == d or abs(r1 - r2) == d:
print(1)
elif d == 0 and r1 == r2 :
print(-1)