Help me in solving ODDSUM problem

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

@kali_69
use “\n” instead of endl;

1 Like

Thanks sir, but what was the issue with the endl; ???