mfgnik

Untitled

Oct 30th, 2020
859
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from math import sqrt
  2. number = int(input())
  3. square_line = int(sqrt(number - 1)) + 1
  4. start_number = (square_line - 1) ** 2
  5. finish_number = square_line ** 2
  6. if square_line % 2 == 1:
  7.     if finish_number - number > number - start_number:
  8.         print(square_line, 1 + number - start_number)
  9.     else:
  10.         print(1 + finish_number - number, square_line)
  11. else:
  12.     if finish_number - number > number - start_number:
  13.         print(1 + number - start_number, square_line)
  14.     else:
  15.         print(square_line, 1 + finish_number - number)
  16.  
RAW Paste Data