// UVa 10276 - Hanoi Tower Troubles Again! #include <iostream> using namespace std; int main() { int t; for (cin >> t; t; t--) { int n; cin >> n; cout << (n + 1) * (n + 1) / 2 - 1 << endl; } return 0; }
How this formula works?
Can you explain why this formula is right?
EXPLANATION !!!!!!!!!!
How this formula works?
ReplyDeleteCan you explain why this formula is right?
ReplyDeleteEXPLANATION !!!!!!!!!!
ReplyDelete