Untitled
unknown
c_cpp
4 years ago
649 B
12
Indexable
#include <iostream>
#include <math.h>
using namespace std;
int main() {
// your code goes here
long long int T;
long long int N[300],D[300];
long long int i=0;
cin>>T;
long long int T1=T;
long double c;
while(T!=0)
{
cin>>N[i]>>D[i];
i++;
T--;
}
for(i=0;i<T1;i++)
{
if (D[i]<=10)
{
c=pow(2.0,D[i]);
if(c>N[i])
cout<<N[i]<<endl;
else
cout<<c<<endl;
}
else
{
c=((pow(3.0,(D[i]-10.0)))*1024.0);
if(c>N[i])
cout<<N[i]<<endl;
else
cout<<c<<endl;
}
}
return 0;
}
Editor is loading...