Triple Fat Ladies
Link to the question : EIGHTS
HINT :
No need to hard code. Just take out your calculator and check for the first few numbers whose cube ends with 888 and observe the pattern.
Still cant get the pattern?
Here it is :
SOURCE CODE :
#include<iostream>
using namespace std;
int main()
{
long long k,t;
cin>>t;
while(t--)
{
cin>>k;
cout<<192 + (k-1)*250<<endl;
}
return 0;
}
No comments:
Post a Comment