You are viewing a single comment's thread. Return to all comments →
C++ Solution passing all tests
using namespace std;
int main()
{
unsigned long long int t,sn,n;
cin >> t;
for(int i=1;i<=t;i++)
cin >> n;
sn=(n%1000000007)*(n%1000000007)%1000000007;
cout << sn << endl;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Summing the N series
You are viewing a single comment's thread. Return to all comments →
C++ Solution passing all tests
include
using namespace std;
int main()
{
unsigned long long int t,sn,n;
cin >> t;
for(int i=1;i<=t;i++)
{
cin >> n;
sn=(n%1000000007)*(n%1000000007)%1000000007;
cout << sn << endl;
}
}