Thrashans

El concierto de Gustavo Leytón

Aug 27th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int t;
  8.     cin >> t;
  9.     while(t--)
  10.     {
  11.         long x;
  12.         cin >> x;
  13.         x *= x;
  14.         if(x % 2 == 0)
  15.             x += 1;
  16.         else
  17.             x -= 1;
  18.         cout << x << endl;
  19.     }
  20.     return 0;
  21. }
Add Comment
Please, Sign In to add comment