#include <stdio.h>
int test(int n)
{
if (n <= 1)
return n;
int begin = 1;
int end = n / 2;
int middle;
while (begin <= end)
{
middle = (begin + end) / 2;
if (middle == n / middle)
return middle;
else
{
if (middle < n / middle)
begin = middle + 1;
else
end = middle - 1;
}
}
return end;
}
int main()
{
int n = 0;
printf("请输入一个数\n");
scanf("%d", &n);
int res = test(n);
printf("%d\n",res);
return 0;
}