You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <cstdio>
|
|
#include <cmath>
|
|
int main()
|
|
{
|
|
long long n, sum = 0;
|
|
scanf("%lld", &n);
|
|
long long lmt = sqrt(n) + 5;
|
|
for (long long i = 2; i <= lmt; i++)
|
|
if (n % i == 0)
|
|
{
|
|
sum = (n - i) / 2;
|
|
break;
|
|
}
|
|
printf("%lld", sum + 1);
|
|
return 0;
|
|
} |