My issue
while(T–){
long long n;
cin >> n;
cout << (n-1)*(n-2)+1 << endl;
}
it is showing tle
My code
#include <bits/stdc++.h>
#include <ios>
using namespace std;
int main() {
int T;
cin >> T;
ios_base::sync_with_stdio(false);
cin.tie(0);
while(T--){
long long n;
cin >> n;
cout << (n-1)*(n-2)+1 << endl;
}
return 0;
}
Learning course: 1600 to 1800 difficulty problems
Problem Link: Odd Sum Practice Problem in - CodeChef