akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

#define MUL(X, Y) (((X)*(Y))%1000000007)

int flg[50000];


int main(){
	int n, t, ans, zero=0;
	
	scanf("%d", &n);
	ans = 1;
	for (int i=0; i<n; i++){
		scanf("%d", &t);
		if (t==0){
			if (zero) {
				ans = 0;
				break;
			}else {
				zero = 1;
				continue;
			}
		}
		if (t%2 == n%2 || flg[t/2]==2){
			ans = 0;
			break;
		}
		if (flg[t/2]==0){
			ans = MUL(ans, 2);
		}
		flg[t/2]++;
	}
	printf("%d\n", ans);
	
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
using namespace std;

int main()
{
	int ANS=0;
	int N;
	int t;
	int max = 0;
	vector<int> H;
	cin >> N;

	for (int i = 0; i < N; i++)
	{
		cin >> t;
		H.push_back(t);
	}

	for (int i =0 ; i < N; i++)
	{
		if (max <= H[i]) {
			max = H[i];
			ANS = ANS + 1;
		}
	}
	
	cout << ANS << endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 753;
        for(int i = 0;i < s.length()-2;i++){
            int num = Integer.parseInt(s.substring(i, i+3));
            int sa = Math.abs(753-num);
            if(ans > sa)
            ans = sa;
        }
        System.out.println(ans);
    }
}

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

int main(){
  ll N=50;

  ll K;
  cin>>K;
  ll ans[50];
  for(int i=0;i<50;i++)ans[i]=49;
  
  for(int i=0;i<N;i++)ans[i]+=K/N;
  K%=N;

  while(K>0){
    for(int i=0;i<N;i++)ans[i]--;
    ans[0]+=N;
    K--;
    sort(ans,ans+N);
  }
  
  cout<<N<<endl;
  for(int i=0;i<N;i++){
    if(i)cout<<' ';
    cout<<ans[i];
  }
  cout<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n,m;
	int ans=0;
	cin >>n>>m;
	// find..a -> (n+x)*a=M
	// a=m/(n+x);
	set<int>dis;
	int bef=m;
	for(int i=1;i<=sqrt(bef);i++){
		if(bef%i==0){
			dis.insert(i);
			dis.insert(bef/i);
		}
		
	}
	auto ter=(dis.lower_bound(n));
//	clog<<(*ter)<<endl;
	if(ter==dis.end()){
		ans=1;
	}else{
		ans=m/(*ter);
	}
	cout<<ans<<endl;
}

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

int main()
{
	vector<pair<int, int>> baisu;
	int amax = 1000000000;
	int temp = 2;
	int count = 1;
	while (temp <= amax) {
		baisu.push_back(pair<int,int>(count, temp));
		++count;
		temp *= 2;
	}

	int n;
	cin >> n;
	vector<int> av(n);
	for (auto& a : av) {
		cin >> a;
	}

	int ret = 0;
	int numberOfBaisu = baisu.size();
	for (auto& a : av) {
		int i = numberOfBaisu - 1;
		for (; 0 <= i; --i) {
			if (a % baisu[i].second == 0) {
				break;
			}
		}
		if (0 <= i) {
			ret += baisu[i].first;
		}
	}

	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 256
line = input().split()
import fractions
lcm = (int(line[2])*int(line[3]) //fractions.gcd(int(line[2]),int(line[3])))

pos_c = int(int(line[1])//int(line[2])) 
pos_d = int(int(line[1])//int(line[3])) 
pos_lcm = int(int(line[1])//lcm)

pos_c1 = int((int(line[0])-1)//int(line[2])) 
pos_d1 = int((int(line[0])-1)//int(line[3])) 
pos_lcm1 = int((int(line[0])-1)//lcm)

b = int(line[1]) - pos_c - pos_d + pos_lcm
a = int(line[0]) - 1 - pos_c1 - pos_d1 + pos_lcm1

print(b-a)

Measured memory_bytes: 5104
from itertools import chain

H,W = map(int,input().split())
grid = tuple(tuple(map(lambda c: c != '#', input())) for _ in range(H))

scores = [[0]*W for _ in range(H)]

for i in range(H):
    s = 0
    for j in range(W):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for i in range(H):
    s = 0
    for j in reversed(range(W)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in range(H):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0

for j in range(W):
    s = 0
    for i in reversed(range(H)):
        if grid[i][j]:
            scores[i][j] += s
            s += 1
        else:
            s = 0


print(1 + max(chain.from_iterable(scores)))

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/

//vector<int> p;

signed main()
{
	int n; cin >> n;
//	p.resize(n);
vector<int> p(n);
for(int i = 0, i_len = (int)n; i < i_len; ++i) cin >> p[i];
int cnt{};
	for(int i = 0, i_len = (int)n-2; i < i_len; ++i){
		if(p[i] < p[i+1] && p[i+1] < p[i+2]) cnt++;
		else if(p[i] > p[i+1] && p[i+1] > p[i+2]) cnt++;
	}
cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define x first
#define y second
#define mod 1e9+7
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rof(i,a,b) for(ll i=a;i>b;i--)
//cf dont use unordered map. use simply map<... , ... > m;

//They are Iterator minus v.begin() krna //lower_bound(v.begin(),v.end(),x)-v.begin()  //upper_bound(v.begin(),v.end(),x)-v.begin()
// lower bound tells greater than or equal to // upper bound tells strictly greater than
//int a[1001][1001] //aise global me hi// ll lcm(ll a, ll b){ return a / __gcd(a, b) * b; }
//memset can initialize to 0 or -1 ONLY //memset(str, 't', sizeof(str)); // string //memset(a, 0, sizeof(a));  //1D array    // memset(a,0,sizeof(a[0][0])*n*n); //2D array
// set.insert(),find() //for(auto it=set.begin();....) cout<<*it;   // sort(v.begin(),v.end(),compare)

void solve()
{
    
    string s;cin>>s;
    if(s[0]=='7'||s[1]=='7'||s[2]=='7') cout<<"Yes";
    else cout<<"No";
}


int main()
{

ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t=1;
  //  cin>>t;
    while(t--)
    {
     solve();
    }
}

Measured memory_bytes: 3604
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main() {


    int n,ntemp;
    scanf("%d", &n);
    ntemp = n;
    
    int cnt = 1;
    while (pow(10, cnt) <= n) {

        cnt++;
    }

    int mysum = 0;
    for (int i = cnt; i >= 1; i--) {
        //printf("%d %d %d\n", i, (int) pow(10, i), n / (int) pow(10, i));
        int sho = ntemp / (int) pow(10, i - 1);
        mysum += sho;
        ntemp -= (int) pow(10, i - 1) * sho;
    }


    if (n % mysum == 0) {
        puts("Yes");
    } else {
        puts("No");
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LL long long
#define uLL unsigned long long

using namespace std;
const int N=2e5+10,inf=1e9;
int rd()
{
    int x=0,w=1;char ch=0;
    while(ch<'0'||ch>'9'){if(ch=='-') w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
    return x*w;
}
int to[N<<1],nt[N<<1],hd[N],tot=1;
void adde(int x,int y)
{
    ++tot,to[tot]=y,nt[tot]=hd[x],hd[x]=tot;
    ++tot,to[tot]=x,nt[tot]=hd[y],hd[y]=tot;
}
char co[2]={'W','B'};
int n,m,a[N],sq[N],a1[N],a2[N];
bool cmp(int aa,int bb){return a[aa]<a[bb];}

int main()
{
    n=rd(),m=rd();
    for(int i=1;i<=n;++i) a[i]=rd();
    for(int i=1;i<=m;++i) adde(rd(),rd());
    for(int i=1;i<=max(n,m);++i) a1[i]=-1,a2[i]=inf+1;
    for(int i=1;i<=n;++i) sq[i]=i;
    sort(sq+1,sq+n+1,cmp);
    for(int i=1;i<=n;++i)
    {
	int x=sq[i];
	for(int j=hd[x];j;j=nt[j])
	{
	    int y=to[j];
	    if(a[y]>a[x]||((~a1[x])&&(~a1[y]))) continue;
	    if(a[x]==a[y])
	    {
		a2[j>>1]=a[x];
		if(a1[x]<0)
		{
		    if(a1[y]<0) a1[y]=0;
		    a1[x]=a1[y]^1;
		}
		else a1[y]=a1[x]^1;
	    }
	    else if(~a1[y])
		a2[j>>1]=a[x]-a[y],a1[x]=a1[y];
	}
    }
    for(int i=1;i<=n;++i)
	if(a1[i]<0){puts("-1");return 0;}
    for(int i=1;i<=n;++i) putchar(co[a1[i]]);
    puts("");
    for(int i=1;i<=m;++i) printf("%d\n",min(a2[i],inf));
    return 0;
}


Measured memory_bytes: 9344
p = [5, 7, 5, 7, 7]
while True:
    n = int(input())
    if n == 0:
        break
    word = [input() for _ in range(n)]
    flag = False
    for i in range(len(word)):
        ip = 0
        phrase = ["" for _ in range(len(p))]
        if flag:
            break
        for j in range(i, len(word)):
            if len(phrase[ip]+word[j]) == p[ip]:
                phrase[ip] += word[j]
                ip += 1
            else:
                phrase[ip] += word[j]
                if len(phrase[ip]) > p[ip]:
                    break
                if len(phrase[ip]) == p[ip]:
                    ip += 1
            if len(phrase[-1]) == 7:
                print(i+1)
                flag = True
                break


Measured memory_bytes: 5612
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    string s2="keyence";
    if(s==s2)
    {
        cout<<"YES";
    }
    else
    {
        if(s.size()<7)
            cout<<"NO";
        int n=s.size();
        int p=0;
        for(int len=1;len<s.size();len++)
        {
            int i=0,j=len-1;
            while(j<n)
            {
                string ss1,ss2;
                for(int k=0;k<i;k++)
                {
                   ss1+=s[k];
                }
                for(int k=j+1;k<n;k++)
                    ss2+=s[k];
                if(ss1+ss2==s2)
                {
                    cout<<"YES";
                    p=1;
                    return 0;
                }
                i++;
                j++;
            }
        }
        if(p==0)
            cout<<"NO";
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int nod(int num) {
    int dig;
    int sum=0;
    while(num){
      dig = num % 10;
      sum = sum + dig;
      num = num / 10;
    }
    return sum;
}

int main() {
    int n;
    cin >> n;
    if(n%nod(n)==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
}

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

namespace ABC
{
    class ABC_IHCA
    {
        const string FILE = "/tmp/data.txt";

        static void Main(string[] args)
        {
#if DEBUG
            Console.SetIn(new StreamReader(FILE));
#endif
            long D = RL();
            long[] Ca = RLa(26);
            long[,] La = RLa(D, 26);

            for (int i = 0; i < D; ++i)
            {

                Console.WriteLine((i % 26) + 1);
                //                Console.WriteLine(max(La, i) + 1);
            }

#if DEBUG
            Console.WriteLine("*** end ***");
            Console.SetIn(Console.In);
            Console.ReadKey();
            Console.WriteLine();
#endif
        }

        static int max(long[,] La, int i)
        {
            long m = 0;
            int midx = 0;
            for (int j = 0; j < 26; ++j)
            {
                if (La[i, j] > m)
                {
                    m = La[i, j];
                    midx = j;
                }
            }
            return midx;
        }

        static long RL()
        {
            return long.Parse(Console.ReadLine());
        }

        static long[] RLa(long n)
        {
            string[] sa = Console.ReadLine().Split(' ');
            long[] la = new long[n];
            for (int i = 0; i < n; ++i)
            {
                la[i] = long.Parse(sa[i]);
            }
            return la;
        }

        static long[,] RLa(long r, long c)
        {
            long[,] la = new long[r, c];
            for (int i = 0; i < r; ++i)
            {
                string[] sa = Console.ReadLine().Split(' ');
                for (int j = 0; j < c; ++j)
                {
                    la[i, j] = long.Parse(sa[j]);
                }
            }
            return la;
        }
    }
}


Measured memory_bytes: 28120
def solve(SECRET = None):
  num_asks = 0
  def ask(n):
    n = int(n)
    nonlocal num_asks
    num_asks += 1
    assert 1 <= n <= int(1e18)
    if SECRET:
      return (n <= SECRET) == (str(n) <= str(SECRET))
    else:
      print("?", n)
      return input() == 'Y'

  if ask(100000000000):
    for k in range(1,19):
      if ask("9"*k):
        return 10**(k-1), num_asks
  else:
    for k in range(1,10):
      if not ask(10**k):
        # len == k
        low = 10**(k-1)
        high = (10**k) - 1
        ret = -1
        while low <= high:
          mid = (low + high) // 2
          if ask(str(mid) + "9"*k):
            ret = mid
            high = mid - 1
          else:
            low = mid + 1
        return ret, num_asks

  return -1, num_asks

ans, _ = solve()
print("!", ans)
exit(0)

#for SECRET in range(1,1000):
import random
num_iter = 0
while True:
  num_iter += 1
  secret_len = random.randint(1, 9)
  SECRET = random.randrange(10**(secret_len-1),10**secret_len)
  ans, num_asks = solve(SECRET)
  assert num_asks <= 64
  if SECRET != ans or num_asks > 64:
    print(num_iter, "..", SECRET, ":", ans, num_asks)
    break
  if num_iter % 1000 == 0:
    print(num_iter)

Measured memory_bytes: 3912
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,n=0;
    
    cin >> a >> b >> c ;

    
 
     for (int i=a; i<=b; i++){
         if(c%i==0){
             n++;
         }
     }
 
cout << n << endl;
}


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

int main() {
  li n,d;
  cin>>n>>d;
  li i,x,y;
  map<long double,li>m;
  li cnt=0;
  for(i=0;i<n;i++){
      cin>>x>>y;
      long double xx,yy;
      xx=x;
      yy=y;
      long double val=sqrt(xx*xx+yy*yy);
      if(val<=d)
      cnt++;
  }
  
   cout<<cnt<<endl;
}


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

typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
 
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


int h,w;
char field[50][51];

int d[50][51];

int bfs() {
    queue<i_i> que;
    que.push(i_i(0,0));
   for (int i=0;i<h;i++) {
        for (int j=0;j<w;j++) {
            d[i][j] = INF;
        }
    }
    d[0][0] = 0;

    int dx[] = {1,-1,0,0}, dy[] = {0,0,1,-1};
    while(que.size()) {
        i_i pos = que.front(); que.pop();

        if (pos.first==h-1 && pos.second==w-1) break;
        for(int i=0;i<4;i++) {
            int nx = pos.first + dx[i], ny = pos.second + dy[i];
            if(0<=nx&&nx<h && 0<=ny&&ny<w && field[nx][ny]!='#' && d[nx][ny]==INF) {
                que.push(i_i(nx,ny));
                d[nx][ny] = d[pos.first][pos.second] + 1;
            }
        }
    }
    return d[h-1][w-1];
}

int count_w() {
    int cnt = 0;
    for (int i=0;i<h;i++) {
        for (int j=0;j<w;j++) {
            if(field[i][j]=='.') cnt++;
        }
    }
    return cnt;
}
int main() {
    cin >> h >> w;
    for (int i=0;i<h;i++) {
        for (int j=0;j<w;j++) {
            cin >> field[i][j];
        }
    }
    int whites = count_w();
    int need = bfs() + 1;
    int ans;
    if (need!=INF+1) ans = whites - need;
    else ans = -1;
    cout << ans << endl;
}



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

struct actyp {int a; int c;};

int asbc(const void *x, const void *y) {
  return (*(struct actyp *)x).a - (*(struct actyp *)y).a;
}

int main(){
   int n,i;
   struct actyp ac[100000];
 
   scanf("%d",&n);
   for (i=0;i<n;i++) {
      scanf("%d",&(ac[i].a));
      ac[i].c=i+1;
   }
   qsort(ac,n,sizeof(struct actyp),asbc);
   printf("%d",ac[0].c);
   for (i=1;i<n;i++)
      printf(" %d",ac[i].c);
   puts("");
   return 0;
}


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

int main(){
  int N;cin>>N;
  string S;cin>>S;
  int ans=0;
  for(int i=0;i<N-2;i++){
    if(S.substr(i,3)=="ABC") ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for(int i = l, i##end = r; i <= i##end; ++i)
const int MAXN = 500005;
 
bool mark[MAXN];
void init() {
    rep (i, 2, MAXN - 1) if (!mark[i]) {
        for (int j = i + i; j < MAXN; j += i) mark[j] = 1;
    }
}
int main(){
	init();
	int x;
	scanf("%d",&x);
	for(int i=x;;i++){
		if(!mark[i])
		{
			cout<<i;
			break;
		}
		
	}
	
	
	return 0;
}

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

typedef long long ll;
const int maxn=200010;
const int inf=1e9;
int n;
ll ans;
int pre[maxn], Next[maxn];
int st[maxn], a[maxn];

void read(int& x){
	x=0; char c=getchar();
	while(c<'0' || c>'9') c=getchar();
	while(c>='0' && c<='9'){
		x=x*10+c-'0';
		c=getchar();
	}
}

int main(){

	read(n);
	for(int i=1;i<=n;i++) read(a[i]);
	int top=0; a[n+1]=0;
	for(int i=1;i<=n+1;i++){
		while(top && a[ st[top] ]>a[i]) Next[ st[top--] ]=i;
		pre[i]=st[top], st[++top]=i;
	}
	for(int i=1;i<=n;i++){
		ans+=1ll*a[i]*(Next[i]-i)*(i-pre[i]);
	}
	// for(int i=1;i<=n;i++) printf("%d %d\n", pre[i], Next[i]);
	printf("%lld",ans);
	return 0;
}

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

using namespace std;

int main(void){
    int n, sum = 0;
    cin >> n;
    vector<int> w(n);
    for(int i = 0; i < n; i++){
        cin >> w[i];
        sum += w[i];
    }
    int solve = 0;
    int ans = sum;
    for(int i = 0; i < n; i++){
        solve += w[i];
        ans = min(ans, abs(solve - (sum - solve)));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using ll=long long;
using ld=long double;
#define inf INT_MAX  
const ll infll=1ll*inf*inf;
#define mode 998244353
#define mod 1000000007
const long double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define pb push_back
#define mp make_pair
#define ub upper_bound 
#define lb lower_bound 
#define far(i,a,b) for (ll i = a; i <= b; i++)
#define rev(i,a,b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define sz(a) int((a).size())
#define ftr(c,i) for(auto i = begin(c); i != end(c); i++)
#define rtr(c,i) for(auto i = rbegin(c); i != rend(c); i++)
#define pre(c,x) ((c).find(x) != (c).end())
#define cpre(c,x) (find(all(c),x) != (c).end())
#define mii map<int,int>
#define mll map<ll,ll>
#define vs vector<string>
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vii vector<pii >
#define vll vector<pll >
#define vvl vector<vector<ll> >
#define vvi vector< vector<int > >
#define W(t) while(t --)
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout <<(ll)(it-arr.begin()) << ')' <<  *it << ' '; cout << endl;
#define printii(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << it->ff<<' '<<it->ss << endl; cout << endl;
#define MID(i,j) ((i)+(j))/2
#define nl '\n' 
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
ll max(ll a,ll b) {return (a>b? a:b);}
ll min(ll a,ll b) {return (a>b? b:a);}
ll gcd(ll a,ll b) {return (b==0)? a:gcd(b,a%b); }
ll gcd(ll a,ll b,ll & x,ll & y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}
ll modinv(ll a,ll b){
	ll x,y;
	gcd(a, b, x, y);
	return (x%b + b)%b;
}
ll ceiling(ll a,ll b){ 
        if(a%b==0) return a/b;
        else return a/b+1;
}
ll bpow(ll a,ll b,ll m){
	a%=m;
	ll res=1;
	while(b>0){
		if(b&1) res=(res*a)%m;
		b>>=1;
		a=a*a%m;
	}
	return res;
}
vvl mat_mul(vvl mat1,vvl mat2,ll mod1){
        vvl res(sz(mat1),vl(sz(mat2[0]),0));
        far(i,0,sz(mat1)-1){
                far(j,0,sz(mat2[0])-1){
                        far(k,0,sz(mat1[0])-1){
                                res[i][j]=(res[i][j]+(mat1[i][k]*mat2[k][j])%mod1)%mod1;          
                        }   
        }   
        }   
        return res;
}
vvl mat_exp(vvl mat,ll p,ll mod1){ 
        vvl res(sz(mat),vl(sz(mat[0]),0));
        far(i,0,sz(mat)-1) res[i][i]=1;
        while(p>0){
                if(p&1) res=mat_mul(res,mat,mod1);   
                mat=mat_mul(mat,mat,mod1);
                p>>=1;
        }   
        return res;
}
const int N=1e6+5;
ll n,m,q,t,k,x,y,z,ans;

int main()
{
	cin >> n >> x;
	t=1;
	far(i,1,n){
		cin >> y;
		z+=y;
		if(z<=x) t++;
	}
	cout << t << nl;
}


Measured memory_bytes: 256
def main():
    import sys
    readline = sys.stdin.buffer.readline
    import collections

    n, q = map(int, readline().split())
    ab = [list(map(int, readline().split())) for _ in range(n-1)]
    px = [list(map(int, readline().split())) for _ in range(q)]

    c = [[] for _ in range(n)]
    for a, b in ab:
        a, b = a-1, b-1
        c[a].append(b)
        c[b].append(a)

    point = [0] * n
    for p, x in px:
        point[p-1] += x

    parents = [0] * n
    ans = [0] * n
    q = collections.deque()
    q.append(0)
    while q:
        v = q.pop()
        ans[v] = ans[parents[v]] + point[v]
        for i in c[v]:
            if i == parents[v]:
                continue
            parents[i] = v
            q.append(i)
    print(' '.join(list(map(str, ans))))

main()

Measured memory_bytes: 150192
use proconio::input;

fn main() {
    input! {
        l: i64,
        r: i64,
    }

    let mut ans = std::i64::MAX;

    'outer: for j in l..=r {
        for i in l..j {
            ans = ans.min((i * j) % 2019);
            if ans == 0 {
                break 'outer;
            }
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 2136
N = int(input())
L = list(map(int, input().split()))

L.sort()
ans = 0
for i in range(N):
    for j in range(N):
        for k in range(N):
            if i < j < k and L[i] < L[j] < L[k] and L[i] + L[j] > L[k]:
                ans += 1

print(ans)


Measured memory_bytes: 9156
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str = br.readLine();

		int x = Integer.parseInt(SubStringStart(str));//?¬¬????????°
		int y = Integer.parseInt(SubStringMid(str));//?¬¬????????°
		int z = Integer.parseInt(SubStringEnd(str));//?¬¬????????°

		Integer[] div3 = getDivisor(z);

		Set<Integer> set = new HashSet<>();

		for (int i = x; i <= y; i++) {
			if (Arrays.asList(div3).contains(i)) {
				set.add(i);
			}
		}
		System.out.println(set.size());
	}

	//?¬¬????????°???????????????????????????
	public static String SubStringStart(String str) {
		int index = str.indexOf(" ");
		return (str.substring(0, index));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringEnd(String str) {
		int index = str.lastIndexOf(" ");
		return (str.substring(index + 1));
	}

	//	?¬¬????????°???????????????????????????
	public static String SubStringMid(String str) {
		int index1 = str.indexOf(" ");
		int index2 = str.lastIndexOf(" ");
		return (str.substring(index1 + 1, index2));
	}

	//?????°????´???°???????????????????????????
	public static Integer[] getDivisor(int num) {
		int dnum = getDnum(num);
		Integer[] getNum = new Integer[dnum];
		int dflag = 0;
		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				getNum[dflag] = i;
				dflag++;
			}
		}
		return (getNum);
	}

	//?´???°?????°???????????????????????????
	public static int getDnum(int num) {
		int dflag = 0;

		for (int i = 1; i < num + 1; i++) {
			if (num % i == 0) {
				dflag++;
			}
		}
		return (dflag);
	}
}

Measured memory_bytes: 25780
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; 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 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 set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
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;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
  
int main() {
  int H,W,A,B;
  cin >> H >> W >> A >> B;
  rep(i,H) {
    rep(j,W) {
      if(i < B && j < A) {
        cout << 0;
      } else if (i < B) {
        cout << 1;
      } else if (j < A) {
        cout << 1;
      } else {
        cout << 0;
      }
      if (j == W-1) {
        cout << endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define NIL -(long long)(1e9)
#define ll long long
// long long n,w;
typedef struct Node node;
struct Node
{	int myV;
	vector<int> Ways;
	//vector<pair<int,int>> NoWays;
	bool visit=0;
	int dist=0;
	int myins=0;
};
void self_max (int&a ,int b){
 a= max(a,b);
return;
}
std::vector<node*> graph;
int dfs(int a){
	graph[a]->visit=1;
	for(int b : graph[a]->Ways){
		self_max(graph[b]->dist, graph[a]->dist + 1);
		graph[b]->myins--;
		if(graph[b]->myins ==0  ){		//&&!graph[b]->visit
			dfs(b);
		}
	}

return 0;
}

int n,m;

int main () {

cin>>n>>m;
node bos;
graph.pb(&bos);
for (int i = 1; i <= n; ++i)
{	node* temp= new node;
	temp->myV=i;
	graph.pb(temp);
	graph[0]->Ways.pb(i);

}
for (int i = 0; i < m; ++i)
{	int d1,d2;
	cin>>d1>>d2;
	graph.at(d1)->Ways.pb(d2);
	//graph.at(d2)->NoWays.pb({d1,0});
	graph[d2]->myins++;
}

for (int i = 1; i <= n; ++i)
{if(graph[i]->visit==0 && graph[i]->myins==0){
	dfs(i);}
}
int ans=0;
for (int i = 0; i <= n; ++i)
	{
		self_max(ans,graph[i]->dist);
	}	

cout<<ans;
}









Measured memory_bytes: 13940
# -*- coding: utf-8 -*-


def main():
    s = input()[::-1]
    w_count = 0
    ans = 0

    for si in s:
        if si == 'W':
            w_count += 1
        else:
            ans += w_count

    print(ans)


if __name__ == '__main__':
    main()


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

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	LL;
typedef vector<LL> 		VL;
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
#define DRT() int t; si(t); while(t--)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//# define M_PI           3.14159265358979323846264338327950288
// DSU
void IO(){
	#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
	#endif
	srand(chrono::steady_clock::now().time_since_epoch().count());
	off;
}

int main(){
	IO();
	LL n;
	cin>>n;
	string s;
	cin>>s;
	LL r = 0;
	rep(i,0,n){
		if(s[i] == 'R')
			r++;
	}
	LL cnt = 0;
	rep(i,0,r){
		if(s[i] == 'W')
			cnt++;
	}
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 3776
#include <bits/stdc++.h>
#define MAXN 20
#define pii pair<int, int>
#define pb push_back
#define inf 1e18
#define fi first
#define se second
#define mt make_tuple
typedef long long ll;

using namespace std;

int n, a[MAXN][MAXN], ans;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    memset(a, -1, sizeof(a));
    for(int i = 0; i < n; i++){
        int t;
        cin >> t;
        for(int j = 0; j < t; j++){
            int f, y;
            cin >> f >> y;
            a[i][f - 1] = y;
        }
    }
    for(int i = 0; i < (1 << n); i++){
        bool b = true;
        for(int j = 0; j < n; j++){
            if((1 << j) & i){
                for(int k = 0; k < n; k++){
                    if(a[j][k] != -1 and (a[j][k] ^ (i >> k) % 2)){
                        b = false;
                    }
                }
            }
        }
        //cout << b;
        if(b){
            ans = max(ans, __builtin_popcount(i));
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
#pragma GCC target ("avx2")
#pragma GCC target ("sse2")
#pragma GCC optimize ("Ofast")
#pragma GCC push_options
#pragma GCC optimize ("unroll-loops")
#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define __V vector
#define all(x) x.begin(), x.end()
#define rall(x) x.begin(), x.end()
#define oit ostream_iterator
#define mod 1000000007ll
using namespace std;
void doin() {
	cin.tie();
	cout.tie();
	ios::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}
template<typename X, typename Y>
istream& operator>>(istream& in, pair<X, Y> &a) {
	in >> a.first >> a.second;
	return in;
}
template<typename T>
void getv(T& i) {
	cin >> i;
}
template<typename T, typename ... Ns>
void getv(vector<T>& v, int n, Ns ... ns) {
	v.resize(n);
	for (auto& i : v)
		getv(i, ns...);
}
template<typename T>
void getv1(T& i) {
	cin >> i;
}
template<typename T, typename ... Ns>
void getv1(vector<T>& v, int n, Ns ... ns) {
	v.resize(n + 1);
	for (int i = 1; i <= n; i++)
		getv(v[i], ns...);
}
#ifdef _WIN32
#define getchar_unlocked() _getchar_nolock()
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
inline void getch(char &x) {
	while (x = getchar_unlocked(), x < 33) {
		;
	}
}
inline void getstr(string &str) {
	str.clear();
	char cur;
	while (cur = getchar_unlocked(), cur < 33) {
		;
	}
	while (cur > 32) {
		str += cur;
		cur = getchar_unlocked();
	}
}
template<typename T> inline bool sc(T &num) {
	bool neg = 0;
	int c;
	num = 0;
	while (c = getchar_unlocked(), c < 33) {
		if (c == EOF)
			return false;
	}
	if (c == '-') {
		neg = 1;
		c = getchar_unlocked();
	}
	for (; c > 47; c = getchar_unlocked())
		num = num * 10 + c - 48;
	if (neg)
		num *= -1;
	return true;
}
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef int _I;
typedef pair<_I, _I> pi;
typedef pair<ld, ld> pd;
typedef map<_I, _I> mii;
typedef __V <_I> vi;
typedef __V <char> vc;
typedef __V <ld> vd;
typedef __V <vd> vvd;
typedef __V <pi> vpi;
typedef __V <__V<_I>> vvi;
typedef __V <__V<char>> vvc;
typedef __V <__V<pi>> vvpi;
using AntonTsypko = void;
using arsijo = AntonTsypko;
using god = arsijo;
uniform_real_distribution<double> double_dist(0, 1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());

int main() {
	doin();
	int a, b; cin >> a >> b;
	if(b%a == 0) cout << a+b;
	else cout << b-a;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
string str;
int n;
bool pre;
int main()
{
    cin >> str; 
    if(str[0]=='S')
        pre = 1;
    else
    {
        pre = 0;
    }
    int i = 1;
        while (str.size())
        {     

            while (pre)
            {
                    if (str[i] == 'T')
                    {
                        str.erase(i - 1, 2);
                        i -=1;
                        
                        if (i >= str.size())
                            break;
                        if(i-1>=0&&str[i-1]=='S')
                            pre = 1;
                            else
                                pre = 0;                            
                    }
                    else
                        break;
            }

            if (i >= str.size())
                break;
            if(str[i]=='S')
            { 
                pre = 1;
            }

            i++;
            if(i>=str.size())
                break;
    }
    cout << str.size() << endl;
   // system("pause");
}

Measured memory_bytes: 640
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
k=1
i=1
l=[]
while i<n:
    if a[i]==a[i-1]:
        l.append(a[i])
        i+=2
    else:
        i+=1
l.append(0)
l.append(0)
print(l[0]*l[1])

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, a[50];

int main() {
	cin >> n;
	inc(i, n) { cin >> a[i]; }
	
	pair<int, int> ma, mi;
	ma = mi = MP(0, 0);
	inc(i, n) {
		setmax(ma, MP(a[i], i));
		setmin(mi, MP(a[i], i));
	}
	
	cout << (n * 2 - 1) << "\n";
	if(ma.FI >= -mi.FI) {
		inc(i, n) { cout << (ma.SE + 1) << " " << (i + 1) << "\n"; }
		inc(i, n - 1) { cout << (i + 1) << " " << (i + 2) << "\n"; }
	} else {
		inc(i, n) { cout << (mi.SE + 1) << " " << (i + 1) << "\n"; }
		dec(i, n - 1) { cout << (i + 2) << " " << (i + 1) << "\n"; }
	}
	
	return 0;
}


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

int main(int argc, char const *argv[])
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	string s;

	cin>>s;	
	int len = s.length();
	int hugs = 0;
	for(int i=0,j=len-1;i<j;i++,j--){
		if(s[i]!=s[j]) hugs++;
	}

	cout<<hugs<<endl;

	return 0;
}

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

 
int c[200003];
signed main(){
  int n,k,t,maxk;
  cin>>n>>k;
  c[0]=k;
  t=1;
  maxk=k;
  
  for(int i=1;i<n;i++){
      cin>>k;
      maxk=max(maxk,k);
      if(k!= c[t-1]) {
          c[t]=k;
      t++;
      }
  }
  int dp[maxk+1]={};
    int INF =1e9+7;
  dp[c[0]]=1;
  for(int i=1;i<t;i++)dp[c[i]]=(dp[c[i]]+dp[c[i-1]])%INF;
  cout <<dp[c[t-1]];



    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
long long n, a[200100], money=1000, kabu=0;
bool checkmin(int start){
    int i;
    for(i=start+1;i<n;i++){
        if(a[start]>a[i]){
            return false;
        }
    }
    return true;
}
bool checkmax(int start){
    int i;
    for(i=start+1;i<n;i++){
        if(a[start]<a[i]){
            return false;
        }
    }
    return true;
}
bool checkminmax(int start){
    int i, minf=0, maxf=0, minidx, maxidx;
    for(i=start+1;i<n;i++){
        if(a[start]>a[i] && minf==0){
            minf=1;
            minidx=i;
        }
        if(a[start]<a[i] && maxf==0){
            maxf=1;
            maxidx=i;
        }
    }
    if(minf==1 && maxf==1 && minidx<maxidx) return true;
    else return false;
}
bool checkmaxmin(int start){
    int i, minf=0, maxf=0, minidx, maxidx;
    for(i=start+1;i<n;i++){
        if(a[start]>a[i] && minf==0){
            minf=1;
            minidx=i;
        }
        if(a[start]<a[i] && maxf==0){
            maxf=1;
            maxidx=i;
        }
    }
    if(minf==1 && maxf==1 && minidx>maxidx) return true;
    else return false;
}
int main(){
    int i, j;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    for(i=0;i<n;i++){
        if(i==n-1){
            money+=kabu*a[i];
            kabu=0;
        }
        else if(checkmin(i)){
            kabu+=money/a[i];
            money=money%a[i];
            }
        else if(checkmax(i)){
            money+=kabu*a[i];
            kabu=0;
        }
        else if(checkminmax(i)){
            money+=kabu*a[i];
            kabu=0;
        }
        else if(checkmaxmin(i)){
            kabu+=money/a[i];
            money=money%a[i];
        }
    }
    money+=kabu*a[i-1];
    kabu=0;
    cout << money << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;


using namespace std;

#define debug(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(int i=0;i<(int)(n);i++)
#define foi(i,k,n) for(int i=(k); i<(int)(n); i+=1)
#define fod(i,n,k) for(int i=k; i>=(int)n; i-=1)
#define fast_io ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define endl "\n"

#define int long long
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

#define fir first
#define sec second
#define pb push_back
#define mp make_pair

typedef long long llint;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<llint> VL;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MII;
typedef set<int> SI;
string tostr(int n) {stringstream rr;rr<<n;return rr.str();}
llint toint(string s) {stringstream ss(s); llint x; ss >> x; return x;}
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//gp_hash_table<string, llint> table;


//int mpow(llint base, llint exp) {
  //base %= MOD;
  //llint result = 1;
  //while (exp > 0) {
    //if (exp & 1) result = ((llint)result * base) % MOD;
    //base = ((llint)base * base) % MOD;
    //exp >>= 1;
  //}
  //return result;
//}


//void makegraph(int n, int m){
	//int i, u, v;
	//while(m--){
		//cin>>u>>v;
		//u--, v--;
		//g[u].pb(v);
		//g[v].pb(u);
	//}
//}

//void dfs(int u, int par){
	//for(int v:g[u]){
		//if (v == par) continue;
		//dfs(v, u);
	//}
//}


// ------------------------------------------------------------------ILB----------------------------------------------------------------  //



void solve(){
	int x;
	cin >> x;
	cout << (x >= 30 ? "Yes" : "No");
}




int32_t main() {
	fast_io;
    int t = 1;
    //cin >> t;
    //int xx = 0
    while(t--) {
		//xx++;
		//cout << "Case ";
      solve();
    }
    return 0;
}



Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<queue>
#include<map>
#include<utility>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
ll path[100005];
bool visited[100005];
vector<ll>adj[100005];
queue<ll>q;
int main()
{
    ll n,m,i;
    cin>>n>>m;
    ll x,y;
    bool flag=false;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        adj[x].pb(y);
        adj[y].pb(x);
        if(x==1||y==1)
            flag=true;
    }
    if(!flag)
    {
        cout<<"No";
        return 0;
    }
    q.push(1);
    while(q.size())
    {
        x=q.front();
        q.pop();
        if(!visited[x])
        {
            visited[x]=1;
            for(i=0;i<adj[x].size();i++)
            {
                q.push(adj[x][i]);
                if(!path[adj[x][i]])
                    path[adj[x][i]]=x;
            }
        }

    }
    cout<<"Yes\n";
    for(i=2;i<=n;i++)
    {
        cout<<path[i]<<endl;
    }

    return 0;
}




Measured memory_bytes: 14608
n = int(input())
li = []
lia = []
ans = 0
f = 1
li.insert(0,"0")
for i in range(n):
    li.append(input())
li.sort()
for i in range(n):
    if li[i] == li[i+1]:
        f += 1
    else:
        f = 1
    if f == ans:
        lia.append(li[i+1])
    if f > ans:
        lia = []
        ans = f
        lia.append(li[i+1])
for i in range(len(lia)):
    print(lia[i])

Measured memory_bytes: 83160
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<string,int>;
using T = tuple<string,int,int>;

int main(){
  string s; cin >> s;
  bool flg = true;
  char temp = s[0];
  for(int i = 1; i < 4; i++){
    if(s[i] == temp) flg = false;
    temp = s[i];
  }
  if(flg) cout << "Good" << endl;
  else cout << "Bad" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_poizcy.hpp>
typedef long long  ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define mem(a,h)          memset(a, (h), sizeof(a))
#define se second
#define fi first
#define por(a,b) (((a%MOD) * (b%MOD))%MOD)
#define forg(i, b, e, c)    for (ll i = (ll)b; i < (ll)e; i+=c)
#define forr(i, b, e)    for (ll i = b; i < e; i++)
 
 
using namespace std;
//using namespace __gnu_pbds;
typedef double lldb;
typedef pair<ll, ll>  ii;
typedef pair<ll, ii>  iii;
typedef pair<double, double>  iidb;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = 1e9+7;
const double PI = acos(-1);
#define initseg ll new_nodo=(pnodo*2),mid=(iz+der)/2;
 
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define tam 600020
#define offset 3000
#define ptr nodo*
const ll MOD=998288383;

using namespace std;
const ll inf=1e18;
const ll cmplog=19;
int v[tam],n;
int dp[tam][3];
int f(int pos,int turno)
{
	if (dp[pos][turno]!=-1)
		return dp[pos][turno];
	int res=abs(v[pos]-v[n]);
	forr(j,pos+1,n)
	{
		if (turno)res=max(res,f(j,!turno));
		else res=min(res,f(j,!turno));
	}
	//cout<<res<<' ';

	return dp[pos][turno]=res;
}
int main()
{	
	ios::sync_with_stdio(false);cin.tie(0);
	memset(dp,-1,sizeof dp);
	int algo;
	cin>>n;
	cin>>algo>>v[0];
	forr(i,1,n+1)
	{
		cin>>v[i];
	}
	cout<<f(0,1)<<endl;
}

Measured memory_bytes: 10684
#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=a;i<=n;++i)
#define lpd(i,a,n) for(int i=a;i>=n;--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-8
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

const int N = 104;
int n,a[N];
ll sum;

struct Edge {
  int from, to;
  ll cap;
  ll flow;
  int index;
  Edge(int from, int to, ll cap, ll flow, int index) :
    from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct Dinic {
  int N;
  vector<vector<Edge>> G;
  vector<Edge *> dad;
  vi Q;

  Dinic(int N) : N(N), G(N), dad(N), Q(N) {}

  void AddEdge(int from, int to, ll cap) {
    G[from].push_back(Edge(from, to, cap, 0, G[to].size()));
    if (from == to) G[from].back().index++;
    G[to].push_back(Edge(to, from, 0, 0, G[from].size() - 1));
  }

  long long BlockingFlow(int s, int t) {
    fill(dad.begin(), dad.end(), (Edge *) NULL);
    dad[s] = &G[0][0] - 1;

    int head = 0, tail = 0;
    Q[tail++] = s;
    while (head < tail) {
      int x = Q[head++];
      for (int i = 0; i < sz(G[x]); i++) {
        Edge &e = G[x][i];
        if (!dad[e.to] && e.cap - e.flow > 0) {
          dad[e.to] = &G[x][i];
          Q[tail++] = e.to;
        }
      }
    }
    if (!dad[t]) return 0;

    ll totflow = 0;
    for (int i = 0; i < sz(G[t]); i++) {
      Edge *start = &G[G[t][i].to][G[t][i].index];
      ll amt = infll;
      for (Edge *e = start; amt && e != dad[s]; e = dad[e->from]) {
        if (!e) { amt = 0; break; }
        amt = min(amt, e->cap - e->flow);
      }
      if (amt == 0) continue;
      for (Edge *e = start; amt && e != dad[s]; e = dad[e->from]) {
        e->flow += amt;
        G[e->to][e->index].flow -= amt;
      }
      totflow += amt;
    }
    return totflow;
  }

  ll GetMaxFlow(int s, int t) {
    ll totflow = 0;
    while(ll flow = BlockingFlow(s, t))
      totflow += flow;
    return totflow;
  }
};

int main(){
    readi(n);
    lp(i,1,n) readi(a[i]), sum += a[i] * (a[i] > 0);

    Dinic dinic(n+2);
    lp(i,1,n){
        if(a[i] < 0) dinic.AddEdge(0, i, -a[i]);
        if(a[i] > 0) dinic.AddEdge(i, n+1, a[i]);
    }

    lp(i,1,n) for(int j = 2*i; j <= n; j += i)
        dinic.AddEdge(i, j, 1e12);

    cout <<sum - dinic.GetMaxFlow(0, n+1);
}

/*
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
*/


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

K, T = map(int, raw_input().split())
a = map(int, raw_input().split())

A = [[-ai, i] for i, ai in enumerate(a)]
heapq.heapify(A)
ans = 0
b = -1
for i in xrange(K):
    t = heapq.heappop(A)
    if t[1] == b and A:
        u = heapq.heappop(A)
        if u[0] < -1:
            heapq.heappush(A, [u[0] + 1, u[1]])
        b = u[1]
        heapq.heappush(A, t)
    else:
        if t[1] == b:
            ans += 1
        if t[0] < -1:
            heapq.heappush(A, [t[0] + 1, t[1]])
        b = t[1]
print ans


Measured memory_bytes: 4520