Advertisement
nq1s788

Untitled

Nov 29th, 2022
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import math
  2.  
  3. n, r = map(int, input().split())
  4. if r * 2 <= n:
  5.     print(math.pi * r * r)
  6.     exit(0)
  7. if 2 * r >= n * math.sqrt(2):
  8.     print(n * n)
  9.     exit(0)
  10. print(math.pi * r * r - 4 * math.acos(n / r / 2)
  11.       * r * r + 2 * n * math.sqrt(r * r - n * n / 4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement