akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)

#define mt              make_tuple
#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////


//long long  Prime[3000000],nPrime;
//long long  mark[10000002];
//
//void seive(long long int n)
//{
//	long long int i,j,limit=sqrt(n*1.0)+2;
//	mark[1]=1;
//	for(i=4; i<=n ;i+=2)
//	mark[i]=1;
//	Prime[nPrime++]=2;
//	for(i=3; i<=n; i+=2)
//	{
//		if(!mark[i])
//		{
//			Prime[nPrime++]=i;
//			if(i<=limit)
//			{
//				for(j=i*i; j<=n ;j+=i*2)
//				{
//					mark[j]=1;
//				}
//			}
//		}
//	}
//}

int main()
{
    FASTIO;

    ll n;

    char s[] = {'a' , 'b' , 'c' , 'd' ,'e' ,'f' ,'g' ,'h' ,'i' , 'j' , 'k' ,'l' , 'm' , 'n' , 'o' , 'p' , 'q' ,'r' ,'s' ,'t' , 'u' ,'v' ,'w' ,'x' ,'y' ,'z'};

    cin >> n;

    string ans="";



    while(n>0)
    {
        n -= 1;

        ans += ('a'+(n%26));

        n /= 26;
    }

    reverse(ans.begin(),ans.end());


    cout << ans << endl;







    return 0;
}



Measured memory_bytes: 3652
N, M = map(int, input().split())
S = list(map(int, reversed(input())))
now = 0
ans = []
while now + M < N:
    last = now
    now += M
    while S[now]:
        now -= 1
    if last == now:
        print(-1)
        break
    ans.append(now - last)
else:
    print(*reversed(ans + [N - now]))

Measured memory_bytes: 7056
n = int(input())
p= list(map(int, input().split()))
ans = 0
for i in range(n - 2):
	if p[i] < p[i + 1] <= p[i + 2]:
		ans += 1
	elif p[i] >= p[i + 1] > p[i + 2]:
		ans += 1
print(ans)

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

int main(){
  string s,t,u;
  int a,b;
  cin>>s>>t>>a>>b>>u;
  if(s==u)cout <<a-1<<" "<<b<<endl;
  else cout <<a<<" "<<b-1 << endl;
  
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#define max(x,y) x > y? x: y
using namespace std;

const int maxn = 1011111;
int father[maxn];
int gradfa[maxn];

int find(int x)
{
    if(father[x] == x)
        return x;

    int r = find(father[x]);
    gradfa[x] = gradfa[father[x]] + gradfa[x];

    return father[x] = r;
}

int fix(int x,int y,int z)
{
    int fx = find(x);
    int fy = find(y);
    if(fx ==  fy)
        return z == gradfa[y] - gradfa[x];
    father[fy] = fx;
    gradfa[fy] = gradfa[x] + z - gradfa[y];
    return 1;
}

int main()
{
    int n, m;
    int lose = 1;
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
        father[i] = i;
    for(int i = 1; i <= m; i++)
    {
        int x, y, z;
        cin >> x >> y >> z;

        if(lose)
            lose = fix(x, y, z);
    }

    if(lose)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


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


int main(){
	int x,y;
	cin >> x >> y;
	x *= 10;
	y *= 10;
	int ans = (x+y)/2;
	if(ans % 10 > 0){
		cout << ans/10+1 << endl;
	}else{
		cout << ans/10 << endl;
	}
	return 0;
}


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

int main()
{
  string s;
  cin >> s ;

  bool ans = false;

  if(s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(0) != s.at(2)) ans = true;
  if(s.at(0) == s.at(2) && s.at(1) == s.at(3) && s.at(0) != s.at(1)) ans = true;
  if(s.at(0) == s.at(3) && s.at(1) == s.at(2) && s.at(0) != s.at(1)) ans = true;
  if(ans) puts("Yes");
  else puts("No");
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    vector<int> v(3);
    v[0] = a + b;
    v[1] = a - b;
    v[2] = a * b;
    int ans = *max_element(v.begin(), v.end());

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC138A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            String s;
            a = int.Parse(Console.ReadLine());
            s = Console.ReadLine();
            if (a >= 3200) { }
            else { s = "red"; }
            Console.WriteLine(s);
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;

const ll mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

int main() {
  int N, M;
  int left = 0, right = 1000000;
  cin >> N >> M;
  vector<int> L(M), R(M);
  for(int i = 0; i < M; i++) {
    cin >> L[i] >> R[i];
    left = max(left, L[i]);
    right = min(right, R[i]);
  }
  // //cerr << left << " " << right << endl;
  cout << max(right - left + 1, 0) << endl;
  return 0;
}


Measured memory_bytes: 1024
//2020年4月17日現在

#include<stdio.h>
#include<cmath>
#include<math.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<complex>
#include<queue>
#include<set>
#include<utility>
#include<iomanip>
#include<limits>
#include<thread>
#include<map>
#include<stack>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<tuple>
#include <cstdio>

using namespace std;


template <class... A>
void prints() { cout << "\n"; }
template <class... A>
void prints_rest() { cout << "\n"; }
template <class T, class... A>
void prints_rest(const T &first, const A &... rest) { cout << " " << first; prints_rest(rest...); }
template <class T, class... A>
void prints(const T &first, const A &... rest) { cout << first; prints_rest(rest...); }
template <class T, class... A>
void printd(const T &first, const A &... rest) { cout << fixed << setprecision(15) << first; prints_rest(rest...); }


namespace {
	// printElems(&a[0], &a[n]);　みたいな感じで使う。
	void printElems(const int* begin, const int* end)
	{
		for (const int* p = begin; p != end; ++p) {
			cout << *p << ' ';
		}
		cout << endl;
	}
}

#define rep(i,n) for(ll i=0; i<n; i++)
#define rep1(i,n) for(ll i=1; i<n+1; i++)
#define repr(i,n) for(ll i=n-1; i>=0; i--)
#define repr1(i,n) for(ll i=n; i>0; i--)
#define FOR(i,j,n) for(ll i=j; i < n; i++)
#define souatari(i,j,n) rep1(i,n-1)rep(j,i)
#define souatari1(i,j,n) for(ll i=2; i<n+1; i++)rep1(j,i-1)
#define mp make_pair
#define F first
#define S second
#define elif else if

typedef long long ll;
typedef vector<int>  vi;
typedef vector<vi>  vvi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef array<ll,3> arr3;
typedef long double D;


const ll llinf =  numeric_limits<ll>::max();
const ll _llinf = numeric_limits<ll>::lowest();
const int inf = numeric_limits<int>::max();
const int _inf = numeric_limits<int>::lowest();
const double dinf = numeric_limits<double>::infinity();
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const ll BIG = 1LL<<60;
const string yes = "Yes";
const string no = "No";

//----------------------------------------------

vi divisor(int n)
{
	vi ret;
	for (int i = 1; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			ret.push_back(i);
			if (i * i != n)
				ret.push_back(n / i);
		}
	}
	sort(begin(ret), end(ret), greater<int>());
	return (ret);
}


int main(){
	int n;
	cin >> n;
	ll ans = 0;
	rep1(i,n-1){
		int tmp = n-i;
		vi v = divisor(tmp);
		ans+=v.size();
	}
	prints(ans);

	return 0;
}




Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
	
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		String op = scan.next();
		int b = scan.nextInt();
		
		if(op.equals("+")){
			System.out.println(a+b);
		}else if(op.equals("-")){
			System.out.println(a-b);
		}else{
			System.out.println("input error");
		}
		
	}

}

Measured memory_bytes: 9684
i,o,t,j,l,s,z=[int(i) for i in input().split()]

ans=o*2+4*(i//2)+4*(l//2)+4*(j//2)
if i*l*j>0:ans=max(ans,o*2+4*((~-i)//2)+4*((~-l)//2)+4*((~-j)//2)+6)

print(ans//2)




Measured memory_bytes: 38384
def main():
    participants = int(input())
    ratings = list(map(int, input().split()))
    color = [0] * 9
    for rating in ratings:
        color[min(rating // 400, 8)] += 1
    answer = 0
    for i in range(8):
        if color[i] > 0:
            answer += 1
    print(max(1, answer), answer + color[-1])


if __name__ == '__main__':
    main()



Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000
 
int main(){
  unsigned short *A, *B;
 
  int C[VMAX+1];
  int n, i, j;
  scanf("%d", &n);
 
  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);
 
  for ( i = 0; i <= VMAX; i++ ) C[i] = 0;
 
  for ( i = 0; i < n; i++ ){
    scanf("%hu", &A[i + 1]);
    C[A[i + 1]]++;
  }
 
  for ( i = 1; i <= VMAX; i++ ) C[i] = C[i] + C[i - 1];
 
  for ( j = 1; j <= n; j++ ){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }
 
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", B[i]);
  }
  printf("\n");
 
  return 0;
}



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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };




void solve() {
    ll N, M, C; cin >> N >> M >> C;
    vector<ll> b(M);
    rep(i, M) cin >> b[i];
    ll cnt = 0;
    rep(i, N){
        ll tmp = 0;
        rep(j, M){
            ll a; cin >> a;
            tmp += a * b[j];
        }
        if(tmp + C > 0) cnt++;
    }

    cout << cnt << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
/*
___ is a raging sadist.
*/

//Destroy all WA at test 2

#include <bits/stdc++.h>
#define fastio()                  \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define pb push_back
#define show(x) cout << (#x) << " : " << x << endl;
#define ll long long
#define ld long double
#define pow power
#define mp make_pair
#define ff first
#define ss second
#define pii pair<ll, ll>
#define sq(x) ((x) * (x))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(a) int((a).size())
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define endl "\n"
#define PI 3.14159265
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll MOD1 = 998244353;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7; 
using namespace std;

ll power(ll x, ll y) 
{ 
   ll res = 1;      
  
   
    while (y > 0) 
    { 
       
        if (y & 1) 
            res = (long long)(res*x); 
  

        y = y>>1; 

        if (x<=100000000)
        x = (long long)(x*x);

        //cout<<x<<'\n'; 
    } 
    return res; 
} 






int main()
{

#ifndef ONLINE_JUDGE    
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif

fastio();

 ll n;
 cin>>n;
 ll x=n+n*n+n*n*n;

 cout<<x;

return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>

int main(void)
{
	int data[101] = {0};
	int temp;
	int max;
	int i;
	
	while (scanf("%d", &temp) != EOF){
		data[temp]++;
	}
	
	max = 0;
	for (i = 0; i < 101; i++){
		if (data[i] > max){
			max = data[i];
		}
	}
	
	for (i = 0; i < 101; i++){
		if (data[i] == max){
			printf("%d\n", i);
			i++;
		}
	}
	
	return (0);
}

Measured memory_bytes: 0
#include <map>
#include <vector> 
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;

vector<char> ans;

int main() {
	long long n;
	cin >> n;
	long long m = n;
	for (int i = 1; i <= 15; i++) {
		if(n == 0) break;
		if(n % 26) {
			char cc = 'a' + ((n % 26 )- 1);
				
			n /= 26;
			ans.push_back(cc);
		}
		 else{
			char cc = 'a' + 25;
			n /= 26;
			n--;
			
			ans.push_back(cc);
		}
	}
	for (int i = ans.size() - 1; i >= 0; i--) {
		cout << ans[i];
	}
	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>
#include <map>


using namespace std;
typedef long long ll;
ll N;

int main(){

    string A, B;
    cin >> A >> B;

    double ans = sqrt(stod(A + B));
    //cout << ans << endl;
    if(ceil(ans) != floor(ans)){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }

}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 1000000000
#define MOD 1000000007LL
#define MAX 100005
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> doup;


int main(void) {
    ll n;
    cin >> n;
    cout << n*(n+1)/2 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b){ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

const int N=2e5+10; 
ll n,k;
int main(){
	scanf("%lld%lld",&n,&k);
	ll ans=0;
	for(ll i=k;i<=n;i++)
	{
		ll res=(i*(2*n-i+1)/2-i*(i-1)/2+1+mod)%mod;
		ans=(ans+res)%mod;
	}
	printf("%lld",ans+1);
    return 0;
}


Measured memory_bytes: 3824
import math

a, b, C = map(int, input().split())
Crad = math.radians(C)
S = 1/2 * a * b * math.sin(Crad)
c = (a**2 + b**2 - 2*a*b*math.cos(Crad))**(1/2.0)
L = a + b + c
h = b * math.sin(Crad)

print(S)
print(L)
print(h)



Measured memory_bytes: 5716
//
// Created by wulang on 10/1/16.
//

#include <iostream>
#include <algorithm>
#include <list>
using namespace std;

int main(int argc, char *argv[]) {
    if (argc == 2) {
        freopen(argv[1], "r", stdin);
    } else if (argc == 3) {
        freopen(argv[1], "r", stdin);
        freopen(argv[2], "w", stdout);
    }


   string ss;
    while(cin>>ss) {
        int cnt=0, ans=0;
        for(int i=0;i<ss.size();i++) {
            if(ss[i]=='S') cnt++;
            else {
                if(cnt>0) {
                    cnt--;
                    ans++;
                }
            }
        }
        cout<<ss.size()-ans*2<<endl;

    }


    return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();// 都市の数
        int m = sc.nextInt();// 道路の数
        int[][] map = new int[n][n];

        for (int i = 0; i < m; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();

            // 道路の数をカウントアップ(双方向のため両方カウントアップ)
            map[a-1][b-1]++;
            map[b-1][a-1]++;
        }

        // 各都市からの道を出力
        for (int i = 0; i < n; i++) {
            int roadCnt = 0;
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                roadCnt += map[i][j];
            }
            System.out.println(roadCnt);
        }
    }
}


Measured memory_bytes: 22736
#include<stdio.h>

int main(){

    int a,b,t;
    scanf("%d%d",&a,&b);
    t=a-b;
    if(t<0){
        t=t*(-1);
    }
    if(t==0 || t==1){
        printf("Yay!\n");
    }
    else{
        printf(":(\n");
    }
    return 0;
}



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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef _DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif


signed main() {

    int n,k;
    cin >>n>>k;
    int a=1;
    rep(i,n){
        a = min(a*2,a+k);
    }
    cout << a << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

void bubbleSort(int *A, int N){
    int flag = 1;
    int count = 0;
    while(flag){
        flag = 0;
        for(int j = N-1; j > 0; j--){
            if(A[j] < A[j-1]){
                count++;
                int tmp = A[j];
                A[j] = A[j-1];
                A[j-1] = tmp;
                flag = 1;
            }
        }
    }
    for(int i = 0; i < N; i++){
        printf("%d",A[i]);
        if(i < N-1){
            printf(" ");
        }
    }
    printf("\n");
    printf("%d\n",count);
}

int main(void){
    int N;
    scanf("%d",&N);
    int A[N];
    for(int i = 0; i < N; i++){
        scanf("%d",&A[i]);
    }
    bubbleSort(A, N);
    return 0;
}


Measured memory_bytes: 2140
s=input()
for i in range(len(s)):
  if i%2:
    if s[i]!="L" and s[i]!="U" and s[i]!="D":
      print("No")
      exit()
  else:
    if s[i]!="R" and s[i]!="U" and s[i]!="D":
      print("No")
      exit()
print("Yes")

Measured memory_bytes: 3060
import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
      	boolean flag = false;
      	for(int i = 1; i < 10; i++){
          for(int j = 1; j < 10; j++){
            if(i*j == n) flag = true;
          }
        }
      
      	if(flag)
          System.out.println("Yes");
      	else
          System.out.println("No");

	}
}

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

using namespace std;
using ll = long long int;

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

    ll n;
    cin >> n;
    vector<ll> a(n);
    for(auto &e: a) cin >> e;
    vector<vector<ll>> dp(n, vector<ll>(50, -1e18));
    dp[0][0 - 1/2+25] = 0;
    dp[0][1 - 1/2+25] = a[0];
    dp[1][0 - 2/2+25] = 0;
    dp[1][1 - 2/2+25] = a[1];
    for(ll i=1; i<n; i++) {
        for(ll j=max(0ll,(i+1)/2-2); j<=min(n-1, (i+1)/2+2); j++) {
            dp[i][j - (i+1)/2 + 25] = max(dp[i][j - (i+1)/2 + 25], dp[i-1][j - i/2 + 25]);
            if(i-2>=0 && j-1>=0) dp[i][j - (i+1)/2 + 25] = max(dp[i][j - (i+1)/2 + 25], dp[i-2][j-1 - (i-1)/2 + 25] + a[i]);
        }
    }
    cout << dp[n-1][n/2 - n/2 + 25] << endl;

}


Measured memory_bytes: 90828
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

#define rep(i, n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;

int main() {
    ll n,k;
    cin>>n>>k;
    ll ans=k;
    rep(i,n-1){
        ans*=(k-1);
    }
    cout<<ans<<endl;









    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    int a, b; cin >> a >> b;

    if(a %b == 0) cout << 0 << endl;
    else cout << 1 << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		try {
			line = sc.readLine();
		} catch (IOException e1) {
			// TODO ????????????????????? catch ????????????
			e1.printStackTrace();
		}
		String[] lineAry = new String[2];
		int a = 0;
		int b = 0;
		while (line != null) {
			lineAry = line.split(" ");
			a = Integer.parseInt(lineAry[0]);
			b = Integer.parseInt(lineAry[1]);
			System.out.println(a + b);
			try {
				line = sc.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}

Measured memory_bytes: 24096
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

int dp[MX];

int main() {
  int n;
  scanf("%d",&n);
  vi h(n);
  cin>>h;
  h.pb(INF);
  h.pb(INF);
  h.pb(INF);
  rep(i,n) dp[i] = INF;
  dp[0] = 0;
  rep(i,n) {
    mins(dp[i+1], dp[i]+abs(h[i]-h[i+1]));
    mins(dp[i+2], dp[i]+abs(h[i]-h[i+2]));
  }
  cout<<dp[n-1]<<endl;
  return 0;
}






















Measured memory_bytes: 1024
# coding: utf-8

n,y = map(int,input().split())

n10000 = -1
n5000 = -1
n1000 = -1

for i in range(n+1):
    for j in range(n-i+1):
        k = n-i-j
        if i*10000+j*5000+1000*k == y:
            n10000 = i
            n5000 = j
            n1000 = k

print(n10000,n5000,n1000)
            

Measured memory_bytes: 3192
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n, m;
    cin >> n >> m;
    //v[i]には2^i以上の値を入れる
    vector<int> v[31]; 
    //pow2[n]=2^nとなるような配列を用意する(2^30>10^9なので2^30まであれば良い)
    int pow2[31];
    pow2[0] = 1;
    for (int i=1; i<31; i++) {
        pow2[i] = pow2[i-1] * 2;
    }
    for (int i=0; i<n; i++) {
        int a;
        cin >> a;
        for (int j=0; j<31; j++) {
            if (a < pow2[j+1]) {
                v[j].push_back(a);
                break;
            }
        }
    }
    for (int i=30; i>=0; i--) {
        sort(v[i].begin(), v[i].end(), greater<>());
        while(v[i].size() > 0) {
            if (i > 0) {
                v[i-1].push_back((*v[i].begin())/2);
            }
            v[i].erase(v[i].begin());
            m--;
            if (m == 0) { //割引券の残り枚数m=0になったら二重ループを両方とも抜ける
                i = 0;
                break;
            }
        }
    }
    long long result = 0;
    for (int i=30; i>=0; i--) {
        for (int j=0; j<v[i].size(); j++) {
            result += v[i][j];
        }
    }
    cout << result << endl;
}

Measured memory_bytes: 4296
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
     
using namespace std;
     
typedef long long ll;
typedef pair<int, int> pii;
     
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
     
mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());


int main(){
    fastIO;
    int n, k;
    cin >> n >> k;
    int v[n];
    int res =0 ;
    for(int i = 0 ; i < n; i ++ ){
        cin >> v[i];
    }
    int cur = 0;
    int opr;
    
    vector<int> t1, t2;
    for(int i = 0 ; i <= n; i ++ ){
        t2.clear();
        for(int j = n ; j >= i ; j -- ){
            if(j<n)t2.push_back(v[j]);
            opr = i + (n - j);
            if(opr > k)
                break;
            cur = 0;
            vector<int> al;
            for(auto p : t1) al.push_back(p);
            for(auto p : t2) al.push_back(p);
            sort(al.begin(), al.end());
            for(auto x : al)
                cur += x;
            opr = k - opr;
            for(int i = 0 ; i < al.size(); i ++ ){
                if(opr > 0){
                    opr -- ;
                    cur = max(cur, cur - al[i]);
                }
            }
            res = max(res, cur);
        }
        if(i<n)t1.push_back(v[i]);
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
while(x,y = gets.split)

a = x.to_i
b = y.to_i

if a == 0 and b == 0
  break
  end

if a > b  
    puts"#{b} #{a}"
elsif a < b
    puts"#{a} #{b}"
else 
    puts"#{a} #{b}"
    end
end


Measured memory_bytes: 6848
using System;
using System.Collections.Generic;
using System.Linq;
using static AtCoder.Io;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            var s = ReadStringArray();
            Console.WriteLine($"{string.Concat(s.Select(v => char.ToUpper(v[0])))}");
        }
    }

    public static class Io
    {
        public static string ReadString() => Console.ReadLine();
        public static string[] ReadStringArray() => ReadString().Split(' ');
        public static int ReadInt() => int.Parse(ReadString());
        public static long ReadLong() => long.Parse(ReadString());
        public static int[] ReadIntArray() => ReadStringArray().ParseInt().ToArray();
        public static long[] ReadLongArray() => ReadStringArray().ParseLong().ToArray();
        public static IEnumerable<int> ParseInt(this IEnumerable<string> source) => source.Select(int.Parse);
        public static IEnumerable<long> ParseLong(this IEnumerable<string> source) => source.Select(long.Parse);
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(n) begin(n),end(n)
using ll = long long;
using P = pair<int,int>;

int main() {
    ll n, m;
    cin >> n >> m;
    ll temp = m/2;
    ll ans = min(temp, n);
    if(ans==temp){
        cout << ans << endl;
        return 0;
    } 
    else{
        m-=2*n;
        m/=4;
        ans+=m;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a < b){
        cout<<"a < b"<<endl;
    }else if(a > b){
        cout <<"a > b"<<endl;
    }else{
        cout << "a == b"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3096
import java.io.*;
import java.util.*;

public class Main {
  private static boolean solve(int n) {
    return (n / 10) % 111 == 0 || (n % 1000) % 111 == 0;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    out.println(solve(n) ? "Yes" : "No");
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] nextArray(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDoubleArray(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public int[][] nextIntMatrix(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLongMatrix(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDoubleMatrix(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
}


Measured memory_bytes: 23252
N, K = map(int, input().split())
A = sorted([int(a) for a in input().split()])

pos = 0
zer = 0
neg = 0
for a in A:
    if a > 0: pos += 1
    elif a < 0: neg += 1
    else: zer += 1
B = [a for a in A if a > 0]
C = [-a for a in A if a < 0][::-1]
b = len(B)
c = len(C)

def cnt(x):
    if x >= 0:
        re = pos * neg + zer * (pos + neg) + zer * (zer - 1) // 2
        j = b - 1
        for i in range(b):
            while j >= 0 and B[i] * B[j] > x:
                j -= 1
            re += max(j - i, 0)
        j = c - 1
        for i in range(c):
            while j >= 0 and C[i] * C[j] > x:
                j -= 1
            re += max(j - i, 0)
        return re
        
    re = 0
    j = 0
    y = -x
    for i in range(b)[::-1]:
        while j < c and B[i] * C[j] < y:
            j += 1
        re += c - j
    return re

l, r = - (1<<60), 1<<60
while r - l > 1:
    m = (l+r) // 2
    if cnt(m) >= K:
        r = m
    else:
        l = m

print(r)



Measured memory_bytes: 97880
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    W, H, X, Y = map(int, input().split())

    if W / 2 == X and H / 2 == Y:
        ans = [W * H/2, 1]
    else:
        ans = [W * H/2, 0]
    print(*ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <iostream>
#include <string>
#include <map>
#include <deque>
#include <algorithm>
using namespace std;
//#define FLOAT

void dfs(int id,int depth,map<int,string>&id2name,map<int,deque<int> >&children){
	cout<<string(depth,'.')<<id2name[id]<<endl;
	for(int i=0;i<children[id].size();i++){
		dfs(children[id][i],depth+1,id2name,children);
	}
}

int main(){
	map<int,string>id2name;
	map<int,int>parent;
	map<int,deque<int> >children;

	int N,k;
	string s;
	cin>>N;
	cin>>k>>s;
	parent[1]=0;
	id2name[1]=s;
#ifdef FLOAT
	children[k].push_front(1);
#else
	children[k].push_back(1);
#endif
	for(int post=2;post<=N;post++){
		cin>>k>>s;
		parent[post]=k;
		id2name[post]=s;
		for(int cur=post;cur;cur=parent[cur]){
			children[parent[cur]].erase(remove(children[parent[cur]].begin(),children[parent[cur]].end(),cur),children[parent[cur]].end());
#ifdef FLOAT
			children[parent[cur]].push_front(cur);
#else
			children[parent[cur]].push_back(cur);
			break;
#endif
		}
	}
	dfs(1,0,id2name,children);
}

Measured memory_bytes: 2664
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define fe(vec,lambda) std::for_each(vec.begin(), vec.end(), lambda );
#define printd(val) std::cout<< #val" = " <<val<<"\n";
#define printv(val) std::for_each(val.begin(),val.end(),[](auto x){cout<<x<<"\n";});
#define lim 1000000007ll
#include<bits/stdc++.h>
using ll = long long;
using pii = std::pair<ll,ll>;
using namespace std;
template<class T>T chmin(T& a,T b){if(a>b){a^=b;b^=a;a^=b;return 1;}return 0;}
template<class T>T chmax(T& b,T a){if(a>b){a^=b;b^=a;a^=b;return 1;}return 0;}
template <class T> T gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T lcm(T a, T b){return a * b / gcd(a, b);}
inline bool operator<(const pii &lhs,const pii &rhs){return(lhs.second<rhs.second);}
template<class T> vector<pair<T,T>> duplicator(const vector<T>& input){vector<pair<T,T>> out(input.size()-1);rep(i,input.size()-1){out[i].first =input[i  ];out[i].second=input[i+1];}return(out);}
vector<char> String_to_vector_char(const string& input){vector<char> out(input.size());rep(i,input.size()){out[i]=input[i];}return out;}
void YesNo(bool flag){ cout<<(flag? "Yes":"No");}

ll a,b,c,d,n,x;
vector<ll>v[3];
map<ll,ll>m;
string s,s2;
void input(){
    cin>>n>>a;
}
void src(){
    cout<<n*n-a;
}

int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
#define ll long long

using namespace std;

int main(){

  string S;
  cin >> S;
  ll ans = 0;
  ll n = S.size();

  for(int i = 0; i < (1 << n-1); i++) { // 全パターンを試す
    ll c = 0; // 初期化
    for (int j = 0; j < n; j++) { // Sを分割する
      c = c*10 + S[j] - '0'; // Sを計算し直す
      if(i & (1 << j) || j == n - 1){ // iの中にjが含まれるか
        ans += c;
        c = 0;
      }
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
#define fi first
#define se second
#define upb upper_bound
#define lwb lower_bound
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;

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

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y){
    if(y<=0) return 1;
    ll ans = 1;
    x %= mod;
    while(y){
        if(y&1)
            ans = (x * ans) % mod;
        x = (x * x) % mod;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = (a - b); if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = (a + b); if(c >= mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

//------------------------------------------------------------------------------------------

//const ll N = 2e5 + 1;
//vector<ll> adj[N];
//bool visited[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<<fixed<<setprecision(10);

	ll x;
	cin>>x;
	if(x>=30)cout<<"Yes";
	else cout<<"No";


    return 0;
}


Measured memory_bytes: 3624
#!/usr/bin/env python3

import sys
import math

D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]
out = [int(input()) for _ in range(D)]

lastday = [0] * 26
sat = 0

for i in range(D):
  lastday[out[i]-1] = i+1
  sat += s[i][out[i]-1]
  for j in range(26):
    sat -= c[j] * (i+1 - lastday[j])
  print(sat)


Measured memory_bytes: 9348
#include<stdio.h>

int main(void){
    int n, now, a, count, b[100001];

    scanf("%d", &n);
    for(int i = 1; i < n + 1; i++) scanf("%d", &b[i]);

    count = 0;
    now = 1;
    while(now != 2){
        a = b[now];
        b[now] = -1;
        if(a < 0){
            count = -1;
            break;
        }else{
            now = a;
            count++;
        }
    }
    printf("%d", count);

    
    return 0;
}

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

using namespace std;

int main()
{
    int n ,i , mod,ans;
    
    scanf("%d",&n);
    mod = n%1000;
    if(mod>0)
     ans = 1000-mod;
     else
        ans = mod;
    printf("%d\n",ans);
    
    return 0;

}


Measured memory_bytes: 3784
#include <stdio.h>
#include <math.h>

int num[100001];

int Func(int n){
  if(num[n]>=0) return num[n];
  int min = 100000;
  int temp;
  for(int i = 1; pow(6,i) <= n; i++){
    temp = Func(n-pow(6, i));
    if(min > temp) min = temp;
  }
  for(int i = 1; pow(9,i) <= n; i++){
    temp = Func(n-pow(9, i));
    if(min > temp) min = temp;
  }
  num[n] = min + 1;
  return num[n];
}

int main(int argc, char const *argv[]){
  int n;
  num[0]=0;
  num[1]=1;
  num[2]=2;
  num[3]=3;
  num[4]=4;
  num[5]=5;
  for(int i = 6; i<=100000;i++){
    num[i]=-1;
  }
  scanf("%d", &n);
  printf("%d", Func(n));
  return 0;
}

Measured memory_bytes: 1280
n, y = list(map(int, input().split()))
y = y // 1000

if n > y:
    print("-1 -1 -1")
elif 10*n < y:
    print("-1 -1 -1")
else:
    diff = 10*n - y

    for i in range(diff//9 + 1):
        for j in range(diff//5 + 1):
            ans = 9*i + 5*j

            if ans > diff:
                break
            elif (i+j) > n:
                break
            elif ans == diff:
                print(n-(i+j), j, i)
                exit()

    print("-1 -1 -1")

Measured memory_bytes: 9232
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

int a[20]={0};
int main()
{
    a[0]=1;
    for(int i=1;i<18;i++){
        a[i]=a[i-1]*2;
     //   cout <<a[i] <<endl;
    }
    long long n,k;
    cin >> n >> k;
    int t;
    for(int i=1;i<18;i++){
        if(a[i]<k);
        else{
            t=i;
            break;
        }
    }
    double j=1;
    double fenmu=1;
    double sum=0;
    fenmu=n*a[t];
    //cout << a[t] << endl;
    for(int i=1;i<=n;i++){
        if(i*a[t-1]>=k&&t>0){
            t--;
            fenmu/=2;
        }
        sum+=1/fenmu;
    }
    //cout <<fenmu <<endl;
    printf("%.12f\n",sum*1.0);
    //cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
using namespace std;
long N;
void dfs(long num,int use,int &res){
    if(num>N)return;
    if(use==0b111)res++;
    dfs(num*10+7,use|0b001,res);
    dfs(num*10+5,use|0b010,res);
    dfs(num*10+3,use|0b100,res);

}

int main(){
    
    scanf("%ld",&N);
    int res=0;
    dfs(0,0,res);
    cout<<res<<"\n";
    
}





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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

using ll = long long;
using ld = long double;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int n;
    cin >> n;
    int four = 0, two = 0, e = 0;
    rep (i, n) {
        ll a;
        cin >> a;
        if (a % 4 == 0) four++;
        else if (a % 2 == 0) two++;
        else e++;
    }
    bool ok = false;
    if (e) {
        if (two > 0) four--;
        if (four >= e - 1) ok = true;

    } else {
        ok = true;
    }
    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}



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

typedef long long ll;
int main()
{
	ll x;
	cin >> x;
	ll cnt1 = 0, cnt2 = 0;

	cnt1 = x / 500;
	cnt2 = (x % 500) / 5;

	cout << 1000 * cnt1 + 5 * cnt2 << endl;
}


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

int main() {
	int X;
	cin >> X;
	int kyu[] = {2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400};

	for (int i = 0; i < 9; i++) {
		if (X >= kyu[i]) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<vector<pair<int,int> > >v(n);
	for(int i=0;i<n;i++){
		int m;
		cin>>m;
		v[i].resize(m);
		for(int j=0;j<m;++j){
			cin>>v[i][j].first>>v[i][j].second;
			--v[i][j].first;
		}
	}
	
	int res=0;
	for(int s=0;s<(1<<n);s++){
		bool ok=true;
		for(int i=0;i<n;i++){
			if((s>>i)& 1){
				for(auto e:v[i]){
					if((s>>e.first & 1)!=e.second){
						ok=false;
					}
				}
			}
		}
		if(ok){
			res=max(res,__builtin_popcount(s));
		}
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256