#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
double r = 0;
ll n, k, i;
while(cin >> n >> k)
{
r = 0;
if(k*2 > n)
k = k+1;
else
k = n-k+1;
for(i=k;i<=n;i++)
r += log10(i) - log10(n-i+1);
cout << (int)r+1 << endl;
}
return 0;
}
#define ll unsigned long long int
using namespace std;
int main()
{
double r = 0;
ll n, k, i;
while(cin >> n >> k)
{
r = 0;
if(k*2 > n)
k = k+1;
else
k = n-k+1;
for(i=k;i<=n;i++)
r += log10(i) - log10(n-i+1);
cout << (int)r+1 << endl;
}
return 0;
}
Comments
Post a Comment