malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   int p[100005], q[100005], n, m, V;   double a[100005], x[100005], y[100005], dx[100005], dy[100005], h, vx, vy, t, w;   bool cmp1(const int i, const int j) { return a[i] < a[j]; }   bool cmp2(const int i, const int j) { return x[i] < x[j]; }   bool up(double t, double y) { return (h = vy * t - 9.8 * t * t / 2) > y; }   int main() {     scanf( %d%d , &n, &V);     for (int i = 0; i < n; i++) scanf( %lf , &a[i]), q[i] = i;     scanf( %d , &m);     for (int i = 0; i < m; i++) scanf( %lf %lf , &x[i], &y[i]), p[i] = i;     std::sort(q, q + n, cmp1);     std::sort(p, p + m, cmp2);     int j = 0;     for (int k = 0; k < n; k++) {       int i = q[k];       vx = V * cos(a[i]), vy = V * sin(a[i]), t = vy / 4.9, w = vx * t;       while (j < m && x[p[j]] < w && up(x[p[j]] / vx, y[p[j]])) j++;       if (j < m && x[p[j]] < w)         dx[i] = x[p[j]], dy[i] = h;       else         dx[i] = w;     }     for (int i = 0; i < n; i++) printf( %lf %lf n , dx[i], dy[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1};   int dy[] = {0, 0, 1, -1, -1, 1, -1, 1};   map<int, bool> ans;   map<long long, int> dp;   int rec(long long q) {     if (ans[q] == 1) return dp[q];     vector<int> v;     long long sq = sqrt(q);     int mex, x;     for (int l = 2; l < sq + 1; l++) {       if (!(q % l)) {         x = rec(l);         v.push_back(x);         x = rec(q / l);         v.push_back(x);       }     }     if (v.size() == 0)       mex = 1;     else {       sort(v.begin(), v.end());       (v).erase(unique((v).begin(), (v).end()), (v).end());       int len = v.size();       mex = 0;       for (int l = 0; l < len; l++) {         if (v[l] != mex) break;         mex++;       }     }     ans[q] = 1;     return dp[q] = mex;   }   bool chq(long long q) {     long long sq = sqrt(q);     for (int l = 2; l < sq + 1; l++) {       if (!(q % l)) return 0;     }     return 1;   }   long long go(long long q) {     long long sq = sqrt(q);     int x;     for (int l = 2; l < sq + 1; l++) {       if (!(q % l)) {         x = dp[l];         if (!x) return l;         x = dp[q / l];         if (!x) return q / l;       }     }   }   int main() {     int t, z = 0, len;     long long n, k = 0, m = 0;     scanf( %lld , &n);     bool prime = chq(n);     if (prime) {       printf( 1 n );       printf( 0 n );       return 0;     }     k = rec(n);     if (!k)       printf( 2 n );     else {       printf( 1 n );       m = go(n);       printf( %lld , m);       printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, p = 0;     cin >> n;     int a[2 * n], i, j;     for (i = 0; i < 2 * n; i++) cin >> a[i];     for (i = 0; i < 2 * n; i++) {       if (a[i] == a[i + 1] && a[i] != -1)         i = i + 1;       else if (a[i] != -1) {         for (j = i + 1; j < 2 * n; j++) {           if (a[j] != a[i] && a[j] != -1)             p++;           else if (a[j] != -1) {             a[j] = -1;             break;           }         }       }     }     cout << p << endl;     return 0;   }
#include <bits/stdc++.h>   char num[10][10];   int main() {     for (int i = 1; i < 9; i++) scanf( %s , num[i]);     bool yes = true;     for (int i = 1; i <= 8; i++) {       int cntb = 0, cntw = 0;       char pre =  * ;       for (int j = 0; j < 8; j++) {         if (num[i][j] == pre) {           yes = false;           break;         }         if (num[i][j] ==  W ) {           cntw++;           pre = num[i][j];         }         if (num[i][j] ==  B ) {           cntb++;           pre = num[i][j];         }       }       if (cntb != cntw) {         yes = false;       }     }     printf( %s n , yes ?  YES  :  NO );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[100000];   int b[100001];   int c1[100001];   int c2[100001];   int main() {     int n, c = 0, x = 0, y = 0, z1 = 0, z2 = 0, i;     long long ans = 0;     scanf( %d , &n);     for (i = 0; i < n; i++) scanf( %d , &a[i]);     for (i = 0; i < n; i++) {       b[a[i]]++;       if (b[a[i]] % 2 == 0) {         c--;       } else {         c++;       }     }     if (c >= 2) {       puts( 0 );       return 0;     }     for (i = 0; i < n / 2; i++) {       if (a[i] != a[n - i - 1]) break;       x++;     }     if (x == n / 2) {       printf( %I64d n , (long long)n * (n + 1) / 2);       return 0;     }     for (i = n / 2 - 1; i >= 0; i--) {       if (a[i] != a[n - i - 1]) break;       y++;     }     for (i = 0; i < x; i++) c1[a[i]]++;     for (i = x; i < n / 2; i++) {       c1[a[i]]++;       if (c1[a[i]] * 2 > b[a[i]]) break;       z1++;     }     for (i = 0; i < x; i++) c2[a[i]]++;     for (i = x; i < n / 2; i++) {       c2[a[n - i - 1]]++;       if (c2[a[n - i - 1]] * 2 > b[a[n - i - 1]]) break;       z2++;     }     for (i = 0; i <= x; i++) {       ans += x + z1 + z2 + 1;       if (x + z1 == n / 2) {         if (n % 2 == 1) {           if (b[a[n / 2]] % 2 == 1) {             ans++;             ans += min(y, n / 2 - i);           }         } else {           ans += min(y, n / 2 - i);         }       }       if (x + z2 == n / 2) {         if (n % 2 == 1) {           if (b[a[n / 2]] % 2 == 1) {             ans++;             ans += min(y, n / 2 - i);           }         } else {           ans += min(y, n / 2 - i);         }       }     }     printf( %I64d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct hero {     int power;     int nr;   };   int main() {     int n, m;     int board[100];     hero heroes[100];     vector<int> left, right;     cin >> n >> m;     for (int i = 0; i < n; ++i) heroes[i].nr = -1;     int l_ind = n;     int r_ind = -1;     for (int si, hi, i = 0; i < m; ++i) {       cin >> si >> hi;       heroes[si - 1].nr = i + 1;       heroes[si - 1].power = hi;       if (si - 1 < l_ind) l_ind = si - 1;       if (si - 1 > r_ind) r_ind = si - 1;     }     for (int i = 0; i < n; ++i) cin >> board[i];     int cur_pow = heroes[l_ind].power;     int cur_hero = heroes[l_ind].nr;     if (m == 1) {       cout << l_ind + 1 <<   n1  << endl;       return 0;     }     while (l_ind < n - 1 && l_ind + 1 < r_ind) {       if (board[l_ind + 1] >= 0) {         cur_pow += board[l_ind + 1];         if (heroes[l_ind + 1].nr != -1) {           if (heroes[l_ind + 1].power > cur_pow) {             left.push_back(cur_hero);             cur_hero = heroes[l_ind + 1].nr;             cur_pow = heroes[l_ind + 1].power;           } else {             left.push_back(heroes[l_ind + 1].nr);           }         }       } else {         if (cur_pow + board[l_ind + 1] >= 0)           cur_pow += board[l_ind + 1];         else {           break;         }       }       ++l_ind;     }     left.push_back(cur_hero);     cur_hero = heroes[r_ind].nr;     cur_pow = heroes[r_ind].power;     while (r_ind > 0 && l_ind < r_ind - 1) {       if (board[r_ind - 1] >= 0) {         cur_pow += board[r_ind - 1];         if (heroes[r_ind - 1].nr != -1) {           if (heroes[r_ind - 1].power > cur_pow) {             right.push_back(cur_hero);             cur_hero = heroes[r_ind - 1].nr;             cur_pow = heroes[r_ind - 1].power;           } else {             right.push_back(heroes[r_ind - 1].nr);           }         }       } else {         if (cur_pow + board[r_ind - 1] >= 0)           cur_pow += board[r_ind - 1];         else {           break;         }       }       --r_ind;     }     right.push_back(cur_hero);     if (abs(l_ind - r_ind) > 1)       cout <<  -1  << endl;     else {       cout << l_ind + 1 << endl;       for (auto it = left.end() - 1; it >= left.begin(); --it)         cout << (*it) <<    ;       for (auto it = right.end() - 1; it >= right.begin(); --it)         cout << (*it) <<    ;       cout << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double PI = 3.14159265358979323846;   const int N = 1e6 + 5;   const long long MOD = 1000000007;   int dx[] = {0, 1, 0, -1};   int dy[] = {1, 0, -1, 0};   bool cmp(const pair<int, int>& a, const pair<int, int>& b) {     return (a.second < b.second);   }   int gcd(int a, int b) {     if (b == 0) return a;     return gcd(b, a % b);   }   long long power(long long n, long long k) {     if (k == 0) return 1;     long long sq = (power(n, k / 2));     sq = (sq * sq);     if (k % 2 == 1) sq = (sq * n);     return sq;   }   bool isPrime(int n) {     if (n <= 1) return false;     if (n <= 3) return true;     if (n % 2 == 0 || n % 3 == 0) return false;     for (int i = 5; i * i <= n; i = i + 6)       if (n % i == 0 || n % (i + 2) == 0) return false;     return true;   }   string to_binary(int x) {     string s;     while (x > 0) {       s += (x % 2 ?  1  :  0 );       x /= 2;     }     reverse(s.begin(), s.end());     return s;   }   bool isPerfect(long long x) {     if (x < 1) return false;     long long root(round(sqrt(x)));     return x == root * root * 1LL;   }   bool valid(int i, int j, int n, int m) {     return i >= 0 && i < n && j >= 0 && j < m;   }   long long FastPower(long long x, long long y) {     return (!y ? 1                : (((y & 1) ? x : 1) % MOD *                   FastPower((x % MOD) * (x % MOD) % MOD, y >> 1) % MOD) %                      MOD);   }   void solve() {     int n;     cin >> n;     vector<pair<int, int>> arr(n);     vector<int> ans;     long long all_sum = 0;     for (int i = 0; i < n; i++)       cin >> arr[i].first, arr[i].second = i, all_sum += arr[i].first;     sort((arr).begin(), (arr).end());     bool flg = true;     for (int i = 0; i < n - 1; i++) {       if ((all_sum - arr[i].first - arr[n - 1].first) == arr[n - 1].first)         ans.push_back(arr[i].second + 1), flg = false;     }     if ((all_sum - arr[n - 1].first - arr[n - 2].first) == arr[n - 2].first)       ans.push_back(arr[n - 1].second + 1), flg = false;     if (((int)((ans).size())) == 0) {       cout << ((int)((ans).size())) <<   n ;     } else {       cout << ((int)((ans).size())) <<   n ;       for (int i = 0; i < ((int)((ans).size())) - 1; i++) cout << ans[i] <<    ;       cout << ans[((int)((ans).size())) - 1] <<   n ;     }   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     int t = 1;     while (t--) solve();   }
#include <bits/stdc++.h>   using namespace std;   ifstream in( input.txt );   ofstream out( output.txt );   int main() {     vector<int> a;     int n, x;     cin >> n >> x;     a.resize(100001);     vector<int> b;     for (int i = 0; i < n; i++) {       int t;       cin >> t;       a[t]++;       b.push_back(t);     }     unsigned long long ans = 0;     for (int i = 0; i < n; i++) {       if ((b[i] ^ x) == b[i]) {         ans += (a[b[i]] - 1);       } else if ((b[i] ^ x) < 100001) {         ans += a[b[i] ^ x];       }       a[b[i]]--;     }     cout << ans;   }
#include <bits/stdc++.h>   #define ll long long   #define nl   n    #define vpn 1000000   using namespace std;   ll t,n,dismin;   ll a[vpn],b[vpn];   ll gcd(ll x, ll y)   {       if (y==0) return x;       return gcd(y,x%y);   }   int main()   {       ios::sync_with_stdio(0);       cin.tie(0);       cin>>t;       while (t--)       {           cin>>n;           for(ll i=1;i<=n;i++)               cin>>a[i];           sort(a+1,a+n+1);           if (a[1]<0) cout<< NO <<nl;           else           {               if (a[n]<=300)               {                   cout<< YES <<nl;                   if (a[1]!=0)                   {                       cout<<a[n]<<nl;                   for (ll i=1;i<=a[n];i++)                       cout<<i<<   ;                   }                   else                   {                       cout<<a[n]+1<<nl;                       for (ll i=0;i<=a[n];i++)                           cout<<i<<   ;                   }                   cout<<nl;               }               else               {                   bool ans=true;                   vector<ll> dis;                   for (ll i=2;i<=n;i++)                       dis.push_back(a[i]-a[i-1]);                   ll pos;                   pos=dis[0];                   for (ll i=1;i<dis.size();i++)                   {                       pos=gcd(pos,dis[i]);                       if (pos==1)                       {                           cout<< NO <<nl;                           ans=false;                           break;                       }                   }                   if (ans==true)                   {                       if (((a[n]-pos)/pos+1)>300) cout<< NO <<nl;                       else                       {                           cout<< YES <<nl;                           if (a[1]==0)                           {                               cout<<((a[n]-pos)/pos+2)<<nl;                               cout<<a[1]<<   ;                           }                           else cout<<((a[n]-pos)/pos+1)<<nl;                           for (ll i=pos;i<=a[n];i+=pos)                               cout<<i<<   ;                           cout<<nl;                       }                   }               }           }       }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     long long t = 0, i, j, n;     long long arr[100002];     cin >> n;     for (i = 0; i < n; ++i) {       cin >> arr[i];       t += arr[i];     }     if (t % (n - 1) == 0) {       j = t / (n - 1);     } else {       j = t / (n - 1) + 1;     }     long long mx = *max_element(arr, arr + n);     cout << max(mx, j);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using ii = pair<ll, ll>;   inline int get_state(ll s, int x) { return ((s >> (5 * x)) & 0x1f); }   inline ll set_state(ll s, ll v, int x) {     return ((s & ~(0x1fLL << (5 * x))) | (v << (5 * x)));   }   int cs[10];   map<ll, int> st;   map<ll, ii> ps;   bool kill_all(ll s, int n, int a, int b) {     for (int i = 2; i <= n - 1; ++i)       if (cs[i] >           b * get_state(s, i - 1) + a * get_state(s, i) + b * get_state(s, i + 1))         return false;     return true;   }   bool all_dead(ll s, int pos, int a, int b) {     for (int i = pos - 1; i <= pos + 1; ++i) {       if (cs[i] >           b * get_state(s, i - 1) + a * get_state(s, i) + b * get_state(s, i + 1))         return false;     }     return true;   }   int dp(ll s, int n, int a, int b) {     if (s == 0) return 0;     auto it = st.find(s);     if (it != st.end()) {       return it->second;     }     auto res = 1000000000;     for (int i = 2; i <= n - 1; ++i) {       if (get_state(s, i - 1) or get_state(s, i) or get_state(s, i + 1)) {         auto r = set_state(s, max(get_state(s, i) - a, 0), i);         r = set_state(r, max(get_state(r, i - 1) - b, 0), i - 1);         r = set_state(r, max(get_state(r, i + 1) - b, 0), i + 1);         auto value = dp(r, n, a, b) + 1;         if (value < res) {           res = value;           ps[s] = ii(r, i);         }       }     }     st[s] = res;     return res;   }   vector<int> solve(int n, int a, int b) {     vector<int> shoots;     ll s = 0;     for (int i = 1; i <= n; ++i) s = set_state(s, cs[i], i);     while (cs[1] > 0) {       shoots.push_back(2);       cs[1] -= b;       cs[2] -= a;       cs[3] -= b;       s = set_state(s, max(get_state(s, 1) - b, 0), 1);       s = set_state(s, max(get_state(s, 2) - a, 0), 2);       s = set_state(s, max(get_state(s, 3) - b, 0), 3);     }     while (cs[n] > 0) {       shoots.push_back(n - 1);       cs[n] -= b;       cs[n - 1] -= a;       cs[n - 2] -= b;       s = set_state(s, max(get_state(s, n - 2) - b, 0), n - 2);       s = set_state(s, max(get_state(s, n - 1) - a, 0), n - 1);       s = set_state(s, max(get_state(s, n) - b, 0), n);     }     dp(s, n, a, b);     auto it = ps.find(s);     while (it != ps.end()) {       s = it->second.first;       shoots.push_back(it->second.second);       it = ps.find(s);     }     for (int i = 2; i <= n - 1; ++i)       for (int j = 0; j < get_state(s, i); ++j) shoots.push_back(i);     return shoots;   }   int main() {     int n, a, b;     cin >> n >> a >> b;     for (int i = 1; i <= n; ++i) {       cin >> cs[i];       ++cs[i];     }     auto shoots = solve(n, a, b);     cout << shoots.size() << endl;     for (size_t i = 0; i < shoots.size(); ++i)       printf( %d%c , shoots[i],    n [i + 1 == shoots.size()]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void init() {}   const int N = 63e5 + 34;   const long long INF = 2e9 + 34;   int MD = 30;   string sym =  AHIMOTUVWXYovwx ;   void fail() {     cout <<  NIE ;     exit(0);   }   int main() {     init();     string s;     cin >> s;     int n = s.length();     if (n % 2 && sym.find(s[n / 2]) > 3000) fail();     for (int i = 0; i < n / 2; i++) {       if (sym.find(s[i]) < 3000 && sym.find(s[n - i - 1]) < 300 &&           s[i] == s[n - i - 1])         continue;       if (s[i] ==  b  && s[n - i - 1] ==  d ) continue;       if (s[i] ==  d  && s[n - i - 1] ==  b ) continue;       if (s[i] ==  p  && s[n - i - 1] ==  q ) continue;       if (s[i] ==  q  && s[n - i - 1] ==  p ) continue;       fail();     }     cout <<  TAK ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 2000 + 5;   const int MOD = 1000000000 + 7;   int n, k;   int a[maxn], e[maxn], s[maxn], t[maxn];   inline void mm(int a[], int b[]) {     for (int i = 0; i < n; i++) {       t[i] = 0;       for (int j = 0; j <= i; j++)         t[i] = ((long long)a[j] * b[i - j] + t[i]) % MOD;     }     for (int i = 0; i < n; i++) a[i] = t[i];   }   int main() {     cin >> n >> k;     for (int i = 0; i < n; i++) {       scanf( %d , a + i);       e[i] = 1;     }     s[0] = 1;     while (k) {       if (k & 1) mm(s, e);       mm(e, e);       k >>= 1;     }     mm(a, s);     for (int i = 0; i < n; i++) printf( %d  , a[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200001;   int cs1[N];   int cs2[N];   int ss1[N];   int ss2[N];   int sum(int i, int cs[]) {     int s = 0;     while (i > 0) {       s += cs[i];       i -= i & -i;     }     return s;   }   void add(int i, int k, int cs[]) {     while (i < N) {       cs[i] += k;       i += i & -i;     }   }   int main() {     int n, k, a, b, q;     cin >> n >> k >> a >> b >> q;     for (int i = 0; i < q; ++i) {       int c;       scanf( %d , &c);       if (c == 1) {         int d, aa;         scanf( %d%d , &d, &aa);         add(d, min(aa, b - ss1[d]), cs1);         add(d, min(aa, a - ss2[d]), cs2);         ss1[d] = min(ss1[d] + aa, b);         ss2[d] = min(ss2[d] + aa, a);       } else {         int p;         scanf( %d , &p);         int o = sum(n, cs2) - sum(p + k - 1, cs2) + sum(p - 1, cs1);         printf( %d n , o);       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int ans = 0, a, b, a2, b2;     cin >> a >> b;     while (((a != 0) and (b != 0))) {       if ((a + b) <= 2) {         cout << ans << endl;         return 0;       }       if (2 * a <= b) {         cout << ans + a << endl;         return 0;       }       if (2 * b <= a) {         cout << ans + b << endl;         return 0;       }       if (a == 2 and b == 2) {         cout << ans + 1 << endl;         return 0;       }       int aux = a;       int aux2 = b;       a = min(aux, aux2);       b = max(aux, aux2);       while (a < b) {         a--;         b -= 2;         ans++;       }       aux = a / 3;       a = a - aux * 3;       b = b - aux * 3;       aux = aux * 2;       ans += aux;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   template <class T, class U>   inline void Max(T &a, U b) {     if (a < b) a = b;   }   template <class T, class U>   inline void Min(T &a, U b) {     if (a > b) a = b;   }   char s[3][105];   int ok[3][105], dp[105][3];   pair<int, int> b[3][105];   int main() {     int T, i, j, k, m, n;     scanf( %d , &T);     while (T--) {       scanf( %d%d , &n, &m);       for (i = 0; i < 3; i++) scanf( %s , s[i]);       int st, c[3] = {0};       for (i = 0; i < 3; i++)         if (s[i][0] ==  s ) {           st = i;           break;         }       for (i = 0; i < 3; i++) {         for (j = 0; j < n; j++)           if (s[i][j] >=  A  && s[i][j] <=  Z ) {             k = j;             while (k < n && s[i][k] == s[i][j]) k++;             b[i][c[i]] = make_pair(j, k - 1);             c[i]++;             j = k - 1;           }       }       memset(dp, 0, sizeof(dp));       memset(ok, 0, sizeof(ok));       dp[0][st] = 1;       for (i = 0; i < n - 1; i++) {         for (j = 0; j < 3; j++) {           for (k = 0; k < c[j]; k++) {             if (b[j][k].first <= i + 1 && b[j][k].second >= i + 1) {               ok[j][i + 1] = 1;             }             if (b[j][k].first <= i && b[j][k].second >= i) {               dp[i][j] = 0;             }           }         }         if (dp[i][0]) {           if (!ok[0][i + 1]) {             dp[i + 1][0] = 1;             if (!ok[1][i + 1]) dp[i + 1][1] = 1;           }         }         if (dp[i][1]) {           if (!ok[1][i + 1]) {             dp[i + 1][1] = 1;             if (!ok[0][i + 1]) dp[i + 1][0] = 1;             if (!ok[2][i + 1]) dp[i + 1][2] = 1;           }         }         if (dp[i][2]) {           if (!ok[2][i + 1]) {             dp[i + 1][2] = 1;             if (!ok[1][i + 1]) dp[i + 1][1] = 1;           }         }         for (j = 0; j < 3; j++) {           for (k = 0; k < c[j]; k++) b[j][k].first -= 2, b[j][k].second -= 2;         }       }       if (dp[n - 1][0] || dp[n - 1][1] || dp[n - 1][2])         puts( YES );       else         puts( NO );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int mod = 1000000000 + 7;   const long long int N = 10000000 + 6;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int q;     cin >> q;     for (int i = 0; i < q; ++i) {       long long n;       cin >> n;       vector<int> vals;       int pos2 = -1;       while (n > 0) {         vals.push_back(n % 3);         if (vals.back() == 2) pos2 = int(vals.size()) - 1;         n /= 3;       }       vals.push_back(0);       if (pos2 != -1) {         int pos0 = find(vals.begin() + pos2, vals.end(), 0) - vals.begin();         vals[pos0] = 1;         for (int i = pos0 - 1; i >= 0; --i) {           vals[i] = 0;         }       }       long long ans = 0;       long long pw = 1;       for (int i = 0; i < int(vals.size()); ++i) {         ans += pw * vals[i];         pw *= 3;       }       if (vals.back() == 1) ans = pw / 3;       cout << ans << endl;     }     return 0;   }