#include<bits/stdc++.h>
#define clr(x) memset(x,0,sizeof(x))
#define fr(i,x) for(long long i=0;i<x;i++)
#define ll long long
#define pi 3.14159265358979323846
using namespace std;
long long bigmul ( long long a, long long b, long long c ) {
if ( b == 0 ) return 0;
if ( b & 1 ) {
return ( a + bigmul ( a, b - 1, c ) ) % c;
}
else {
return ( 2 * bigmul ( a, b / 2, c ) ) % c;
}
}
int main()
{
ll a,b;
ll m=10000000000007;
while(cin>>a>>b)
{
ll x1=bigmul(a,b,m);
cout<<"X = "<<x1<<endl;
}
return 0;
}
#define clr(x) memset(x,0,sizeof(x))
#define fr(i,x) for(long long i=0;i<x;i++)
#define ll long long
#define pi 3.14159265358979323846
using namespace std;
long long bigmul ( long long a, long long b, long long c ) {
if ( b == 0 ) return 0;
if ( b & 1 ) {
return ( a + bigmul ( a, b - 1, c ) ) % c;
}
else {
return ( 2 * bigmul ( a, b / 2, c ) ) % c;
}
}
int main()
{
ll a,b;
ll m=10000000000007;
while(cin>>a>>b)
{
ll x1=bigmul(a,b,m);
cout<<"X = "<<x1<<endl;
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন