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


// type {{{
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
// }}}


// macro {{{
#define rep(i,n) for (ll i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i,n) for (ll i=1, i##_len=(n); i<=i##_len; ++i)
#define FOR(i,a,n) for (ll i=(a), i##_len=(n); i<i##_len; ++i)
#define SZ(x) ((ll)(x).size())
#define all(x) begin(x),end(x)
// }}}


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

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    rep (i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}
// }}}


// chmax, chmin {{{
template<typename T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<typename T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}
// }}}



// constants {{{
#define inf(T) numeric_limits<T>::max()
const ll MOD = 1e9+7;
const ld EPS = 1e-9;
// }}}



template<typename T, typename Compare>
bool chmax(T& a, const T& b, Compare comp) {
    if (comp(a, b)) { a = b; return true; }
    return false;
}

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

    auto comp = [](string s, string t) {
        if (s.size() == t.size()) return s < t;
        return s.size() < t.size();
    };

    for (;;) {
        int W, H;
        cin >> W >> H;
        if (W == 0) break;
        vector<string> C(H);
        rep(i, H) {
            cin >> C[i];
        }

        using vs = vector<string>;
        using vvs = vector<vs>;
        vvs dp(H+1, vs(W+1));
        rep(i, H) {
            rep(j, W) {
                if (C[i][j] < '0' or '9' < C[i][j]) continue;
                chmax(dp[i+1][j+1], max({
                            dp[i][j+1] + C[i][j],
                            dp[i+1][j] + C[i][j]}, comp), comp);
                if (dp[i+1][j+1][0] == '0') {
                    dp[i+1][j+1] = "";
                }
            }
        }

        string ans;
        rep(i, H) rep(j, W) chmax(ans, dp[i+1][j+1], comp);

        cout << ans << endl;
    }

    return 0;
}



Measured memory_bytes: 3276
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N = int(input())
ans = 0
for n in range(N):
    x, u = map(str, input().split())
    x = float(x)
    if not u=='JPY':
        x *= 380000.0
    ans += x
print(ans)

Measured memory_bytes: 38384
#include <array>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <utility>
#include <tuple>
#include <algorithm>
#include <limits>
#include <fstream>
#include <numeric>

namespace
{
	template<int N>
	std::array<int, N> GetValue(std::istream& stream)
	{
		std::string buf;
		std::getline(stream, buf);

		std::stringstream sstr(buf);
		std::array<int, N> retval;

		for (int i = 0; i < N; ++i)
		{
			std::getline(sstr, buf, ' ');
			retval[i] = std::stoi(buf);
		}

		return retval;
	}

	std::vector<int> GetValue(std::istream& stream, int num, char delim)
	{
		std::string buf;
		std::vector<int> retval;
		retval.reserve(num);

		for (int i = 0; i < num; ++i)
		{
			std::getline(stream, buf, delim);
			retval.push_back(std::stoi(buf));
		}

		return retval;
	}

	int GetValue(std::istream& stream)
	{
		int in;
		stream >> in;

		return in;
	}
}

int main(int argc, char* argv[])
{
	auto file = (argc == 1) ? std::ifstream() : std::ifstream(argv[1]);
	std::istream& stream = (argc == 1) ? std::cin : file;

	int num = GetValue<1>(stream)[0];
	//std::vector<int> values = GetValue(stream, num, '\n');

	int max_diff = std::numeric_limits<int>::min();
	int min = std::numeric_limits<int>::max();

	min = std::min(min, GetValue(stream));

	for (int i = 1; i < num; ++i)
	{
		//min = std::min(min, values[i]);
		//max_diff = std::max(max_diff, values[i + 1] - min);

		int current = GetValue(stream);
		max_diff = std::max(max_diff, current - min);
		min = std::min(min, current);
	}

	std::cout << max_diff << std::endl;
}



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

int main()
{
	int j,tmp=0,flag=1;
	cin >> j;
	for(int i=2;;i++)
	{
		for(int x=2;x*x<=i;x++)
		{
			if(i%x==0) flag=0;
		}
		if(flag==0)
		{
			flag=1;
			continue;
		}
		else
		{
			if(i%10==1)
			{
				tmp++;
				if(tmp>j) return 0;
				cout << i << ' ';
			}
		}
	}
}

Measured memory_bytes: 256
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def exist(a, x):
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return True
    return False


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    if len(set(A)) != N or len(set(B)) != M:
        print(0)
        return

    MOD = 10 ** 9 + 7

    sorted_A = list(sorted(A[:]))
    sorted_B = list(sorted(B[:]))
    sorted_total = list(sorted(set(A[:] + B[:])))

    ans = 1
    free = 0
    for d in range(N * M, 0, -1):
        in_a = exist(sorted_A, d)
        in_b = exist(sorted_B, d)
        if in_a and in_b:
            pass
        elif in_a:
            num_b = (M - bisect_left(sorted_B, d))

            ans *= num_b
            ans %= MOD
        elif in_b:
            num_a = (N - bisect_left(sorted_A, d))

            ans *= num_a
            ans %= MOD
        else:
            num_a = (N - bisect_left(sorted_A, d))
            num_b = (M - bisect_left(sorted_B, d))
            num_t = (len(sorted_total) - bisect_left(sorted_total, d))

            num = num_a * num_b - num_t
            ans *= (num - free)
            ans %= MOD
            free += 1

    print(ans % MOD)


if __name__ == '__main__':
    main()


Measured memory_bytes: 46072
import java.util.*;

class Main
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int arr[] = new int[n];

		for(int i = 0; i < n; i++)
			arr[i] = sc.nextInt();

		int ans = 0;
		for(int i = 0; i < n; i++)
			if(arr[i] == (i + 1))
			{
				ans++;
				i++;
			}

		System.out.println(ans);
	}
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define ALL(name) name.begin(),name.end()
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

string S;
ll N;

vector<ll> ans;

void MakeAns(ll r_last, ll l_start, ll r_num, ll l_num) {
    if(r_num % 2 != 0) {
        ans[r_last] += (r_num / 2) + 1;
        ans[l_start] += r_num / 2;
    }
    else {
        ans[r_last] += r_num / 2;
        ans[l_start] += r_num / 2;
    }

    if(l_num % 2 != 0) {
        ans[l_start] += (l_num / 2) + 1;
        ans[r_last] += l_num / 2;
    }
    else {
        ans[l_start] += l_num / 2;
        ans[r_last] += l_num / 2;
    }
}

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

    cin >> S;
    N = S.length();

    ans.assign(N, 0);

    // RR...LL... の塊を求める
    ll r_last = -1;
    ll l_start = -1;
    ll r_num = 0;
    ll l_num = 0;
    bool isCheckR = true;
    REP(i, N) {
        if(isCheckR) {
            if(S[i] == 'R') {
                r_num++;
                r_last = i;
            }
            else {
                l_start = i;
                l_num++;
                isCheckR = false;
            }
        }
        else {
            if(S[i] == 'L') {
                l_num++;
            }
            else {
                MakeAns(r_last, l_start, r_num, l_num);
                r_last = i;
                l_start = -1;
                r_num = 1;
                l_num = 0;
                isCheckR = true;
            }
        }
    }
    MakeAns(r_last, l_start, r_num, l_num);


    REP(i, ans.size()) {
        printf("%lld%c", ans[i], (i == ans.size()-1) ? '\n' : ' ');
    }

    return 0;
}


Measured memory_bytes: 1488
#include <bits/stdc++.h>
#define range(i, l, r) for(long long int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (long long int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

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

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    os << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        os << ", " << *it;
    }
    return os << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    os << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        os << ", " << *it;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    os << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        os << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    os << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        os << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    lint N; cin >> N;
    vec<lint> X_list(N);
    range(i, 0, N) cin >> X_list.at(i);
    lint min_energy = 1LL << 59;
    range(c, 1, 100 + 1) {
        lint energy = 0;
        for (const lint& X : X_list) energy += (X - c) * (X - c);
        min_energy = min(min_energy, energy);
    }
    cout << min_energy << '\n';
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B = MI()
    if abs(A-B)%2 == 0:
        print(min(A,B)+abs(A-B)//2)
    else:
        print("IMPOSSIBLE")
if __name__ == '__main__':
    main()

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

bool check(int a[], int b[], int len) {
  for(int i=0; i<len; i++) {
    if(a[i]!=b[i]) return false;
  }
  return true;
}

int main() {
  int n,a,b,j;
  int p[8],q[8];


  cin >> n;
  int v[n];

  rep(i,n) {
    v[i] = i+1;
  }

  rep(i,n){
    cin >> p[i];
  }
  rep(i,n){
    cin >> q[i];
  }

  j = 0;
  do {
    j++;
    if(check(p, v, n)) a = j;
    if(check(q, v, n)) b = j;
  } while(next_permutation(v,v+n));
 
   cout << abs(a-b) << endl;

  return 0;
}

Measured memory_bytes: 256
s = input()
for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
        print(i + 1, i + 2)
        exit(0)
for sz in range(3, 4, 2):
    if sz > len(s):
        break
    for i in range(len(s) - sz + 1):
        curr = s[i:i + sz]
        for it in curr:
            if curr.count(it) > sz // 2:
                print(i + 1, i + sz)
                exit(0)
print("-1 -1")


Measured memory_bytes: 3188
/**
 *   author: sahushivam
 *   created: 16 November 2019 (Saturday)  17:40:01
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,a,b) for(int i = a; i<b; i++)
#define MOD 1000000007
#define INF 1e18
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define int long long

vector<string> fact;

void permute(string a, int l, int r)  
{  
    if (l == r)  
       fact.PB(a); 
    else
    {  
        for (int i = l; i <= r; i++)  
        {  
  
            swap(a[l], a[i]);    
            permute(a, l+1, r);  
            swap(a[l], a[i]);  
        }  
    }  
}  

signed main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int t=1;
    cin>>t;
    vector<pair<int,int>> gp(t);
    for(int i=0;i<t;i++)
    {
    		int a,b;
    		cin>>a>>b;
    		gp[i]={a,b};
    	
    }
    string s="";
    for(int i=0;i<t;i++) 
    {
    	s=s+to_string(i);
    }
    permute(s,0,t-1);
    int sz=fact.size();
    long double ans=0;
    for(int i=0;i<sz;i++)
    {
    	string path=fact[i];
    	int len=path.length();
    	int a1=0;
    	for(int j=0;j<len-1;j++)
    	{
    		int node1=path[j]-'0';
    		int node2=path[j+1]-'0';
    		auto c1=gp[node1];
    		auto c2=gp[node2];
    		double dist=sqrt(((c1.first-c2.first)*(c1.first-c2.first)) + ((c1.second-c2.second)*(c1.second-c2.second)));
    		ans+=dist;
    	}
    }
    ans=ans/sz;
    cout<<fixed<<setprecision(10)<<ans;
return 0;
}

Measured memory_bytes: 2424
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vec = vector<ll>;
using vecp = vector<P>;
using mat = vector<vec>;
using matp = vector<vecp>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define all(v) v.begin(), v.end()

int main(){
  ll N;
  cin >> N;
  vec X(N);
  rep(i,N){
    cin >> X.at(i);
  }
  ll ans=INF;
  rep(i,100){
    ll k=0;
    rep(j,N){
      k+=(X.at(j)-i-1)*(X.at(j)-i-1);
    }
    ans=min(k,ans);
  }
  cout << ans << endl;
}
    

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

using namespace std;
using ll =long long;
using db = double;
using vll = vector<long long>;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
#define debug(x)  cout << #x << " = " << (x) << endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//グラフ用
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};	
//ここから書き始める

ll combination(ll n, ll i){
	ll count = 0;
	ll multi = 1;
	ll div =1;
	int limit = i;
	while(count < limit){
		multi *= n;
		n--;
		multi/= count+1;
		count ++ ;
	}
	return multi / div;
}

int main()
{
	cout <<setprecision(10);
	ll n; cin >> n;
	vector<pair<int,int>> task(n);
	rep(i,n) {
		ll a,b;
		cin >> a >> b;
		task[i] = make_pair(b,a);//task 締め切り、かかる時間
	}
	SORT(task);
	ll time = 0 ;
	rep(i,n){
		ll a,b ;
		tie(b,a) = task[i];
		time += a;
		if(time > b){
			cout <<"No"<<endl;
			return 0 ;
		}
	}
	cout <<"Yes" <<endl;
	
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int a,b,c;
    string ans="NO";
    cin >>a>>b>>c;
    int d=a%b;
    for(int i=1;i<10000;i++){
       if(d*i%b==c){
         ans="YES";
         break;
       }
    }
        cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <list>
#include <sys/timeb.h>
#include <fstream>
#include <set>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	int n;
	string s, t;

	cin >> n;

	if (n == 22) {
		cout << "Christmas Eve Eve Eve" << endl;
	}
	else if (n == 23) {
		cout << "Christmas Eve Eve" << endl;
	}
	else if (n == 24) {
		cout << "Christmas Eve" << endl;
	}
	else if (n == 25) {
		cout << "Christmas" << endl;
	}

	return 0;
}



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

int main() {
  int A,B;
  cin >> A >> B;
  int times = B - A;
  
  int count = 0;
  for( int i = 0; i <= times; i++ ){
    int sen = ( A / 1000 ) % 10;
    int zyu = ( A / 10 ) % 10;
    if( A / 10000 == A % 10 && sen == zyu ){
      count++;
    }
    A++;
  }
  cout << count << endl;
}



Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
ans=0
for i in range(N):
    ans+=(i+1)*(N-i)
for _ in range(N-1):
    u,v=map(int1,input().split())
    u,v=min(u,v),max(u,v)
    ans-=(u+1)*(N-v)
print(ans)

Measured memory_bytes: 74188
#include <iostream>
#include <string>
#include <vector>
#include <cstring>

using namespace std;

#define MAX 100

bool field[MAX][MAX];
int  cache[MAX][MAX];
bool mark[MAX][MAX];
int N;
int W, H;
int S, T;

int count(int y, int x) {
    int acc = 0;
    for (int i = y; i < y + T; i++) {
        for (int j = x; j < x + S; j++) {
            if (field[i][j]) acc++;
            mark[i][j] = true;
        }
    }
    return acc;
}
int main() {
    while (cin >> N) {
        if (N == 0) break;
        cin >> W >> H;
        memset(field, 0, sizeof(field));
        memset(cache, 0, sizeof(cache));
        for (int i = 0; i < N; i++) {
            int x, y;
            cin >> x >> y;
            field[y-1][x-1] = true;
        }
        cin >> S >> T;
        //さーち
        int max_count = 0;
        for (int i = 0; i + T <= H; i++) {
            for (int j = 0; j + S <= W; j++) {
                int cur_count = count(i, j);
                max_count = (max_count > cur_count ? max_count : cur_count);
            }
        }

//        for (int i = 0; i < H; i++) {
//            for (int j = 0; j < W; j++) {
//                cout << mark[i][j] << ' ';
//            }
//            cout << endl;
//        }


        cout << max_count << endl;
    }
    return 0;
}
            

    

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

namespace ABC078A
{
    class Program
    {
        static void Main(string[] args)
        {
            string x, y;

            var word = Console.ReadLine().Split(' ');
            x = word[0];
            y = word[1];

            if (x[0] == y[0])
                Console.WriteLine("=");
            else if (x[0] > y[0])
                Console.WriteLine(">");
            else if (x[0] < y[0])
                Console.WriteLine("<");
        }
    }
}


Measured memory_bytes: 13140
from itertools import accumulate
from bisect import bisect

n, m, k = map(int, input().split())
a = [*accumulate(map(int, input().split()), initial=0)]
b = [*accumulate(map(int, input().split()), initial=0)]
print(max(i - 1 + bisect(b, k - x) for i, x in enumerate(a) if x <= k))


Measured memory_bytes: 47936
import sys


def find_permutation(aaa, use):
    """
    iの残り使用数がaaa[i-1]の状態で
    集合useにある文字群(1～k)を後ろに繋げる方法で
    それよりさらに後が破綻しないような繋げ方のうち
    辞書順最小のものを求める。

    ただし（この関数からは見えないが）現在確定済み配列の
    末尾 (k - |use|) 個は、useに含まれない要素が1回ずつ登場することを前提とする。
    （つまり、この関数の結果を繋げると、末尾 k 個が順列になる）

    どうやっても破綻する場合はNoneを返す。

    :param aaa:
    :param use:
    :return:
    """

    max_a = -1
    min_a = 1005
    max_fixed = -1

    for i in range(k):
        a = aaa[i]
        if i + 1 in use:
            min_a = min(min_a, a)
            max_a = max(max_a, a)
        else:
            max_fixed = max(max_fixed, a)

    if max(max_a, max_fixed + 1) > 2 * min_a:
        return None

    if max_a < 2 * min_a:
        return sorted(use)

    front = []
    rear = []
    either = []
    for i in use:
        if aaa[i - 1] == max_a:
            front.append(i)
        elif aaa[i - 1] == min_a:
            rear.append(i)
        else:
            either.append(i)

    max_front = front[-1]
    for i in either:
        if i < max_front:
            front.append(i)
        else:
            rear.append(i)
    front.sort()
    rear.sort()
    front.extend(rear)

    return front


def solve(k, aaa):
    if k == 1:
        return [1] * aaa[0]

    min_a = min(aaa)
    max_a = max(aaa)
    if min_a * 2 < max_a:
        return [-1]

    ans = []
    ans.extend(find_permutation(aaa, set(range(1, k + 1))))
    for i in range(k):
        aaa[i] -= 1

    remaining = sum(aaa)
    while remaining:
        use = set(range(1, k + 1))
        candidates = []
        for r in range(k):
            result = find_permutation(aaa, use)
            if result is not None:
                candidates.append(result)

            use.remove(ans[-r - 1])
        adopted = min(candidates)
        ans.extend(adopted)
        for i in adopted:
            aaa[i - 1] -= 1
        remaining -= len(adopted)

    return ans


k, *aaa = map(int, sys.stdin.buffer.read().split())
print(*solve(k, aaa))


Measured memory_bytes: 9372
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
    int x , a , b ;
    cin >> x >> a >> b;

    int A ,  B ;
    A = abs( x - a ) ;
    B = abs( x - b ) ;

    if(A<B){
        cout << "A" << endl;
    }else{
        cout << "B" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 19;
int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

const int MX = 5005;
const int MM = 1000000007;

int N, a, b;
vector<int> T[MX];
int cnt[MX];

int get_cnt(int x, int p = -1){
	cnt[x] = 1;
	for(int c : T[x]){
		if( c == p ) continue;
		cnt[x] += get_cnt(c, x);
	}
	return cnt[x];
}

ll F[MX], I[MX], FI[MX];

ll sq(ll x){ return x*x % MM; }

int main()
{
	F[0] = FI[0] = 1; I[1] = 1;
	for(int i = 2; i < MX; i++) I[i] = (MM - I[MM%i]) * (MM/i) % MM;
	for(int i = 1; i < MX; i++) F[i] = F[i-1] * i % MM;
	for(int i = 1; i < MX; i++) FI[i] = FI[i-1] * I[i] % MM;
	scanf("%d", &N);
	for(int i = 1; i < N; i++){
		scanf("%d%d", &a, &b);
		T[a].push_back(b);
		T[b].push_back(a);
	}
	int r = 1;
	get_cnt(r);
	while(1){
		int mx = T[r][0];
		for(int c : T[r]){
			if( cnt[mx] < cnt[c] )mx = c;
		}
		if( cnt[mx]*2 <= cnt[r] ) break;
		cnt[r] -= cnt[mx];
		cnt[mx] += cnt[r];
		r = mx;
	}

	vector<int> L;
	ll arr[2][MX] = {}, *S = arr[0], *E = arr[1];
	for(int c : T[r]) L.push_back(cnt[c]);
	S[0] = 1;
	for(int c : L){
		for(int i = 0; i < MX; i++) E[i] = 0;
		for(int i = 0; i <= c; i++){
			for(int j = i; j <= N; j++){
				E[j] = (E[j] + S[j-i] * F[c] % MM * FI[c-i] % MM * F[c] % MM * FI[i] % MM * FI[c-i]) % MM;
			}
		}
		swap(S, E);
	}

	ll ans = 0;
	for(int i = 0; i <= N-1; i++){
		if( i&1 ) ans = (ans + MM - S[i] * F[N-i] % MM);
		else ans = (ans + S[i] * F[N-i]) % MM;
	}
	printf("%lld\n", ans % MM);
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define sz(a) int((a).size()) 
#define pb push_back 
#define all(c) (c).begin(),(c).end() 
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++) 
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define F(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define VE(i,v) for(int i = 0;i < (v).size();i++)

using namespace std;
#define trace(...) cerr<<__FUNCTION__<<":"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cerr<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	const char *comma=strchr(names+1,',');
	cerr.write(names,comma-names)<<" : "<<arg1<<" | ";
	__f(comma+1,args...);
}
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned int ui;
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
typedef pair<ll,ll> pll;
typedef vector<pll> vpll; 
 
vector<int> id;
vector<int> od;
vi adj[100001];

int dfs(int u, int d)
{
	
	if(od[u]!=0)
		return od[u];
	trace(u, id[u], od[u]);
	int tod = 0;
	for(auto v: adj[u])
	{
		if(id[v]<(d+1))
			id[v] = d+1;
		tod = max(tod, dfs(v, id[v]));
	}
	if(sz(adj[u])==0)
		od[u] = 0;
	else
		od[u] = tod+1;
	//trace(u, id[u], od[u]);
	return od[u];
}


int main()

{
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);
	int T;
	T=1;

	for(int tc=1; tc<=T;tc++)
	{
		int N,M;
		cin >> N>>M;
		id.assign(N+1,0);
		od.assign(N+1,0);
		for(int i =0; i< M; i++)
		{
			int u , v;
			cin >> u >> v;
			adj[u].pb(v);
		}
		for(int i =1; i <=N; i++)
			dfs(i, id[i]);
		int ans = 0;
		for(int i =1; i<=N;i++)
			ans = max(ans, id[i]+od[i]);


			
		
		cout<<ans<<"\n";
	}
 
 
 
	return 0;
}
 
 



Measured memory_bytes: 9216
def floor(a):
    return int(a)

if __name__ == '__main__':
    abn = input()
    abn = abn.split()
    a = int(abn[0])
    b = int(abn[1])
    n = int(abn[2])

    x = min(b-1,n)
    ans = floor(a*x/b)-a*floor(x/b)

    print(ans)


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

using namespace std;

int main() {
    int N, K;
    cin >> N >> K;
    double sum = 0;
    for(int i = 1; i <= N; i++) {
        int now = i;
        double result = 1.0/N;
        while(now < K) {
            now *= 2;
            result /= 2;
        }
        sum += result;
    }
    printf("%.14lf\n", sum);
    return 0;
}

Measured memory_bytes: 256
#include <complex>
#include <vector>
#include <set>
#include <cstdio>
using namespace std;

const double EPS = 1e-12;
typedef complex<long double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}

struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

bool intersectLP(const L &l, const P &p) {
  return abs(cross(l[1]-p, l[0]-p)) < EPS;
}
bool intersectSP(const L &s, const P &p) {
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}

long long pow_binary_mod(long long x,long long y,long long M){
	long long z=1;
	for(;y;y>>=1){
		if((y&1)!=0)z=z*x%M;
		x=x*x%M;
	}
	return z;
}

int main(){
	int M=998244353;
	int N,x,y;
	scanf("%d",&N);
	vector<P>v(N);
	int r=pow_binary_mod(2,N,M);
	set<pair<int,int> >se;
	for(int i=0;i<N;i++)scanf("%d%d",&x,&y),v[i]={(double)x,(double)y};
	for(int i=0;i<N;i++)for(int j=i+1;j<N;j++){
		if(se.find({i,j})!=se.end())continue;
		L l(v[i],v[j]);
		vector<int>x={i,j};
		for(int k=0;k<N;k++)if(k!=i&&k!=j&&intersectLP(l,v[k]))x.push_back(k);
		for(int a=0;a<x.size();a++)for(int b=a+1;b<x.size();b++){
			int n=b-a-1;
			r=(r-pow_binary_mod(2,n,M))%M;
			se.emplace(x[a],x[b]);
		}
	}
	printf("%d\n",((r-N-1)%M+M)%M);
}

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

int H,W;


bool onBoard(int y,int x){
    if(y>=0&&y<H&&x>=0&&x<W){
        return true;
    }
    return false;
}

int main() {
    cin >> H >>W;
    vector<string> A(H);
    for(int i=0;i<H;i++){
        cin >> A[i];
    }
    queue<pair<int,int>> q;
    int d[H][W];
    memset(d,-1,sizeof(d));
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(A[i][j] == '#'){
                d[i][j] =0;
                q.emplace(i,j);
            }
        }
    }
    int ans =0;
    int dy[] = {1,0,-1,0};
    int dx[] = {0,1,0,-1};
    while(!q.empty()){
        int y = q.front().first;
        int x = q.front().second;
        q.pop();
        for(int i=0;i<4;i++){
            int ny = y + dy[i];
            int nx = x + dx[i];
            if(onBoard(ny,nx) && d[ny][nx] == -1){
                d[ny][nx] = d[y][x] +1;
                ans = max(ans,d[ny][nx]);
                q.emplace(ny,nx);
            }
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 13456
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    string s;
    cin >> s;
    int r = 0;
    int ans = 0;
    for (int l = 0; l < n; l++)
    {
        while (r < n && s[r] == s[l])
        {
            r++;
        }
        ans++;
        l = r - 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespace std;

int main(){
  int a, b;
  cin >> a >> b;
  cout << a * b << endl;
  
  return 0;
}

Measured memory_bytes: 3620
r,c = map(int,input().split())
numbers = []
for i in range(r):
    subnumbers = list(map(int,input().split()))
    numbers.append(subnumbers)
for j in range(r):
    for k in range(c):
        print(numbers[j][k],end = " ")
    print(sum(numbers[j]))
allcount = 0
for l in range(c):
    count = 0
    for m in range(r):
        count += numbers[m][l]
    print(count,end = " ")
    allcount += count
print(allcount)
    



Measured memory_bytes: 6224
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
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; }

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

    int turn = 0;
    while (a > 0 && c > 0) {
        if (turn % 2 == 0) c -= b;
        else a -= d;
        turn++;
    }

    if (turn % 2 == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 3632
N = int(input())
S = input()

ans = S.count('R')*S.count('G')*S.count('B')

for i in range(N-2):
  for j in range(i+1,N-1):
    k = 2*j-i
    
    if k >= N:
      break
    
    if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
      ans -= 1
      
print(ans)
      
    
    

Measured memory_bytes: 9164
from itertools import zip_longest
ABCD = list(input())
n = len(ABCD) - 1
for i in range(2 ** n):  
  op = ["+" if ((i >> j) & 1) else "-" for j in range(n)]
  cal = "".join([i + j for i, j in zip_longest(ABCD, op, fillvalue="")])
  if eval(cal) == 7:
    print(cal + "=7")
    exit()

Measured memory_bytes: 3064
n,m = list(map(int, input().split()))
li = []
box = []

for i in range(n):
    l = list(map(int, input().split()))
    del l[0]
    li += l
    
for i in range(1, m+1):
    if li.count(i) == n:
        box.append(i)

print(len(box))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
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 (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b,c;cin >> a >> b >> c;
    if(c-a-b<0){
        cout << "No" << endl;
        return 0;
    }
    cout << (4*a*b<(c-a-b)*(c-a-b)?"Yes":"No") << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+10;
int w[N],ne[N],la[N],t=1,ban[N];
int deg[N];
int ans[N],a1,n,m;
void link(int x,int y){
	w[++t]=y;
	ne[t]=la[x];
	la[x]=t;
	deg[x]++;
}
void dfs(int x){
	for (int y=la[x];y;y=la[x]){
		la[x]=ne[y];
		if (ban[y])continue;
		ban[y]=ban[y^1]=1;
		dfs(w[y]);
	}
	ans[++a1]=x;
}
void ok(){
	cout<<"Yes"<<endl;
	exit(0);
}
void inv(){
	cout<<"No"<<endl;
	exit(0);
}
int main(){
	cin>>n>>m;
	for (int i=1;i<=m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		link(x,y);
		link(y,x);
	}
	int x=0,y=0,z=0,k=0;
	for (int i=1;i<=n;i++){
		if (deg[i]&1)inv();
		if (deg[i]>4)k=1;
		if (deg[i]==4)z=y,y=x,x=i;
	}
	if (z||k)ok();
	if (!y)inv();
	dfs(x);
	int cnt=0;
	for (auto i:ans){
		cnt+=i==y;
		if (i==x&&cnt&1)inv();
	}ok();
}


Measured memory_bytes: 12288
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(){
  int n; cin >> n;
  string s; cin >> s;
  int ans = 0;
  vector<int> ms(n, 0);
  for(int e = 0; e < s.length(); e++){
    vector<int> a(n, 0);
    int c = 0;
    for(int i = 1; i + e < s.length(); i++){
      if(i+a[i-c] < c+a[c]){
        a[i] = a[i-c];
      }
      else{
        int j = max(0, c+a[c]-i);
        while(i+j < s.length() && s[e+j] == s[i+e+j]) j++;
        a[i] = j;
        c = i;
      }
    }
    for(int k = 1; k + e < s.length(); k++){
      ms[e] = max(min(a[k], k), ms[e]);
      // cout << a[k] << " ";
    }
    // cout << endl;
  }
  sort(ms.begin(), ms.end());
  for(int i = 1; i < n; i++){
    ans = max(ms[i], ans);
  }
  cout << ans << endl;
}


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

int main() {
  int a, b; cin >> a >> b;
  if(a % 3 == 0 || b % 3 == 0 || (a+b) % 3 == 0) cout << "Possible" << endl;
  else cout << "Impossible" << endl;

  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();

	}
	static class Task{
		int M = (int) (1e9 + 7);
		public void solve(int testNumber, InputReader in, PrintWriter out) {
				int n = in.nextInt(), x = in.nextInt();
				int d = 0;
				for(int i  = 0; ++i < n+1;) {
					d += in.nextInt();
					if(d > x) {
						out.print(i);
						return ;
					}
					else if(i == n) out.print(n+1);
				}
					
						
		
				
		}//Solve
		
	}//task
	
	
	static class InputReader{
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		public String next() {
			while(tokenizer == null || ! tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for(int i = -1; ++i < n;) arr[i] = Integer.parseInt(next());
			return arr;
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		
	}
}

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

int main(){
	int x,n;
	cin >> x >> n;
	vector<int> ans(101);
	rep(i,101) ans[i] = i+1;
	rep(j,n){
		int p;
		cin >> p;
		rep(l,101){
			if(ans[l] == p) ans[l] = 0;
		}
	}
	int sa = 101;
	int minimum;
	rep(i,101){
		if(sa > abs(ans[i] - x)) minimum = ans[i];
		sa = min(sa,abs(ans[i]-x)); 
	}
	cout << minimum << endl;
}

Measured memory_bytes: 3584
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
#define all(arr) arr.begin(),arr.end()
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif 
#define unique(a)       sort((a).begin(), a.end()), (a).erase(unique((a).begin(), (a).end()),(a).end())
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>void __f(const char* name, Arg1&& arg1){cout<<name<<" : "<<arg1<<"\n";}
template <typename Arg1, typename... Args>void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma=strchr(names+1,',');cout.write(names,comma-names)<<" : "<<arg1<<" , ";__f(comma+1, args...);}
const int MOD = 1000000007;
using PII = pair<int, int>;
using LL = long long int;

template <typename T>
void input(vector<T> &arr,LL n) {
	T temp;
	for(LL i=0;i<n;i++) cin>>temp, arr.push_back(temp);
}

template <typename T>
void output(vector<T> arr) {
	T temp;
	for(auto x:arr) cout<<x<<" ";
	cout<<endl;
}


template <typename T>
void input_set(set<T> &arr,LL n) {
	T temp;
	for(LL i=0;i<n;i++) cin>>temp, arr.insert(temp);
}


LL power(LL num,LL base) {
	if(base==0)
		return 1;

	if(base%2)
		return (num%MOD*power(num,base-1)%MOD)%MOD;
	else {
		LL x=power(num,base/2);
		x=(x*x)%MOD;
		return x;
	}
}

int main() {

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

	int N;
	cin>>N;
	cout<<((N-1)/1000 + 1) * 1000 - N;
}

//things to remember:
//1. int array must be memsetted before use



Measured memory_bytes: 3656
import java.util.Scanner;
 
class Main {
 
	public static void main(String[] args) {
		
		Scanner stdIn = new Scanner(System.in);
		
		int A = stdIn.nextInt();
		int B = stdIn.nextInt();
		int[] Ans = {1,2,3};
		int i;
		
		Ans[A-1] = 0;
		Ans[B-1] = 0;
		
		for( i=0;i<3;i++ ){
			if(Ans[i] != 0){
				System.out.println(Ans[i]);
				break;
			}
		}
	}
    
}

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

int main(){
    int N;
    int64_t sumall=0;
    cin >> N;

    vector<int64_t> A(N), B(N), sum(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A.at(i);
        B.at(A.at(i)-1)++;
    }
    
    for (int i = 0; i < N; i++)
    {
        if(B.at(i) != 0){
            sumall += (double)B.at(i)/2*(B.at(i)-1);
        }
    }

    for (int i = 0; i < N; i++)
    {
        sum.at(i) = sumall - B.at(A.at(i)-1) + 1;
    }   

    for (int i = 0; i < N; i++)
    {
        cout << sum.at(i) << endl;
    }
    
}

Measured memory_bytes: 7296
# 入力
n = int(input().rstrip())

# 利益を算出
r = int(input().rstrip())
min = r

for i in range(n-1):
    r = int(input().rstrip())
    if i == 0:
        profit = r - min
    else:
        if r - min > profit:
            profit = r - min
    if min > r:
        min = r

print(profit)




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

public class Main {

	public static void main(String[] args) throws IOException, NumberFormatException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");
		int[] S = new int[n];
		for(int i = 0; i < n; i++){
			S[i] = Integer.parseInt(str[i]);
		}
		
		int q = Integer.parseInt(br.readLine());
		str = br.readLine().split(" ");
		int[] T = new int[q];
		for(int i = 0; i < q; i++){
			T[i] = Integer.parseInt(str[i]);
		}
		
		int count = 0;
		for(int i = 0; i < q; i++){
			for(int j = 0; j < n; j++){
				if(T[i] == S[j]){
					count++;
					break;
				}
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 27384
#include<bits/stdc++.h>
#define int long long 
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=998244353;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#endif
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
int n;
string x;
int ans[1000005],valid[1000005];
int to_int(string t){
	int ret=0;
	for(auto c:t){
		ret=ret*2+c-'0';
		ret%=mod;
	}
	return ret;
}
bool ok(string &a,string &b){
	for(int i=0;i<a.size();i++){
		if(a[i]+b[i]!='0'+'1')return false;
	}
	return true;
}
string inv(string a){
	string ret="";
	for(char c:a)ret.push_back('0'+'1'-c);
	return ret;
}
int calc(int len){
	if(n*2%len!=0)return 0;
	if((n*2/len)%2==0)return 0;
	valid[len]=1;
	int read_len=len/2;
	vector<string>vs;
	for(int j=0;j<x.size();j+=read_len){
		vs.push_back(getstr(x,j,j+read_len-1));
	}
	int pos=0;
	while(pos+2<vs.size()&&ok(vs[pos],vs[pos+1])){
		pos++;
	}
	if(pos&1)vs[pos]=inv(vs[pos]);
	else vs[pos+1]=inv(vs[pos+1]);
	if(pos&1){
		if(vs[pos]>vs[pos+1])return to_int(vs[pos]);
		return to_int(vs[pos])+1;
	}else{
		if(vs[pos+1]>vs[pos])return to_int(vs[pos]);
		else return to_int(vs[pos])+1;
	}
}

signed main(){
	cin>>n>>x;
	for(int len=2;len<=n;len++){
		ans[len]=calc(len);ans[len]+=mod;ans[len]%=mod; 
	}
	ans[n*2]=to_int(x)+1;valid[n*2]=1;
	for(int i=1;i<=5e5;i++){
		if(valid[i])
		for(int j=i+i;j<=5e5;j+=i){
			if(valid[j])ans[j]-=ans[i];
			if(ans[j]<0)ans[j]+=mod;
		}
	}
	int res=0;
	for(int i=1;i<=n+n;i++){
		res+=ans[i]*i;
		res%=mod;
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 15960