ACMSGURU 111 - Very simple problem

2021-08-11 10:51:07 浏览数 (1)

Very simple problem

Problem Description

You are given natural number X. Find such maximum integer number that it square is not greater than X.

Input

Input file contains number X (1≤X≤10^1000).

Output

Write answer in output file.

Sample Input

16

Sample Output

4

Solution

代码语言:javascript复制
if __name__ == '__main__':

    n = int(input())
    x = n
    y = (x   1) // 2
    while y < x:
        x = y
        y = (x   n // x) // 2

    print(x)

0 人点赞