akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef vector<int> veci;

int main()
{
    int n;
    cin >> n;
    string x = "Three";
    rep(i,n){
        char s;
        cin >> s;
        if(s=='Y'){
            x = "Four";
            break;
        }
    }
    cout << x << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define prArr(a) {cerr<<(#a)<<"={";int i=0;for(auto t:(a))cerr<<(i++?", ":"")<<t;cerr<<"}"<<endl;}
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){
  return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
//INSERT ABOVE HERE

vector<int> X, Y;

int getCost(int x, int y, int a, int b, int p, int q){
  return !(a - p == x && b - q == y);
}


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);


  int N;
  cin>>N;
  X.resize(N);
  Y.resize(N);
  for(int i=0;i<N;i++) cin>>X[i]>>Y[i];

  map<P, int> cnt;
  for(int i=0;i<N;i++)
    for(int j=0;j<N;j++){
      if(i == j) continue;
      int p = X[i] - X[j];
      int q = Y[i] - Y[j];
      cnt[P(p, q)]++;
    }
  
  int mx = 0;
  for(auto p:cnt) Max(mx, p.second);
  int ans = N - mx;
  if(N == 1) cout<<1<<endl;
  else cout<<ans<<endl;
  


  return 0;
}


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

int main() {
	std::string days[7] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
	string day;
	cin >> day;
	for (int i = 0; i < 7; i++) {
		if (day == days[i]) {
			cout << 7 - i;
		};
	};
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int N;cin >> N;
  ll X[N];
  ll Y[N];
  rep(i,N){
    int x;cin >> x;
    X[i] = x;
    Y[i] = x;
  }
  sort(Y,Y+N);
  rep(i,N){
    if(X[i] >= Y[N/2]) cout << Y[N/2-1] << endl;
    else cout << Y[N/2] << endl;
  }
  return 0;
}


Measured memory_bytes: 5376
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break
 
    mf = m + f
    if m == -1 or f == -1 or mf < 30:
        print('F')
    elif mf < 50 and r < 50:
        print('D')
    elif mf < 65:
        print('C')
    elif mf < 80:
        print('B')
    else:
        print('A')

Measured memory_bytes: 6724
module T = struct
  type tree = Nil | Node of int * tree * tree

  let create () = Nil

  let insert x t =
    let rec doit = function
      | Nil -> Node (x, Nil, Nil)
      | (Node (y, _, _)) as d when x = y -> d
      | Node (y, l, r) when x < y -> Node (y, doit l, r)
      | Node (y, l, r) -> Node (y, l, doit r)
    in
    doit t

  let preorder f t =
    let rec doit = function
      | Nil -> ()
      | Node (x, l, r) -> (f x; doit l; doit r)
    in
    doit t

  let inorder f t =
    let rec doit = function
      | Nil -> ()
      | Node (x, l, r) -> (doit l; f x; doit r)
    in
    doit t
end

let print t =
  let f e = print_string " "; print_int e in
  T.inorder f t;
  print_newline ();
  T.preorder f t;
  print_newline ()

let split str delim =
  let rec doit s acc =
    match
      try Some (String.rindex s delim) with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s1 (s2 :: acc)
  in
  doit str []

let () =
  let m = read_int () in
  let rec read i t =
    if i < m then begin
      match split (read_line ()) ' ' with
      | ["insert"; n] -> read (i + 1) (T.insert (int_of_string n) t)
      | _ -> (print t; read (i + 1) t)
    end
  in
  read 0 (T.create ())

Measured memory_bytes: 31720
import java.util.*;


public class Main{

	public static void main(String[] a) {
		Scanner scan = new Scanner(System.in);
		int[] x=new int[10];
		int temp;
		for(int i=0;i<x.length;i++){
		x[i]=scan.nextInt();
		}
		for(int i=0;i<x.length;i++){
			for(int j=0;j<x.length;j++){
				if(x[i]>x[j]){
					temp=x[i];
					x[i]=x[j];
					x[j]=temp;
				}
			}
		}
		System.out.println(x[0]);
		System.out.println(x[1]);
		System.out.println(x[2]);

	}

}

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

#define ll long long
#define endl '\n'
#define REP(i, a, n) for(int i=a; i<n; ++i)
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const double PI = 3.141592653589793238460;
const ll mod = 1e9 + 7;

void FAST(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

int main(){
  FAST();

  int r, d, xi;
  cin >> r >> d >> xi;

  REP(i, 2001, 2011){
    cout << r * xi - d << endl;
    xi = r * xi - d;
  }

  return 0;
}


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

int main(){
    int a,b,c;

    cin >> a >> b >> c;
    if (a > b){
        swap (a, b);
    }
    if(b > c){
        swap (b, c);
    }
    if(a > b){
        swap (a, b);
    }
    cout << a << " " << b << " " << c << endl;
    return 0;
}


Measured memory_bytes: 3084
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N, M, X, Y;
	cin >> N >> M >> X >> Y;
	int A[110];
	int B[110];
	rep(i, N) cin >> A[i];
	rep(i, M) cin >> B[i];
	sort(A, A + N);
	sort(B, B + M);
	if (A[N - 1] >= B[0] || A[N - 1] >= Y || B[0] <= X) {
		cout << "War" << endl;
	}
	else {
		cout << "No War" << endl;
	}

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <set>
#include <cmath>
#include <string>
//
using namespace std;
//
#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
//

int main(){
    int h1, w1;
    cin >> h1 >> w1;

    vector<vector<int> > a(h1, vector<int>(w1, 0));
    vector<vector<int> > b(h1, vector<int>(w1, 0));
    rep(i, h1){
        rep(j, w1){
            int tmp;
            cin >> tmp;
            a[i][j] = tmp;
        }
    }
    rep(i, h1){
        rep(j, w1){
            int tmp;
            cin >> tmp;
            b[i][j] = tmp;
        }
    }
       
    int h2, w2;
    cin >> h2 >> w2;

    vector<vector<int> > c(h2, vector<int>(w2, 0));
    rep(i, h2){
        rep(j, w2){
            int tmp;
            cin >> tmp;
            c[i][j] = tmp;
        }
    }
    
    int maxc = -10000000;
    rep(i, h1-h2+1){
        rep(j, w1-w2+1){
            int res = 0;
            bool f = true;
            rep(k, h2){
                rep(l, w2){
                    if (b[i + k][j + l] != c[k][l]){
                        f = false;
                        break;
                    }
                    res += a[i + k][j + l];
                }
                if (!f) break;
            }
            if (!f)continue;
            if (maxc < res) maxc = res;
        }
    }
    
    if (maxc == -10000000) cout << "NA" << endl;
    else cout << maxc << endl;
}


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

int main() {
  int N, T, A;
  cin >> N;
  cin >> T >> A;

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

  double sub = 1000.001;
  int res;
  for (int i = 0; i < N; i++) {
    if (A > T - H.at(i) * 0.006) {
      if (sub > A - T + H.at(i) * 0.006) {
        sub = A - T + H.at(i) * 0.006;
        res = i;
      }
    }
    
    else {
      if ( T - H.at(i) * 0.006 - A < sub) {
        sub = T - H.at(i) * 0.006 - A;
        res = i;
      }
    }
  }

  cout << res + 1 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, k ;
    cin >> n >> k;
    ll a[n], f[n];
    for(int i=0;i<n;i++){
    	cin >> a[i];
    }
    for(int i=0;i<n;i++){
    	cin >> f[i];
    }
    sort(a,a+n);
    sort(f,f+n);
    reverse(f, f+n);
    ll le = -1LL, ri = INF, mid;
    while(ri - le > 1LL){
    	mid = (ri + le) / 2LL;
    	ll num = 0;
    	for(int i=0;i<n;i++){
    		num += max(0LL, a[i] - mid / f[i]);
    		/*if(mid % f[i] == 0LL){
    			num += max(0LL, a[i] - mid / f[i]);
    		}else{
    			num += max(0LL, a[i] - (mid / f[i]) - 1LL);
    		}*/
    	}
    	if(num <= k) ri = mid;
    	else le = mid;
    }
    cout << ri << endl;
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i = (begin); i < (end); i++)
#define rep(i, n) FOR(i, 0, n)
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>;
template<typename T, typename U> static void chmin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void chmax(T &x, U y) { if (x < y) x = y; }

signed main() {
    int x[5];
    rep(i, 5) cin>>x[i];
    rep(i, 5) {
        if (x[i] == 0) cout<<(i+1);
    }
    return 0;
}

Measured memory_bytes: 3640
// JOI 2016 Q3 Refreshment Area - C++

#include <iostream>
using namespace std;

int main()
{

	int N, M, D, pos, ans = 0, cnt = 0;
	char MAP[101][101];

	// ??±?\??????????????????°??¨?????????????????????????????°??\???
	cin >> N >> M >> D;

	// ???????????\???
	for(int i = 0; i < N; i++) cin >> MAP[i];

	// ??¢?´¢????§?
	for(int i = 0; i < N; i++) {
		for(int j = 0; j < M; j++) {
			// ??????????¨??????????????????\??????????????????????????????????????´??????
			// ??¢?´¢???????????????????????????
			if(D <= M) {
				// ??¢?´¢????§????????????\??????
				pos = j;
				// ??±(???)???????????¢?´¢?????????????????????????????????????§?????????????
				// ????????????(#)??????????????????????????????????????????????????´?????????
				// break
				for(cnt = 0; cnt < D; cnt++) {
					if(MAP[i][pos] == '#' || pos >= M) break;
					pos++;
				}
				// ??????????????????????§?????????§????????°????????????
				if(cnt == D) ans++;
			}
			// ?????£????????????????????????
			if(D <= N) {
				pos = i;
				for(cnt = 0; cnt < D; cnt++) {
					if(MAP[pos][j] == '#' || pos >= N) break;
					pos++;
				}
				if(cnt == D) ans++;
			}
		}
	}

	// ???????????????????????°?????????
	cout << ans << endl;

	return 0;

}

Measured memory_bytes: 3116
from fractions import gcd

# 入力
A, B, C, D = map(int, input().split())


# CまたはDで割り切れる数を求め、それを差し引いて求める
def f(x):
    return x - (x // C + x // D - x // (C * D // gcd(C, D)))


ans = f(B) - f(A - 1)

# 出力
print(ans)


Measured memory_bytes: 5596
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int sub = 1000000007;

int main(){
  int N;
  cin >> N;
  vector<int> A,B;
  if(N%2 == 1){
    for(int i=0;i<N;i++){
      B.push_back((i+1) / 2 * 2);
    }
  }else{
    for(int i=0;i<N;i++){
      B.push_back((i / 2 * 2) + 1);
    }
  }
  for(int i=0;i<N;i++){
    int tmp;
    cin >> tmp;
    A.push_back(tmp);
  }
  sort(A.begin(),A.end());
  for(int i=0;i<N;i++){
    if(A[i] != B[i]){
      cout << 0 << endl;
      return 0;
    }
  }
  int ans = 1;
  for(int i=0;i<N/2;i++){
    ans = ans%sub * 2;
  }
  cout << ans%sub << endl;

  return 0;
}

Measured memory_bytes: 1400
#include <stdio.h>
#include <iostream> 
#include <algorithm>
#include <bits/stdc++.h>
 
using namespace std; 
typedef long long ll;
 
#define umap unordered_map
#define f first
#define s second
 
#define for0(i, a, b) for (int i = (a); i < (b); i++)
#define for1(i, a) for (int i = 0; i < (a); i++)
#define ford(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define fordd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)
#define rep(i,a,b) for (int i = a; i < b; i++)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define sstr substr
typedef vector<int> vi;
typedef vector<string> vis;
typedef unordered_map<string, int> umap; 

 
int main()
{   
    ll item;
    cin >> item;
    
    ll totalweight;
    cin >> totalweight;
    vector< pair <ll,ll> > vect; 
    ll temp1;
    ll temp2;
    
    for0(i, 0 , item){
        cin >> temp1;
        cin >> temp2;
        vect.push_back( make_pair( temp1, temp2) );
    }
    sort(vect.begin(), vect.end()); 
    // trav(x, vect){
    //     cout<<x.first << " "<<x.second<<endl;
    // }
    
    ll maxweight = totalweight + 1;
    
    ll dp[2][totalweight + 1] = {0};
    
    for0(i,0, 2){
        for0(j,0, totalweight+1){
            dp[i][j] = 0 ;
        }
    }
    
    
    // trav( x, dp){
    //     trav( y , x){
    //         cout<< y<< " ";
    //     }
    //     cout<<endl;
    // }
    
    
    
    
    for0(i , 0 , item){
        ll currentweight = vect[i].first;
        ll currentvalue = vect[i].second;
        
        if ( i == 0 ){ 
            for0(j, currentweight, maxweight + 1){
                dp[0][j] = currentvalue;
                continue;
            }
            continue;
        }
        
        if ( (i & 1) == 1 ) {
            for0(j, 0, currentweight){
                dp[1][j] = dp[0][j];
            }
        
            for0(j, currentweight, maxweight + 1 ){
                dp[1][j] = max(dp[0][j], currentvalue + dp[0][j - currentweight]);
            }
            continue;
        }
        
        if ( (i & 1) == 0 ) {
            for0(j, 0, currentweight){
                dp[0][j] = dp[1][j];
            }
        
            for0(j, currentweight, maxweight + 1 ){
                dp[0][j] = max(dp[1][j], currentvalue + dp[1][j - currentweight]);
            }
            continue;
        }
        
        
        
        
    }
    
    // trav( x, dp){
    //     trav( y , x){
    //         cout<< y<< " ";
    //     }
    //     cout<<endl;
    // }
    ll getmaxval = max(dp[0][totalweight], dp[1][totalweight]);
    
    cout<<getmaxval;
    
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

string a[11111];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	string s; cin>>s;
	int l = 0;
	int r = 0;
	int m = 0;
	for(int i = 0; i < n; i++)
	{
		string tmp = a[i];
		for(int j = 0; j < a[i].length(); j++)
		{
			if(a[i][j]=='?') tmp[j]='a';
		}
		bool L,R;
		L=0;R=0;
		if(tmp==s)
		{
			m++;
			continue;
		}
		else if(tmp<s)
		{
			L=true;
		}
		else
		{
			R=true;
		}
		tmp = a[i];
		for(int j = 0; j < a[i].length(); j++)
		{
			if(a[i][j]=='?') tmp[j]='z';
		}
		if(tmp==s)
		{
			m++;
			continue;
		}
		else if(tmp<s)
		{
			L=true;
		}
		else
		{
			R=true;
		}
		if(L&&R)
		{
			m++;
		}
		else if(L)
		{
			l++;
		}
		else
		{
			r++;
		}
	}
	for(int i = l; i <= l + m; i++)
	{
		cout<<i+1;
		if(i<l+m) cout<<' ';
	}
	cout<<'\n';
}


Measured memory_bytes: 896
#include<cstdio>
#include<iostream>
using namespace std;
long long n,a,b;
int main()
{
	cin>>n>>a>>b;
	if (a>b)   cout<<"0";
	else if (n==1)
	{
		if(a==b)  cout<<"1";
		else      cout<<"0";
	}
	else   cout<<(n-2)*(b-a)+1;
	return 0;
}

Measured memory_bytes: 256
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void) {
    int n;
    cin >> n;
    map<string, int> freq;
    REP(i,n) {
        string s;
        cin >> s;
        freq[s] ++;
    }
    cout << freq.size() << endl;
    return 0;
}

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

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

  if (s.at(0)=='R' && s.at(1)=='R' &&s.at(2)=='R') {
    cout << 3 << endl;
  }
  else if (s.at(0)=='R' && s.at(1)=='R' || s.at(1)=='R' && s.at(2)=='R') {
    cout << 2 << endl;
  }
  else if (s.at(0)=='R' || s.at(1)=='R' || s.at(2)=='R') {
    cout << 1 << endl;
  }
  else cout << 0 << endl;
}

Measured memory_bytes: 3596
def Sol(taka_health,taka_stregnth,aoki_health,aoki_stregnth):
    
    if taka_health%aoki_stregnth != 0:
        moves_taka = int(taka_health/aoki_stregnth) + 1
    else:
        moves_taka = int(taka_health/aoki_stregnth)
    
    if aoki_health%taka_stregnth != 0:
        moves_aoki =int(aoki_health/taka_stregnth) + 1
    else:
        moves_aoki = int(aoki_health/taka_stregnth)
    
    if moves_taka >= moves_aoki:
        print("Yes")
    else:
        print("No")
    return

    

#for t in range(int(input())):
n,k,d,c = map(int,input().split())
#n = int(input())
#arr = []
#for i in range(n):
#    time = list(map(int,input().split()))
#    time = time[0] + (time[1]/60)
#    arr.append(time)
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(n,k,d,c)


Measured memory_bytes: 61836
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 1000000007; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;

int N; 
int memo[101][4][4][4];
bool ok(string s){
  if(s[1] == 'A' && s[2] == 'G' && s[3] == 'C') return false;
  if(s[0] == 'A' && s[2] == 'G' && s[3] == 'C') return false;
  if(s[0] == 'A' && s[1] == 'G' && s[3] == 'C') return false;
  if(s[2] == 'A' && s[1] == 'G' && s[3] == 'C') return false;
  if(s[1] == 'A' && s[3] == 'G' && s[2] == 'C') return false;
  return true;
}

int h(char s){
  if(s == 'A') return 0;
  if(s == 'G') return 1;
  if(s == 'C') return 2;
  return 3;
}
void g(int cur, string s, int ret){
  memo[cur][h(s[0])][h(s[1])][h(s[2])] = ret;
}
int f(int cur, string s){
  return memo[cur][h(s[0])][h(s[1])][h(s[2])];
}

int dfs(int cur, string last3){
  if(f(cur, last3) != INF) return f(cur, last3);
  if(cur == N){
    return 1;
  }
  int ret = 0;
  string A[] = {"A", "C", "G", "T"};
  for(string c : A){
    if(ok(last3+c)){
      ret = (ret+dfs(cur+1, (last3.substr(1)+c)))%MOD;
    }
  }
  g(cur, last3, ret);
  return ret;
}

signed main() {
  cin >> N;

  REP(i, 101) REP(j, 4) REP(k, 4) REP(l, 4){
    memo[i][j][k][l] = INF;
  }

  cout << dfs(0, "TTT") << endl;

  return 0;
}

Measured memory_bytes: 384
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
  ll n;double m;
  cin>>n>>m;
  ll d=round(m*100);
  n*=d;
  cout<<n/100<<"\n";
}


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

#define all(v) v.begin(), v.end()
#define V vector
#define P pair
typedef long long ll;
const int MOD = 1000000007;

int main() {
    int N; cin >> N;
    vector<long long> A(N);
    for (int i = 0; i < N; ++i) cin >> A[i];

    long long res = 0;
    long long two_factor = 1;
    for (int d = 0; d < 60; ++d) {
        long long even = 0, odd = 0;
        for (int i = 0; i < N; ++i) {
            if (A[i] & (1LL<<d)) ++odd;
            else ++even;
        }
        long long add = (odd * even) % MOD * two_factor % MOD;
        res = (res + add) % MOD;
        two_factor = (two_factor * 2) % MOD;
    }
    cout << res << endl;
}


Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
const LL mod = 1e9 + 7;
int d[66];

LL dp[66][2][2];
LL cal(int bit)
{
    dp[0][0][0] = 1;
    for(int i = 1; i <= bit; i++)
    for(int p = 0; p <= 1; p++)
    for(int q = 0; q <= 1; q++)
    for(int a = 0; a <= 1; a++)
    for(int b = a; b <= 1; b++)
    {
        if(!dp[i-1][p][q]) continue;
        int nq = a + b + q > 1 ? 1 : 0;
        int now = (a + b + q) % 2;
        int np = (now > d[i] || p && now == d[i]) ? 1 : 0;
        dp[i][np][nq] = (dp[i][np][nq] + dp[i-1][p][q]) % mod;
    }
    return dp[bit][0][0];
}

int main(void)
{
    LL N, tmp;
    scanf("%lld", &N), tmp = N;
    int bit = 0;
    while(tmp) d[++bit] = tmp % 2, tmp /= 2;
    printf("%lld\n", cal(bit));
    return 0;
}


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

int main(){

  int k,s;
  int i,j,p;
  int cnt = 0;

  scanf("%d %d", &k, &s);

  for(i = 0;i <= k;i++){
    for(j = 0;j <= k;j++){
        if(0 <= s - (i + j) && s - (i + j) <= k) cnt++;
    }
  }

  printf("%d\n", cnt);

  return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main(){
  int n;
  cin >> n;
  vi a(n),mn(n),mx(n);
  REP(i,n) cin >> a[i];
  mn[0] = a[0];
  REP(i,n-1){
    mn[i+1] = min(mn[i],a[i+1]);
  }
  mx[n-1] = a[n-1];
  RREP(i,n-1){
    mx[i] = max(mx[i+1],a[i]);
  }
  int ans = -INT_MAX;
  RREP(i,n-1){
    ans = max(ans,mx[i+1]-mn[i]);
  }
  cout << ans << endl;
}



Measured memory_bytes: 7552
n,k=map(int,input().split())
l=[int(x) for x in input().split()]
dp=[0]*n
dp[0]=0
for i in range(1,n):
    m=10**20
    if i-k<=0:
        for j in range(i):
            t=dp[j]+abs(l[i]-l[j])
            m=min(t,m)
    else:
        for j in range(i-1,i-k-1,-1):
            t=dp[j]+abs(l[i]-l[j])
            m=min(t,m)
    dp[i]=m
print(dp[n-1])

Measured memory_bytes: 84332
import java.math.BigDecimal
import java.util.*

val mod: Long = (Math.pow(10.0, 9.0) + 7).toLong()

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextLong()
    val aList = mutableListOf<Long>()
    for (i in 0 until n) {
        aList.add(sc.nextLong())
    }
    var bList = mutableListOf<Long>()
    for (i in 1..n / 2) {
        bList.add(n - i * 2 + 1)
    }
    val reversed = bList.reversed().toMutableList()
    if (n % 2 != 0L) {
        reversed.add(0, 0)
    }
    bList = (bList + reversed).toMutableList()
    if (aList.sorted() != bList.sorted()) {
        println(0)
        return
    }
    val ans = BigDecimal.valueOf(2)
        .pow( (n / 2).toInt())
        .remainder(BigDecimal(mod))
    println(ans.toLong())
}


Measured memory_bytes: 56616
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<tuple>


#define MOD 1000000007
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back

using namespace std;

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

int main(){
    int N;
    cin>>N;
    vector <long long> A(N);
    bool plus=false,minus=false,zero=false;

    rep(i,0,N){
        cin>>A[i];
        if(A[i]==0) zero=true;
        else if(A[i]<0) minus=true;
        else plus=true;
    }

    sort(A.begin(),A.end());

    long long sum=0;
    if(minus&&plus){
        rep(i,0,N){
            sum+=abs(A[i]);
        }
        cout<<sum<<endl;
        long long a=A[N-1],b=A[0];
        rep(i,1,N-1){
            if(A[i]<=0){
                cout<<a<<" "<<A[i]<<endl;
                a=a-A[i];
            }
            else if(A[i]>0){
                cout<<b<<" "<<A[i]<<endl;
                b=b-A[i];
        }
    }
    cout<<a<<" "<<b<<endl;

    }
    else if(plus){
        rep(i,0,N)sum+=A[i];
        cout<<sum-2*A[0]<<endl;
        long long b=A[0]-A[1];
        cout<<A[0]<<" "<<A[1]<<endl;
        if(N>=3){
            rep(i,2,N-1){
                cout<<b<<" "<<A[i]<<endl;
                b-=A[i];
           }
           cout<<A[N-1]<<" "<<b<<endl;
        }
    }
    else{
        rep(i,0,N)sum+=abs(A[i]);
        cout<<sum-abs(2*A[N-1])<<endl;

        long long b=A[N-1]-A[N-2];
        cout<<A[N-1]<<" "<<A[N-2]<<endl;
        if(N>=3){
            rep(i,1,N-2){
                cout<<b<<" "<<A[i]<<endl;
                b-=A[i];
            }
            cout<<b<<" "<<A[0]<<endl;
        }
    }


    return 0;
}

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

namespace AtCoder
{

    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var s = GetIntArray();
            var ans = s[0] <= s[1] ? s[0] : s[0] - 1;

            Console.Write(ans);
        }



        static public string GetStr() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;



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

	int n, i, j, k, ans;
	cin >> n;
	vector<int> a(n);
	for (i = 0; i < n; i++) cin >> a[i];
	ans = 0;
	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			for (k = j + 1; k < n; k++) {
				if (a[i] == a[j]) continue;
				if (a[k] == a[j]) continue;
				if (a[k] == a[i]) continue;

				if (a[i] + a[j] <= a[k]) continue;
				if (a[k] + a[j] <= a[i]) continue;
				if (a[i] + a[k] <= a[j]) continue;
				ans++;
				//cout << a[i] << " " << a[j] << " " << a[k] << "\n";
			}
		}
	}
	cout << ans << "\n";

	return 0;
}


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

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> count(n, 0);
    for (int i=0; i<n; i++) {
        for (int j=i+1; j<n; j++) {
            if (i<x) {
                if (j>=y-1) {
                    count.at((j-i) - (y-x) + 1)++;
                }
                else {
                    count.at(min(((y-1)-j)+((x-1)-i)+1,j-i))++;
                }
            }
            else {
                if (j>=y-1) {
                    count.at(min((j-(y-1))+(i-(x-1))+1,j-i))++;
                }
                else {
                    count.at(min(((y-1)-j)+(i-(x-1))+1,j-i))++;
                }
            }
        }
    }
    for (int i=1; i<n; i++) {
        cout << count.at(i) << endl;
    }
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstring>
#include<map>
#include<vector>
#include<set>
#define rep(i,j,k) for(register int i = j; i <= k; i++) 
#define dow(i,j,k) for(register int i = j; i >= k; i--)
//#define fi first
//#define se second
//#define P pair<int,int>
//#define PP pair<int,pair<int,int> >
//#define mp(a,b) make_pair(a,b)
#define ll long long
#define ull unsigned long long
using namespace std;
 
inline ll read() { 
	ll s = 0, t = 1; char c = getchar();
	while( !isdigit(c) ) { if( c == '-' ) t = -1; c = getchar(); }
	while( isdigit(c) ) s = s * 10 + c - 48, c = getchar();
	return s * t;
}
 
const int N = 1e5+5; 
ll f[N], g[N], h[N], ans[N]; int n, a[N];
struct node{ 
	int a[N], b[N];
} A, B, C; 

inline node operator * (const node&a,const node&b) { 
	rep(i,1,n-1) C.a[a.b[i]] = b.a[i];
	rep(i,1,n-1) C.b[C.a[i]] = i;
	return C;
} 

inline void out(const node&a) { 
	rep(i,1,n-1) cout<<a.a[i]<<" "; cout<<endl;
	rep(i,1,n-1) cout<<a.b[i]<<" "; cout<<endl;
}
 
int main() {
	n = read();
	rep(i,1,n) f[i] = read();
	rep(i,1,n-1) g[i] = f[i+1] - f[i];
	int m = read(); ll k = read();
	
	int x;
	rep(i,1,n-1) a[i] = i, B.a[i] = B.b[i] = i; 
	rep(i,1,m) { 
		x = read();
		swap(a[x-1],a[x]);
	}
	rep(i,1,n-1) A.a[a[i]] = i;
	rep(i,1,n-1) A.b[A.a[i]] = i;
//	out(A);
//	out(B);
	while( k ) { 
		if( k & 1 ) B = B * A;
		A = A * A, k >>= 1;
	}
	rep(i,1,n-1) h[B.a[i]] = g[i];
	ans[1] = f[1];
	rep(i,2,n) ans[i] = ans[i-1] + h[i-1];
	rep(i,1,n) printf("%lld\n", ans[i]);
	return 0; 
}

Measured memory_bytes: 8704
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define f0(i,a,b) for(int i=a;i<b;i++)
#define f1(i,a,b) for(int i=a;i<=b;i++)
#define f2(i,a,b) for(int i=a;i>b;i--)
#define f3(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define int long long
#define fi first
#define se second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test int t;cin>>t;while(t--)

signed main(){
    fast

  string s;
    cin>>s;
    int n=s.length();
    cout<<s;
    if(s[n-1]=='s')cout<<"es";
    else cout<<"s";
}

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

int main()
{
    int N;
    cin >> N;
    deque<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    while(A.size() > 1)
    {
        int tmp;
        tmp = A.back() % A.front();
        A.pop_back();
        if(tmp != 0) A.push_front(tmp);
    }
    cout << A[0] << endl;

return 0;
}

Measured memory_bytes: 640
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
 
using ull = unsigned long long int;
using ll = long long int;
using du = double;
using ld = long du;
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;
using vdu = vector<du>;
using vs = vector<string>;
using vc = vector<char>;
using si = set<int>;
using sll = set<ll>;
using sdu = set<du>;
using sld = set<ld>;
using pii = pair<int, int>;
using pll = pair<ll,ll>;
using pdu = pair<du,du>;
using pld = pair<ld,ld>;
using pis = pair<int,string>;
 
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define sp(x) setprecision(x)<<fixed
#define loop(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pi acos(-1)
#define meme(a,x) memset(a,x,sizeof(a))
#define all(a) a.begin(),a.end()
 
//debugger
 
#ifdef KAIZER
#include "debug.h"
#else
#define debug(x...)
#endif
//debugger
 
//functions
bool check_pow(ll a)
{
    if((a&(a-1))==0) return true;
    else return false;
}
ld my_pow(ld a,int b)
{
    ld ans=1;
    for(int i=0;i<b;i++) ans*=a;
    return ans;
}
ll digits(ll a)
{
    string line=to_string(a);
    return line.size();
}
bool prime_check(ll a)
{
    bool flag=true;
    for(ll i=2;i<=sqrt(a);i++)
    {
        if(a%i==0) {flag=false; break;}
    }
    return flag;
}
bool comp(const pair<int,int> &a , const pair<int,int> &b)
{
    if(a.ff!=b.ff) return a.ff>b.ff;
    else return a.ss<b.ss;
}
bool comp2(const ll &a, const ll &b)
{
     return a>b;
}
 
//functions

int main() {
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    FASTIO;
    string a,b;;
    cin>>a>>b;
    a+=b;
    int x =stoi(a);
    int p =sqrt(x);
    if(p*p==x) cout<<"Yes\n";
    else cout<<"No\n";
}


Measured memory_bytes: 3612
from collections import defaultdict
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
n,m = invr()
nums = [0] + inlt()
graph = defaultdict(set)

for i in range(m):
    a,b = invr()
    graph[a].add(b)
    graph[b].add(a)

cnt = 0
for i in range(1,n + 1):
    for each in graph[i]:
        if nums[i] <= nums[each]:
            break
    else:
        cnt += 1
print(cnt)



Measured memory_bytes: 118480
S = list(input())
S_rev = list(reversed(S))
N = len(S)
if S != S_rev:
  print('No')
else:
  S1 = S[:int((N-1)/2)]
  S2 = S[int((N+1)/2):]
  S1_rev = list(reversed(S1))
  S2_rev = list(reversed(S2))
  if S1==S1_rev and S2 == S2_rev:
    print('Yes')
  else:
    print('No')
  


Measured memory_bytes: 38384
import sys
bbn=1000000007
	
#+++++
		
def main2():
	n, k = map(int, input().split())
	sl = input()
	dd=[]
	ddv=[]
	left= sl[0]
	count=0
	pre=left
	for c in sl:
		if c == pre:
			count+=1
		else:
			dd.append(count)
			ddv.append(pre)
			pre=c
			count=1
	dd.append(count)
	ddv.append(pre)
	
	pa(ddv)
	if k == 0:
		return max([v for v,c in zip(dd,ddv) if c == '1'])
	
	ll=[]
	for i,c in zip(dd,ddv):
		if c == '0':
			pass
			
def main():
	n, k = map(int, input().split())
	sl = input()
	al=[]
	if sl[0]=='0':
		al.append(0)
	p=sl[0]
	count=1
	for c in sl[1:]:
		if c == p:
			count+=1
		else:
			al.append(count)
			count=1
			p=c
	else:
		al.append(count)
		if sl[-1]=='0':
			al.append(0)
			
	#pa(al)
	
	if 2*k+1 >= len(al):
		print(n)
		return 
	
	ret = al[0]
	for i in range(k):
		ret += al[2*i+1]
		ret += al[2*i+2]
	#pa(ret)
	rs=ret
	for i in range(k, (len(al)//2)):
		rs += al[2*i+1]
		rs += al[2*i+2]
		rs -= al[2*(i-k)+1]
		rs -= al[2*(i-k)]
		ret = max(rs, ret)
		#pa(rs)
	print(ret)
		
			
			
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

namespace ConsoleApp15
{
    class Class290
    {
        static void Main()
        {
            var NM = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int N = NM[0];
            int M = NM[1];
            var mapA = new char[N, N];
            var mapB = new char[M, M];
            for(int i = 0; i < N; i++)
            {
                var r = Console.ReadLine();
                for(int j = 0; j < N; j++)
                {
                    mapA[i, j] = r[j];
                }
            }

            for(int i = 0; i < M; i++)
            {
                var r = Console.ReadLine();
                for(int j = 0; j < M; j++)
                {
                    mapB[i, j] = r[j];
                }
            }

            
            for(int i = 0; i < N - M + 1; i++)
            {
                for(int j = 0; j < N - M + 1; j++)
                {
                    bool frag = true;
                    for(int a = 0; a < M; a++)
                    {
                        for(int b = 0; b < M; b++)
                        {
                            if (mapA[i + a, j + b] == mapB[a, b]) continue;
                            frag = false;
                        }
                    }
                    if (frag) { Console.WriteLine("Yes");return; }
                }
            }
            Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n;
    cin >> n;

    vl a(n);
    rep(i, n) {
        cin >> a[i];
    }

    vl v(n);
    ll ans = 1;
    rep(i, n) {
        if(a[i] == 0) {
            ans *= 3 - v[0];
        }
        else {
            ans *= v[a[i]-1] - v[a[i]];
        }
        ans %= mod;
        v[a[i]]++;
    }   

    out(ans);
    re0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
void solve() {
	int N, M; cin >> N >> M;
	int ans = 1;
	for (int i = 1; i * i <= M; ++i) {
		int A = i;
		int B = M / A;
		if (M % A != 0) continue;
		if ((long)A * N <= M) ans = max(ans, A);	
		if ((long)B * N <= M) ans = max(ans, B);	
	}
	cout << ans << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int n, res;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        if (n % 1000 != 0) {
            res = 1000 - n % 1000;
            System.out.println(res);

        } else System.out.println("0");

    }
}


Measured memory_bytes: 26864
l = input()
mod = 10 ** 9 + 7

ln = len(l)
dp = [[0] * 2 for _ in range(ln + 1)]
dp[0][1] = 1

for i, e in enumerate(l, 1):
    # smaller -> smaller
    if e == "1":
        dp[i][0] += dp[i-1][0] * 3
    else:
        dp[i][0] += dp[i-1][0] * 3
    # exact -> smaller
    if e == "1":
        dp[i][0] += dp[i-1][1]
    # exact -> exact
    if e == "1":
        dp[i][1] += dp[i-1][1] * 2
    else:
        dp[i][1] += dp[i-1][1]

    dp[i][0] %= mod
    dp[i][1] %= mod

ans = dp[ln][0] + dp[ln][1]
ans %= mod
print(ans)
#print(*dp, sep="\n")


Measured memory_bytes: 19700
n, d = gets.split.map(&:to_i)
points = n.times.map { gets.split.map(&:to_i) }

ans = 0
points.combination(2).each do |a, b|
  dist = 0
  d.times do |i|
    dist += (a[i] - b[i])**2
  end
  ans += 1 if Math.sqrt(dist) == Math.sqrt(dist).to_i
end

puts ans


Measured memory_bytes: 1788
#include<stdio.h>
int main(){
	int a,b,c,d,p,x,y;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&p);
	x=a*p;
	if (p<=c){
		y=b;
	}
	else{
		y=b+(p-c)*d;
	}
		
	if (x<y)
	printf("%d\n",x);
	else
	printf("%d\n",y);
	return 0;
}


Measured memory_bytes: 2104
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;
const int Max_n = 1e6 + 5;
int vis[Max_n];
int main ()
{
	int a,b,c;
	cin>>a>>b>>c;
	memset(vis, 0, sizeof(vis));
	for(int i = 0; i <= a; i++)
		for(int j = 0; j <= b; j++)
			vis[i*b + j*a - 2*i*j] = 1;
	if(vis[c] == 1) cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//---------------------------------------------------------
   
int a[5]; int ans=0;
  rep(i,5){cin>>a[i];
          if(a[i]==0){ans=i;}}
  cout<<ans+1<<endl;
  
  
  
return 0; }


Measured memory_bytes: 3624
import sys

n,m = map(int, input().split())
num = [0]*n
count = [0]*n

for _ in range(m):
    b,c = map(int, input().split())
    if num[b-1] != c and count[b-1] > 0:
        print(-1)
        sys.exit()
    count[b-1]+=1
    num[b-1] = c    

if n == 3 and num[0] == 0 and count[0] == 0:
    num[0] = 1
elif n == 3 and num[0] == 0 and count[0]>0:
    print(-1)
    sys.exit()
elif n == 2 and num[0] == 0 and count[0] == 0:
    num[0] = 1
elif n == 2 and num[0] == 0 and count[0] >  0:
    print(-1)
    sys.exit()

ans = ""
for i in range(n):
    ans+=str(num[i])
print(ans)

Measured memory_bytes: 9228
import sys
f = sys.stdin

from datetime import date

eras = {'pre-meiji':{'start':None, 'end':date(1868,9,7)},
'meiji':{'start':date(1868, 9, 8), 'end':date(1912,7,29)},
'taisho':{'start':date(1912, 7, 30), 'end':date(1926,12,24)},
'showa':{'start':date(1926, 12, 25), 'end':date(1989,1,7)},
'heisei':{'start':date(1989, 1, 8), 'end':None}}

for line in f:
    y, m, d = map(int, line.split())
    target = date(y,m,d)
    for era_name, period in eras.items():
        if (period['start'] is None or period['start'] <= target) and(period['end'] is None or target <= period['end']):
            if era_name == 'pre-meiji':
                print(era_name)
            else:
                print(era_name, target.year - period['start'].year + 1, target.month, target.day)
            break
            

Measured memory_bytes: 7064