SHARE
TWEET

Untitled

a guest Jan 24th, 2020 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     long long n;
  7.     long long x;
  8.     long long y;
  9.     cin >> n;
  10.     int k{0};
  11.     if (n % 2 == 0)
  12.         {
  13.             if (n % 4 == 0 && n > 4)
  14.             {
  15.                 y = n/4 - 1;
  16.                 x = y + 2;
  17.                 k = 0;
  18.             }
  19.             else
  20.                 k = 1;
  21.         }
  22.     else
  23.     {
  24.         if (n <= 1)
  25.             k = 1;
  26.         else
  27.         {
  28.             y = n / 2;
  29.             x = y + 1;
  30.             k = 0;
  31.         }
  32.     }
  33.     if (n == 0)
  34.     {
  35.         x = 1;
  36.         y = 1;
  37.         k = 0;
  38.     }
  39.     if (k == 1)
  40.         cout << "No";
  41.     else
  42.     {
  43.         cout << "Yes" << endl;
  44.         cout << x << " " << y;
  45.     }
  46.     return 0;
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top