CRDS - Cards
#include <iostream>
using namespace std;
long int m = 1000007;
int main()
{
int t;
long long int n;
long long int result;
cin >> t;
while(t--)
{
cin >> n;
result = 0;
result += 3 * (n * (n + 1) / 2) - n;
result = result % m;
cout << result << endl;
}
return 0;
}
Comments
Post a Comment