← Back to List

2097번: 조약돌 ↗

Solutions

Python 3
153 B | 153 chars
from math import sqrt
n = int(input())
w = int(sqrt(n))
h = n // w if n % w == 0 else n // w + 1

if w != 1:
  w -= 1
if h != 1:
  h -= 1
print(2*(w+h))