akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define X ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(2)<<(x)


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif


long long p = 1e9+7;
typedef pair<int, int> pi;
typedef unordered_map<int, int> UMP;
typedef long long ll;
typedef vector<ll> VI;
#define FOR(i,b) for(i=0;i<b;i++)
#define pb push_back


void printa(VI x,ll n){
	ll i;
	FOR(i, n){
		cout<<x[i]<<" ";
	}
	cout<<endl;
}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
    #endif
    long long n;
    cin>>n;
    ll i=2, ans = 0;
    VI x;
    for(ll i=1;i<60;i++){
        x.pb(i*(i+1)/2);
    }
    ll mx = (ll) sqrt(n)+2;
    while(i< mx){
        ll tmp = 0;
        while(n%i==0){
            n = n/i;
            tmp+=1;
        }
        i++;
        ans += upper_bound(x.begin(), x.end(), tmp)-x.begin();
    }
    if(n!=1){ans++;}
    cout<<ans;
}



Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

template<typename T>
ostream& operator<<(ostream &os, vector<T> &v){
	string sep = " ";
	if(v.size()) os << v[0];
	for(int i=1; i<v.size(); i++) os << sep << v[i];
	return os;
}

#ifdef DBG
void debug_(){ cout << endl; }
template<typename T, typename... Args>
void debug_(T&& x, Args&&... xs){
	cout << x << " "; debug_(forward<Args>(xs)...);
}
#define dbg(...) debug_(__VA_ARGS__);
#else
#define dbg(...) 
#endif

int main() {
	ios_base::sync_with_stdio(false);

	int n; cin >> n;
	vector<ll> a(n);
	for(int i=0; i<n; i++) cin >> a[i];

	sort(a.rbegin(), a.rend());
	map<ll, int> cnt;
	for(ll x: a) cnt[x]++;
	vector<bool> use(n);

	int ans = 0;
	for(int i=0; i<n; i++){
		ll x = a[i];
		for(int k=32; k>=0; k--){
			ll y = 1ll<<k;
			if(cnt.count(x)==0||cnt[x]==0) break;
			if(y <= x) break;
			if(2*x==y){
				if(cnt[x]>1){
					cnt[x]-=2;
					ans++;
					dbg(x, y);
					if(cnt[x]==0) cnt.erase(x);
				}
			} else if(cnt.count(y-x)>0&&cnt[y-x]>0){
				cnt[y-x]--;
				cnt[x]--;
				if(cnt[y-x]==0) cnt.erase(y-x);
				if(cnt[x]==0) cnt.erase(x);
				dbg(x, y);
				ans++;
			}
		}
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 14336
N = gets.to_i
As = gets.split.map(&:to_i)

f = ->(n){n > 1 ? n*(n - 1)/2 : 0}
h = As.group_by(&:itself).map{|k, v| [k, v.size]}.to_h
s = h.values.inject(0){|r, n| r + f[n]}
As.each{|a| puts s - f[h[a]] + f[h[a] - 1]}

Measured memory_bytes: 48260
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            string ss = Console.ReadLine();

            int count = 0;

            foreach(var s in ss)
            {
                if(s == '1')
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }


    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#define writeln printf("\n")
using namespace std;
typedef long long LL;
typedef double DB;
const int MAXN = 20;
const DB eps = 1e-7;
int len;
LL d[MAXN], dp[MAXN][14][3];
LL n, m;
int main()
{
    scanf("%lld%lld", &n, &m);
    cout << n - m + 1;
}
/*
*/


Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
#define se second
#define fr first
#define int long long int
#define pb push_back
#define inf 1e18
#define all(v) v.begin(),v.end()
#define CHAL_BAAP_KO_MT_SIKHA ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
/*
    Damn Fast:TheFuckinMastermind
    while(How to solve the Question?){
                Read the Question Again!!
           }
        do
            Practise
    #Motivation::::0/0  
*/
const int N=4e3;
int dp[N+1][N+1];
int n,a[N+1];
int solve(int i,int j){
    if(i>n or j<=0){
        return 0;
    }
    if(j<i)
        return 0;
    if(dp[i][j]!=-1)
        return dp[i][j];
    int ans1=a[i]+min(solve(i+2,j),solve(i+1,j-1));
    int ans2=a[j]+min(solve(i+1,j-1),solve(i,j-2));
    return dp[i][j]=max(ans1,ans2);
}
signed main()
{
   
    CHAL_BAAP_KO_MT_SIKHA
    cin>>n; 
    int sum=0;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    memset(dp,-1,sizeof(dp));
    int x=solve(1,n);
    int y=sum-x;
    cout<<x-y<<endl;
}

Measured memory_bytes: 125440
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[]) {
  vector<string> wth{"Sunny", "Cloudy", "Rainy"};
  string s;
  cin >> s;

  int i = find(wth.begin(), wth.end(), s) - wth.begin();
  cout << wth[(i + 1) % 3] << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
int H[100100];
int a[100100];
int main(){
	cin >> N;
	for(int i=0;i<N;i++)cin >> H[i];
	a[0]=1;
	for(int i=1;i<N;i++){
		if(H[i-1]-a[i-1]==H[i]){
			a[i]=0;
		}else if(H[i-1]-a[i-1]>H[i]){
			cout << "No" << endl;
			return 0;
		}else{
			a[i]=1;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 1024
K = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
ans = K.split(", ")
num = int(input())
print(ans[num-1])


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll long long
#define pr pair <ll,ll> 
#define ff first
#define ss second
#define MP make_pair
#define PB push_back
#define pri 1000000007
#define mn 25
#define sz noofnodes +2
#define all(x) x.begin(),x.end()
using namespace std;
void solve(ll &ga,ll &sa,ll &ba,ll &n,ll &gb,ll &sb,ll &bb){
	ll x=0;
	if(ga<gb)x++;
	if(sa<sb)x++;
	if(ba<bb)x++;
	if(x==1){
		if(sa<sb){swap(sa,ga);swap(sb,gb);}
		else if(ba<bb){swap(ba,ga);swap(bb,gb);}
		
		ll gc=n/ga;
	    n=n%ga;
	    n+=gc*gb;
		
	}
	if(x==2){
		if(ba<bb){
			if(sa>sb){swap(sa,ba);swap(sb,bb);}
			else {swap(ga,ba);swap(gb,bb);}
		}
		
		ll gcm=n/ga,sc=0;
		ll maxgrain=n;
		
		for(ll i=0;i<=gcm;i++){
		    ll nleft=n-i*ga;
		    sc=nleft/sa;
		    maxgrain=max(maxgrain,(gb*i+sb*sc+nleft%sa));
		}
		n=maxgrain;
		
	}
	if(x==3){
		
		ll gcm=n/ga;
		ll maxgrain=n;
		for(ll i=0;i<=gcm;i++){
		     ll nleft=n-i*ga;
		     ll scm=nleft/sa;
		    for(ll j=0;j<=scm;j++){
		      ll naleft=nleft-j*sa;	
		      ll bc=naleft/ba;
		     maxgrain=max(maxgrain,(gb*i+sb*j+bc*bb+naleft%ba));}
		}
		n=maxgrain;
		
		
	}
	
	
	
	
}
void masterstroke()
{   

	ll n;
	cin>>n;
	ll ga,sa,ba;
	ll gb,sb,bb;
	cin>>ga>>sa>>ba;
	cin>>gb>>sb>>bb;
    solve(ga,sa,ba,n,gb,sb,bb);
    solve(gb,sb,bb,n,ga,sa,ba);
    cout<<n<<endl;
	
	
	
}

int main(){

	ll t=1;
	//cin>>t;
	for(ll i=0;i<t;i++)
	masterstroke();

}


Measured memory_bytes: 256
#include <iostream>
using namespace std;

int main(int argc, const char * argv[]) {
    
    int len, num[100],i;
    int min, max, ans;
    
    cin >> len;
    cin >> num[0];
    min = num[0];
    max = num[0];
    for(i = 1; i < len; i++) {
        cin >> num[i];
        if(num[i] < min) {
            min = num[i];
        }
        if(num[i] > max) {
            max = num[i];
        }
    }
    
    ans = max - min;
    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

int cell[31];

int main() {
    int w, n, a, b;

    for (int i = 1; i <= 30; i++) {
        cell[i] = i;
    }

    cin >> w >> n;

    while (n--) {
        int a, b;
        scanf("%d,%d", &a, &b);
        swap(cell[a], cell[b]);
    }

    for (int i = 1; i <= w; i++) {
        cout << cell[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 1240
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
class UnionFind {
private:
  int siz;
  vector<int> a;

public:
  UnionFind(int x) : a(x, -1), siz(x) {}

  int root(int x) {
    return a[x] < 0 ? x : a[x] = root(a[x]);
  }

  bool unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    siz--;
    if (a[x] > a[y]) swap(x, y);
    a[x] += a[y];
    a[y] =x;
    return true;
  }

  bool same(int x, int y) {
    return root(x) == root(y);
  }

  int size(int x) {
    return -a[root(x)];
  }
  
  int conneted_component() {
  	return siz;
  }
};
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //b
  int n;
  cin >> n;
  vector<pair<int, int>> in(n);
  for (int i = 0; i < n; i++) {
    cin >> in[i].first >> in[i].second;
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int ans = 1 << 30;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      int p = in[i].first - in[j].first;
      int q = in[i].second - in[j].second;
      UnionFind uf(n);
      for (int k = 0; k < n; k++) {
        for (int l = 0; l < n; l++) {
          if (in[k].first - in[l].first == p && in[k].second - in[l].second == q) {
            uf.unite(k, l);
          }
        }
      }
      int cnt = 0;
      vector<int> done(n);
      for (int k = 0; k < n; k++) { 
        if (done[uf.root(k)]) continue;
        done[uf.root(k)] = 1;
        cnt++;
      }

      ans = min(ans, cnt);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int a, b, h = 0, s = 0, m = 0;
	cin >> a >> b;
	if (a > b) {
		printf("a > b\n");
	}
	else if (a < b) {
		printf("a < b\n");
	}
	else {
		printf("a == b\n");
	}
}

Measured memory_bytes: 3052
/*
 * Created by KeigoOgawa
 */


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <cmath>

#define INF (int)1e8
#define EPS 1e-10
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--)
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define MIN(a, b) (a > b ? b : a)
#define MAX(a, b) (a > b ? a : b)
#define debug(x) cerr << #x << ": " << x << endl
#define all(a) (a).begin(), (a).end()

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> PII;

// vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len - 1) s << "\t";
    }
    return s;
}

// 2 dimentional vector
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
    int len = vv.size();
    for (int i = 0; i < len; ++i) {
        s << vv[i] << endl;
    }
    return s;
}

const int MAX_N = (int)2*1e5;
int N;
ll A[MAX_N], Asum[MAX_N + 1];


int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N;
    REP(i, N) {
        int t;
        cin >> t;
        A[i] = t;
    }

    ll sum = 0;
    map<ll, ll> count;
    count[0]++;
    REP(i, N) {
        sum += A[i];
        Asum[i+1] = sum;
        count[sum]++;
    }

    ll ans = 0;
    for (auto i : count) {
        ans += i.second * (i.second - 1) / 2;
    }


    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 15872
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dofloat cout<<fixed<<setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(),vec.end()
#define rall(vec) vec.rbegin(),vec.rend()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vll;
typedef vector<pair<int,int> > vii;
typedef vector<int> vi;
typedef pair<int,int> ii;
const long long MOD=1000000007;
const long long MAX=100005;
const long double PI=3.14159265359;
const long double G=9.807;
const long long INF=1e18;
const long double EPS=1e-6;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
bool isprime(ll a){
  if(a==2)return 1;
  if(!(a&1))return 0;
  for(ll i=3;i*i<=a;i+=2)
    if(a%i==0)return 0;
  return 1;
}
ll mpow(ll base,ll exponent,ll modulus){
  if(modulus==1)return 0;
  long long result = 1;
  base=base%modulus;
  while(exponent){
    if(exponent%2 == 1)
	  result=(result*base)%modulus;
	  exponent=exponent>>1;
	  base=(base*base)%modulus;
  }
  return result;
}
ll minv(ll a,ll mod){
  ll _gcd=gcd(a,mod);
  assert(_gcd==1);
  return mpow(a,mod-2,mod);
}


/*
ll ncr(ll N,ll K){
	if(N<K)return 0;
	if(K==0)return 1;
	if(N==0)return 0;

	ll den=1;
	for(ll i=1;i<=K;i++)den*=i;
	ll num=1;
	while(K--){
		num*=N;
		if(num%den==0){
			num/=den;
			den=1;
		}
		N--;
	}

	return num;
}
*/
ll n;
vl a;
int main(){FAST;
cin>>n;
for(ll i=1;i<=n;i++){
	ll x;cin>>x;
	a.pb(x);
}
sort(all(a));
ll X = a.back();
ll T1 = X/2;
ll T2 = (X+1)/2;
ll dif1=INF,dif2=INF;
auto it1 = upper_bound(all(a),T1);
auto it2 = lower_bound(all(a),T2);
if(it1 != a.begin()){
	it1--;
	dif1 = T1-*it1;
}
dif2 = *it2-T2;
if(dif2<dif1 and *it2<X){
	cout<<X<<' '<<*it2;
}
else{
	cout<<X<<' '<<*it1;
}
return 0;
}

Measured memory_bytes: 1400
import java.util.HashMap;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        if (A>=1800) {
            System.out.println(1);
        } else if (A>=1600)
            System.out.println(2);
        else if (A>=1400)
            System.out.println(3);
        else if (A>=1200)
            System.out.println(4);
        else if (A>=1000)
            System.out.println(5);
        else if (A>=800)
            System.out.println(6);
        else if (A>=600)
            System.out.println(7);
        else if (A>=400)
            System.out.println(8);
    }

}


Measured memory_bytes: 27060
k, n  = [int(x) for x in input().split()]
a_i  = [int(x) for x in input().split()]
diff_a_i = [a_i[i] - a_i[i-1] for i in range(n)]
diff_a_i[0] += k
diff_a_i.pop(diff_a_i.index(max(diff_a_i)))
print(sum(diff_a_i))

Measured memory_bytes: 26420
#include <iostream>
using namespace std;

int isHammingNumber(int n){
	int p=n;
	while(p%2 == 0)p/=2;
	while(p%3 == 0)p/=3;
	while(p%5 == 0)p/=5;
	return p==1;
}

int main() {
	
	int m,n;
	int count;
	
	while(count=0,cin>>m>>n,m){
		for(int i=m;i<=n;++i)if(isHammingNumber(i))++count;
		cout << count << endl;
	}
	return 0;	
}

Measured memory_bytes: 1160
n,*t=map(int,open(0).read().split())
c=sorted(t[-n:])
print(sum(c[:-1]))
e={i:[]for i in range(n)}
for a,b in zip(t[:-n:2],t[1:-n:2]):e[a-1]+=b-1,;e[b-1]+=a-1,
f=[0]*n
q=[0]
while q:
 v=q.pop();f[v]=c.pop()
 for w in e[v]:q+=[w]*(f[w]<1)
print(*f)

Measured memory_bytes: 50068
using System;

namespace ConsoleApplication36
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string s = Console.ReadLine();
                string[] ss = s.Split(' ');
                int H = int.Parse(ss[0]);
                int W = int.Parse(ss[1]);
                int j;
                int x;
                if (H == 0 && W == 0)
                {
                    break;
                }
                else
                {
                    for (x = 0; x < H; x++)
                    {
                        if(x == 0)
                        {
                            for (j = 0; j < W; j++)
                            {
                                Console.Write("#");
                            }

                        }
                        else if(x > 0 && H - 1 >x)
                        {
                            Console.Write("#");
                            for (j = 2; j < W; j++)
                            {
                                Console.Write(".");
                            }
                            Console.Write("#");
                        }else if(x == H - 1)
                        {
                             for (j = 0; j < W; j++)
                            {
                                Console.Write("#");
                            }
                        }
                        Console.WriteLine("");
                    }
                    Console.WriteLine("");
                }
            }
        }
    }
}

Measured memory_bytes: 8756
#include<bits/stdc++.h>
using namespace std;

int main(){
  long long n;
  cin>>n;
  long long a[n];
  for(int i=0;i<n;i++){
      cin>>a[i];
  }
  sort(a,a+n);
  long long b=0,c=0;
  int i=n-2;
  while(i>=0&&(b==0||c==0)){
      
      if(a[i]==a[i+1]){
        
        
        if(b==0) b=a[i];
        else c=a[i];
        
        i-=2;
      }
      else i--;
  }
  cout<<b*c<<endl;
  
}

Measured memory_bytes: 1024
#include <stdlib.h>
#include <stdio.h>

int main()
{
    int i,H,N;
    int sum=0;
    int *pntr;
    scanf("%d %d",&H, &N);
    pntr = (int*)malloc(N*sizeof(int));
    for(i=0; i<N ;i++)
    {
        scanf("%d",&pntr[i]);
        sum += pntr[i];
    }
    if(sum >= H)
    {
        printf("Yes");    
    }
    else
    {
        printf("No");
    }
    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int min = Integer.MAX_VALUE;
        int max = 0;
        for(int i = 0; i < N; i++){
            int a = sc.nextInt();
            if(a < min) min = a;
            if(a > max) max = a;
        }
        System.out.println(max - min);
        sc.close();

    }

}


Measured memory_bytes: 22996
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		char[] c1 = scanner.nextLine().toCharArray();
		char[] c2 = scanner.nextLine().toCharArray();
		boolean answer = true;

		for(int i = 0; i < 3; i++){
			if(c1[i] != c2[2-i]){
				answer = false;
				break;
			}
		}

		if(answer == true){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
		
	}
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int m){if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

void solve(long long H, long long W){
    if(H==1 || W==1){
        cout<<1<<endl;
        return;
    }
    if(W%2==0){
        cout<<H*W/2<<endl;
    }else{
        if(H%2==0){
            cout<<H*W/2<<endl;
        }else{
            cout<<(H*W+1)/2<<endl;
        }
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    solve(H, W);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long

typedef pair<int, int> P;
const int N = 2e5;
const int INF = 1e9;

struct edge{ int to,cost; };
vector< edge > G[N];
int n;

void dikstra(int s){
  priority_queue<P,vector<P>,greater<P>> que;
  int d[N]; //sからの最短距離
  fill(d,d+N,INF);
  d[s] = 0;
  que.push({0,s}); //{頂点,最短距離}

  while( !que.empty() ){
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    for(int i = 0; i < G[v].size(); i++){
      edge e = G[v][i];
      if(d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        que.push( {d[e.to],e.to} );
      }
    }
  }

  for(int i = 0; i < n; i++){
    cout << i << " " << d[i] << endl;
  }
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n;
  for(int i = 0; i < n; i++){
    int u,k; cin >> u >> k;
    for(int j = 0; j < k; j++){
      int v,c; cin >> v >> c;
      G[u].push_back({v,c});
    }
  }
  dikstra(0);

  return 0;
}



Measured memory_bytes: 18204
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;

const int INF = 1001001001;
const int MOD = 1000000007;


vector<int> dijk(int s, int v, vector<vector<pair<int, int> > > adjlist){
    
    priority_queue <pair<int, int> > wait;
    vector<int> result(v, INF);

    //スタート地点を追加
    result[s] = 0;
    wait.push(make_pair(0, s));

    //ダイクストラ本体
    while(!wait.empty()){    //waitが空になるまで

        int nowpoint = wait.top().second;
        int nowcost = -wait.top().first;
        wait.pop();

        if(result[nowpoint] < nowcost) continue;

        //今いる頂点と隣接しているすべての頂点をなめる
        for(int i = 0; i < adjlist[nowpoint].size(); i++){

            int nextpoint = adjlist[nowpoint][i].second;
            int nextcost = nowcost + adjlist[nowpoint][i].first;
            //現時点より安く到達できそうであれば、結果を更新して優先度付きキューに格納
            if(result[nextpoint] > nextcost){
                result[nextpoint] = nextcost;
                wait.push(make_pair(-nextcost, nextpoint));
            }
        }
    }
    
    return result;         //結果列を返す
}

signed main(){
    
    int n; cin >> n;
    vector<vector<int> > c(n, vector<int> (n));
    for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> c[i][j];
    map<vector<int>, int> m;
    int cnt = 0;
    vector<int> v(n);
    for(int i = 0; i < n; i++){
        v[i] = i;
    }

    do{
        m[v] = cnt;
        cnt++;
    }while(next_permutation(v.begin(), v.end()));
    

    vector<vector<pair<int, int> > > G(cnt);
    sort(v.begin(), v.end());


    do{
        int cur = m[v];
        for(int i = 0; i < n; i++){
            for(int j = i; j < n; j++){
                swap(v[i], v[j]);
                int cost = c[v[i]][v[j]];
                int nxt = m[v];
                G[cur].push_back({cost, nxt});
                G[nxt].push_back({cost, cur});
                swap(v[i], v[j]);
            }
        }

    }while(next_permutation(v.begin(), v.end()));

    vector<int> result = dijk(0, cnt, G);
    int ans = 0;
    for(int i = 0; i < cnt; i++){
        ans = max(ans, result[i]);
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 75316
input_list = []
while True:
    pair = list(map(int, input().split(' ')))
    if pair[0] == 0 and pair[1] == 0:
        break
    input_list.append(pair)

for pair in input_list:
    h = pair[0]
    w = pair[1]
    for y in range(h):
        for x in range(w):
            print('#', end='')
        print('')
    print()



Measured memory_bytes: 7016
using System;
class ITP1_7_B
{
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        int r = int.Parse(input[0]);
        int c = int.Parse(input[1]);
        int[,] f=new int[r+1,c+1];
        for(int y=0;y<r;y++){
            int csam=0;
            string[] readl=Console.ReadLine().Split(' ');
            for(int x=0;x<c;x++){
                f[y,x]=int.Parse(readl[x]);
                csam+=f[y,x];
            }
            f[y,c]=csam;
        }
        for(int x=0;x<=c;x++){
            int rsum=0;
            for (int y = 0; y < r; y++)rsum+= f[y, x];
            f[r,x]=rsum;
        }
        for (int y = 0; y <= r;y++ )
        {
            for (int x = 0; x < c; x++)
            {
                Console.Write(f[y, x]);
                Console.Write(' ');
            }
            Console.WriteLine(f[y, c]);
        }
    }
}

Measured memory_bytes: 5852
//------------------------------------------
// C++ templete 
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

//REPEAT
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//grobal variable
//------------------------------------------
int N,M;
VI Vec;

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int N;cin >> N;
    vector<long long> A(N);
    int r=0;
    REP(i, N)
    {
        int a;
        cin >> a;
        if (a<0){
            r++;
            a*=-1;
        }
        A.at(i) = a;
    }
    SORT(A);
    if (r % 2 == 1)
    {
        A.at(0) *= -1;
    }
    
    long long ans=0;
    REP(i, N) {
    ans += A.at(i);
//    dump(ans);
    }
    cout << ans << endl;

  
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int A[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
};
    int n;
    cin >> n;
    cout << A[n-1] << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,m,k;
    while(cin>>n>>m>>k,n){
        vector<vector<long long int>> dp(n+1,vector<long long int>(m*n+1,0));
        dp[0][0]=1;
        long long int sum=1;
        for(int i=1;i<=n;i++){
            sum*=m;
            for(int j=0;j<=m*n;j++){
                for(int s=1;s<=m;s++){
                    if(j-s>=0) dp[i][j]+=dp[i-1][j-s];
                }
            }
        }

        double res=0.0;
        for(int i=1;i<=n*m;i++){
            res+=double(i<=k ? 1 : i-k)*double(dp[n][i])/double(sum);
        }
        cout<<setprecision(10)<<fixed;
        cout<<res<<endl;
    }


}

Measured memory_bytes: 3396
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const double PI = acos(-1);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////
 
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];

    sort(all(A));
    reverse(all(A));
    int ans = 0;
    rep(i,N) {
        if (i % 2 == 0) ans += A[i];
        else ans -= A[i]; 
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <cassert>

std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());

template<const int N = 60, class T = long long>
class XorGauss {
public:
	XorGauss() {
		for(int i = 0; i < N; i++) { a[i] = 0; }
	}
	T reduce(T x) {
		for(int i = N-1; i >= 0; i--) {
			x = std::min(x, x ^ a[i]);
		}
		return x;
	}

	T augment(T x) { return ~reduce(~x); }

	bool add(T x) {
		for(int i = N-1; i >= 0; i--) {
			if((x & (((T)1) << i)) == 0) { continue; }
			if(a[i]) {
				x ^= a[i];
			} else {
				a[i] = x;
				return true;
			}
		}
		return false;
	}
private:
	T a[N];
};

void solve() {
	int n;
	std::cin >> n;
	std::vector<long long> a(n);
	std::string str;
	for(int i = 0; i < n; i++) {
		std::cin >> a[i];
	}
	std::cin >> str;
	XorGauss<> gauss;
	for(int i = n-1; i >= 0; i--) {
		if(gauss.add(a[i]) && str[i] == '1') {
			std::cout << "1\n";
			return;
		}
	}
	std::cout << "0\n";
}

int main() {
	std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);
	int t;
	std::cin >> t;
	while(t--) {
		solve();
	}
}

Measured memory_bytes: 3624
// Problem : A - Air Conditioner
// Contest : AtCoder - AtCoder Beginner Contest 174
// URL : https://atcoder.jp/contests/abc174/tasks/abc174_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long
#define db double
#define mod 1000000007
#define pb push_back
#define pp pair<int,int>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define maxn 200005
#define ss second
#define ff first
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
int inv(int a, int b){
 return 1<a ? b - inv(b%a,a)*b/a : 1;
}
void solve()
{
	int n;
	cin >> n;
	if(n >= 30)
	{
		cout << "Yes" <<"\n";
	}	
	else cout <<"No" <<"\n";
}
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3648
def get_buy(i, N):
    ans = [0]*(N)
    for ind in range(N):
        if i % 2 == 1:
            ans[ind] = 1
        i //= 2
    return ans

N ,M, X = map(int, input().split())
CA = list()
for i in range(N):
    CA.append(list(map(int, input().split())))

ans = -1
for i in range(2**N):
    buy = get_buy(i, N)

    algorithm = [0]*M
    for j in range(N):
        if buy[j] == 1:
            for k in range(M):
                algorithm[k] += CA[j][k+1]
    
    ok = 1
    for j in range(M):
        if algorithm[j] < X:
            ok = 0

    # cost = 0
    # for j in range(N):
    #     if buy[j] == 1:        
    #         cost += CA[j][0]
    # print(buy, cost)
    # if cost == 1067:
    #     print("here")

    if ok == 1:
        cost = 0
        for j in range(N):
            if buy[j] == 1:        
                cost += CA[j][0]
        # print(buy, cost)
        if ans != -1:
            ans = min(ans, cost)
        else:
            ans = cost

print(ans)


Measured memory_bytes: 9256
N, K = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = -float('inf')
for i in range(N):
    done = set()
    S = []

    done.add(i)
    S.append(C[i])
    i = P[i] - 1
    while i not in done:
        done.add(i)
        S.append(S[-1] + C[i])
        i = P[i] - 1
    if K <= len(S):
        score = max(S[:K])
    elif S[-1] <= 0:
        score = max(S)
    else:
        score1 = S[-1] * (K // len(S) - 1)
        score1 += max(S)
        score2 = S[-1] * (K // len(S))
        r = K % len(S)
        if r != 0:
            score2 += max(0, max(S[:r]))
        score = max(score1, score2)
    ans = max(ans, score)
print(ans)


Measured memory_bytes: 144168
h,w=map(int,input().split())
n=int(input())
A=list(map(int,input().split()))

out=[]
for i,a in enumerate(A):
  for _ in range(a):
    out.append(i+1)
ans,cnt=[],0
for i in range(h):
  if i%2==0:
    ans.append([out[cnt+j] for j in range(w)])
  else:
    ans.append([out[cnt+w-1-j] for j in range(w)])
  cnt+=w
for a in ans:
  print(*a)

Measured memory_bytes: 3956
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int c0 = 0;
        int c1 = 0;
        for(char c : s){
            if(c == '0'){
                c0++;
            }else{
                c1++;
            }
        }
        System.out.println(2*Math.min(c0,c1));
    }
}


Measured memory_bytes: 28120
#include <bits/stdc++.h>
#define INF 1e9
#define endl '\n'
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define FORE(i, a, b) for (int i = (a), e = (b); i < e; ++i)
#define RFORE(i, a, b) for (int i = (b)-1, e = (a); i >= e; --i)
#define ALL(x) (x).begin(), (x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTR(c) sort((c).begin(), (c).end(), greater<int>())
using namespace std;
typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    ll ans = 1;
    ll mod = 1e9 + 7;
    FOR(i, 1, N + 1) {
        ans *= i;
        ans = ans % mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; 

int     main()
{
    ll N, A, B; cin>>N>>A>>B;
    if (A == 0)
    {   
        cout << 0 << endl;
        return 0;
    }   
    ll ans = A * (N / (A + B));
    ll hoge = A >= (N % (A + B)) ? (N % (A + B)) : A;
    cout << (ans + hoge) << endl;           
}

Measured memory_bytes: 256
N,M = [int(x) for x in input().split()]
P = dict([(i,True) for i in range(1,N+1)])
H = [0] + [int(x) for x in input().split()]
for m in range(M):
    A,B = [int(x) for x in input().split()]
    if H[A] >= H[B]:
        P[B] = False
    if H[B] >= H[A]:
        P[A] = False

print(sum(list(P.values())))

Measured memory_bytes: 100492
while True:
    H, W = map(int, input().split())
    if H + W == 0:
        break
    for i in range(H):
        for j in range(W):
            if (i + j) % 2 == 0:
                print("#", end="")
            else:
                print(".", end="")
        print()
    print()


Measured memory_bytes: 7000
/*																													   
 Templatka c++ Kacper Fis																							   																											   //
*/																													  
																								   
#include <bits/stdc++.h>																							   
																													   
using namespace std; 																								   
																													   
const int INF = 1000000001;																						   
const float PI = 3.14;																								   
typedef long long LL;																								   
																													   
typedef vector<int> vi;																								   
typedef list<int> li;																								   
typedef queue<int> qi; 																								   
typedef pair<int,int> ii; 																							   
typedef map<string,int> msi; //np msi['nazwa'] = 'liczba'															   
typedef vector<ii> vii; //vector par<int>, do tworzenia tablicy dla grafów wagowych #dijkstra #Bellman_Ford			   
typedef priority_queue< ii, vector<ii>, greater<ii> > pq; //kolejka priorytetowa vectorów par(top()=min) #dijkstra	   
																													   																				   
vector<ii>::iterator iter;																							   
																													   																				   
#define print_list(x) for(it = (x).begin(); it != (x).end(); it++) {cout << *it << " ";}							   
#define print_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++) {cout << *it2 << " ";}						   
#define search_list(x) for(it = (x).begin(); it != (x).end(); it++)													   
#define search_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++);											   
#define pb(x) push_back(x) 																							   
#define pf(x) push_front(x)																							   
#define mp(x, y) make_pair(x, y)                                                                                       
///////////////////////////////////////////////GLOBAL DEFINITIONS////////////////////////////////////////////////////////


///////////////////////////////////////////////////FUNCTIONS/////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////MAIN////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])																					 
{ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);                  												       
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
	int a;scanf("%d",&a);
	int L=a/100;
	int R=a%100;
	if(1<=L&&L<=12){
	if(1<=R&&R<=12)printf("AMBIGUOUS\n");
	else printf("MMYY\n");
	}else{
	if(1<=R&&R<=12)printf("YYMM\n");
	else printf("NA\n");
	}
	   
   
   
	
	
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_M = (int)(2e5 + 5);

int m;

ll d[MAX_M];
ll c[MAX_M];

int main(void) {
  // Here your code !
  scanf("%d", &m);

  for (int i = 0; i < m; ++i) {
    scanf("%lld %lld", &(d[i]), &(c[i]));
  }

  ll whole = 0LL;
  for (int i = 0; i < m; ++i) {
    whole += d[i] * c[i];
  }

  ll digit = 0LL;
  for (int i = 0; i < m; ++i) {
    digit += c[i];
  }

  ll ans = (digit - 1LL) + (whole - 1LL) / 9LL;

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define forn(i, n)             for(int i = 0; i < n; i ++)
#define forn1(i, n)            for(int i = 1; i <= n; i ++)
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define ii  pair<long long int, long long int>
#define vi  vector <long long int>
#define vii vector <pair <long long int, long long int > >
#define all(cont)  cont.begin(), cont.end()
#define EPS 1e-9
#define MOD 1000000007
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define range 200010
#pragma GCC optimize ("Ofast")
#define endl '\n'
int A[21],B[21],C[20];
signed main(){

	//freopen("test.txt","r",stdin);
	ios :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
	string s;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>A[i];
	for(int i=1;i<=n;i++)cin>>B[i];
	for(int i=1;i<n;i++)cin>>C[i];
	int ans = 0;
	for(int i=1;i<=n;i++){
		ans+=B[A[i]];
		if(i>1&&A[i]-A[i-1]==1)ans+=C[A[i-1]];
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
function main(input) {
    input = input.split(" ");
    var a = parseInt(input[0]);
    var b = parseInt(input[1]);
    var cnt = 0;
    var t = 1;
    while (t < b) {
        t += a-1;
        cnt += 1;
    }
    console.log(cnt);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 11468
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
  static void Main()
  {
    int N = int.Parse(Console.ReadLine());
    string[] A = ("0 " + Console.ReadLine()).Split(' ');  // 1-indexed に
    var result = new List<int>();
    int[] boxin = new int[N + 1];
    
    for (int i = N; i >= 1; i--)
    {
      int a = int.Parse(A[i]);
      int c = 0;
      int i_multiple = i * 2;
      
      // iの倍数の箱にすでに入っている球の数 =: c
      while(i_multiple <= N)
      {
        if (boxin[i_multiple] == 1)
          c++;
        i_multiple += i;
      }
      
      // a と c の偶奇が一致して居ない場合、i の箱に球を入れる
      if ((a + c) % 2 == 1)
      {
        result.Add(i);
        boxin[i] = 1;
      }
    }
    
    Console.WriteLine(result.Count);
    Console.WriteLine(string.Join(" ", result));
    
  }
}

Measured memory_bytes: 32344
#include <bits/stdc++.h>
#define LL long long
#define PI pair<int,int>
#define PL pair<LL,LL>
#define st first
#define nd second
#define all(x) x.begin(),x.end()

using namespace std;

const int MX = 2e5 + 5;

map<string,string> lkp;



string s;
int main(){

    lkp["Sunny"] = "Cloudy";
    lkp["Cloudy"] = "Rainy";
    lkp["Rainy"] = "Sunny";
    
    cin >> s;
    cout << lkp[s] << endl;
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i, n) cin >> a[i];

    ll money = 1000;
    rep(i, n - 1) {
        if (a[i] < a[i + 1]) {
            money += money / a[i] * (a[i + 1] - a[i]);
        }
    }

    cout << money << endl;
    return 0;
}


Measured memory_bytes: 3528
#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, d; scanf("%d %d", &n, &d);
  int ans = 0;
  for(int i = 0; i < n; ++i) {
    int x, y; scanf("%d %d", &x, &y);
    ans += x * 1LL * x + y * 1LL * y <= d * 1LL * d;
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 3804
from collections import Counter, defaultdict
import sys

sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools

import queue
from collections import deque



def main():
    k = int(input())
    a, b = map(int, input().split())

    if b // k - (a - 1) // k >= 1:
        print("OK")
    else:
        print("NG")





if __name__ == '__main__':
    main()


Measured memory_bytes: 74792
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    string s;
    cin >> s;
long int first = 10000000;
long int last = -100;
    for(int i=0; i<s.size(); i++){
        if(s[i] == 'A' && first > i){
            first = i;
        }
        if(s[i] == 'Z' && last < i){
            last = i;
        }
    }

    cout << last - first + 1;
 return 0;
}

Measured memory_bytes: 644
#include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
    int n; cin >> n;
    int l, lsum=0, lmax=0;
    for(;n>0;--n) {
        cin >> l;
        lsum += l;
        lmax = max(l,lmax);
    }
    lsum -= lmax;
    //cout << lsum << " " << lmax << endl;
    cout << ((lmax < lsum)? ("Yes"): ("No")) << endl;
    return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int Max = 1000000;
int power(int a){
	if(a==0) return 1;
	else return power(a-1)*2;
}
int main(){
  	int N;
    cin >> N;
    int A[N], B[N];
    for(int i=0;i<N;i++) cin >> A[i];

    for(int i=0;i<N;i++) B[i]=A[i];

    sort(A, A+N);
    if(A[N-1]==A[N-2]){
      for(int i=0;i<N;i++) cout << A[N-1] <<endl;
    }else{
      for(int i=0;i<N;i++){
        if(B[i]==A[N-1]) cout << A[N-2] <<endl;
        else cout << A[N-1] <<endl;
      }
    }


    
  	return 0;
}

Measured memory_bytes: 3200