#include <iostream>
#include <cmath>
using namespace std;
int main(){
long long int a,b;
while(cin>>a>>b){
long double sum=0;
for(long long int i=a;i>a-b;i--)
sum+=log10((long double)i);
for(long long int i=b;i>1;i--)
sum-=log10((long double)i);
cout<<(long long int)(floor(sum))+1<<endl;
}
}
#include <cmath>
using namespace std;
int main(){
long long int a,b;
while(cin>>a>>b){
long double sum=0;
for(long long int i=a;i>a-b;i--)
sum+=log10((long double)i);
for(long long int i=b;i>1;i--)
sum-=log10((long double)i);
cout<<(long long int)(floor(sum))+1<<endl;
}
}
Comments
Post a Comment