akhauriyash/Code-Regression huggingface dataset:
n=int(input())
ans=10000000000000
for i in range(1,n//2+1):
	a=i 
	b=n-i 
	asum=0
	bsum=0
	for j in str(a):
		asum+=int(j)
	for j in str(b):
		bsum+=int(j)
	ans=min(ans,asum+bsum)
print(ans)

Measured memory_bytes: 41324
N = int(input())
A0 = list(map(int, input().split()))
A1 = list(map(int, input().split()))

A_max = 0

for n in range(0, N):
    A_sum = sum(A0[0:n+1]) + sum(A1[n:])
    if A_sum > A_max:
        A_max = A_sum

print(A_max)


Measured memory_bytes: 3316
#include <iostream>
#include <map>
#include <set>
using namespace std;

int main(){
  int N,a,c;
  map<int,int> A{};
  set<int> judge;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> a;
    A[a]++;
  }
    switch( A.size() ){
      case 1:
        if( A.find(0)!=A.end() ){
          cout << "Yes" << endl;
        }else{
          cout << "No" << endl;
        }
        break;
      case 2:
        if( A.find(0)==A.end() || N!=A[0]*3 ){
          cout << "No" << endl;
        }else{
          cout << "Yes" << endl;
        }
        break;
      case 3:
        {
        int x,y,z;
        int Nx,Ny,Nz;
        auto itr=A.begin();
        x=itr->first;
        Nx=itr->second;

        itr=next(itr);
        y=itr->first;
        Ny=itr->second;

        itr=next(itr);
        Nz=itr->second;
        z=itr->first;
        if( 3*Nx==N && 3*Ny==N && 3*Nz==N ){
          while(z>0){
            judge.insert(z%2*4+y%2*2+x%2);
            x/=2;
            y/=2;
            z/=2;
          }
          if(judge.find(1)==judge.end() && 
             judge.find(2)==judge.end() && 
             judge.find(4)==judge.end() && 
             judge.find(7)==judge.end()
            ){
            cout << "Yes" << endl;
          }else{
            cout << "No" << endl;
          }
        }else{
          cout << "No" << endl;
        }
        }
        break;
      default:
        cout << "No" << endl;
        break;
    }
  
}

Measured memory_bytes: 3840
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pll pair<ll,ll>
#define forA(i,a,n,x) for(ll i=a;i<n;i+=x)
#define forD(i,a,n,x) for(auto i=n-1;i>=0;i-=x)
#define ranit(it,n) for(auto it:n)
#define testCases ll t;cin>>t;while(t--)
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define init(a,x) memset(a,x,sizeof(a))

int main()
{
	ios_base::sync_with_stdio(false);	cin.tie(NULL);	cout.tie(NULL);
	string s; cin>>s; 
	
	ll n = s.length(); if(s[n-1]=='s') cout<<s<<"es"; else cout<<s<<"s";

	return 0;
}

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  long long ans = 0, a;
  priority_queue<long long> que;
  for (int i = 0; i < n; i++) {
    cin >> a;
    que.push(a);
  }
  for (int i = 0; i < m; i++) {
    a = que.top();
    que.pop();
    a /= 2;
    que.push(a);
  }
  while (!que.empty()) {
    ans += que.top();
    que.pop();
  }
  cout << ans << '\n';
}


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

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;

#define PB push_back
#define MP make_pair

#define sd(n) scanf("%lld", &n)
#define pdn(n) printf("%lld\n", n);
#define pds(n) printf("%lld ", n);
#define endl '\n'

#define forn(a, b, i) for (int i = a; i < b; i += 1)
#define all(v) v.begin(), v.end() 

#define print(stuff) cout << stuff << endl
#define len(stuff) (int) stuff.size()

#define int long long
// #define float long double 
#define ll long long
#define ld long double

typedef long long LL;

using vi = vector<int>;
using vb = vector<bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const int inf = (int) 1e16;
const int upper = (int) 3e5 + 50;
// const int M = (ll) 1e9 + 7;
const int mod = (ll) 998244353;
const int M = mod;

const double eps =  1e-8;
	
int n, k;

int modexp (int a, int b) {
	if (b == 0) return 1;
	int ans = modexp(a, b/2);
	ans = (ans * ans) % mod;
	if (b & 1) ans = (ans * a) % mod;
	return ans;
}

int inv (int a) {
	return modexp(a, mod - 2);
}

int fac[2000005], invfac[2000005];
void compute() {
	fac[0] = 1;
	for (int i = 1; i <= 2000000; i += 1) {
		fac[i] = (fac[i - 1] * i) % mod;
	}
	invfac[2000000] = inv(fac[2000000]);
	for (int i = 2000000 - 1; i >= 0; i--) {
		invfac[i] = (invfac[i + 1] * (i + 1)) % mod;
	}
}

inline int c (int a, int b) {
	if (b > a) return 0;
	int ans = fac[a];
	ans *= invfac[a - b], ans %= mod;
	ans *= invfac[b], ans %= mod;
	return ans;
}

signed main () {
	start_routine();
	speed();
	#ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);	 
	// freopen("output.txt", "w", stdout);
	// freopen("errlog.txt", "w", stderr);
	#endif		

	int a[3]; for (int i = 0; i < 3; i++) cin >> a[i];
	sort(a, a + 3);
	for (int i = 0; i < 3; i += 1) {
		if (a[i] % 2 == 0) {
			cout << 0;
			return 0;
		}
	}
	cout << a[0] * a[1];
 	end_routine();		
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int a , b , c;
    cin>> a >> b >> c;
    if (a == 5 && b == 5 && c == 7)
        cout << "YES";
    else if (a == 5 && b == 7 && c == 5)
        cout << "YES";
    else if (a == 7 && b == 5 && c == 5)
        cout << "YES";
    else
        cout << "NO";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 100
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
const double EPS = 1e-8;
double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }

int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1;   // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(cross(b,c) < -EPS) return -1; // ????????????(b-a)????????´???????????????(c-a)????????¨?????????
  if(dot(b,c) < -EPS) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}

bool isIntersect(L s1, L s2){
  return ( ccw(s1.first,s1.second,s2.first) * ccw(s1.first,s1.second,s2.second) <= 0 &&
           ccw(s2.first,s2.second,s1.first) * ccw(s2.first,s2.second,s1.second) <= 0 );
}


vector<P> get_p(P a,double d,double r){
  vector<P> res(5);
  d=(d/360)*2*M_PI;
  P p=P(0,r)*P(cos(d),sin(d));
  res[0]=p+a;
  d=2*M_PI/5;
  for(int i=1;i<=4;i++){
    p=p*P(cos(d),sin(d));
    res[i]=p+a;
  }
  return res;
}
double getDistanceSP(L s, P p){
  if(dot(s.second - s.first, p - s.first) < -EPS) return abs(p - s.first);
  if(dot(s.first - s.second, p - s.second) < -EPS) return abs(p - s.second);
  return abs(cross(s.second - s.first, p - s.first) / abs(s.second - s.first));  }

double getDistanceSS(L s1, L s2){
  if(isIntersect(s1,s2)) return 0.0;
  return min( min(getDistanceSP(s1, s2.first), getDistanceSP(s1, s2.second)),
              min(getDistanceSP(s2, s1.first), getDistanceSP(s2, s1.second)));
}


double G[N][N],x[N],y[N],d[N],r[N];
double get_dis(int a,int b){
  vector<P> A=get_p(P(x[a],y[a]),d[a],r[a]);
  vector<P> B=get_p(P(x[b],y[b]),d[b],r[b]);
  double res=1e9;
  for(int i=0;i<5;i++)
    for(int j=0;j<5;j++)
      res=min(res,getDistanceSS(L(A[i],A[(i+2)%5]),L(B[j],B[(j+2)%5])));
  return res;
}

int main(){
  while(1){
  int n,s,g;
  cin>>n>>s>>g;
  if(!n&&!s&&!g)break;
  for(int i=0;i<n;i++)for(int j=0;j<n;j++)G[i][j]=1e9*(i!=j);
  for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>d[i]>>r[i];
  
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)if(i!=j) G[i][j]=get_dis(i,j);
  
  for(int k=0;k<n;k++)
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)
	G[i][j]=min(G[i][j],G[i][k]+G[k][j]);

  printf("%.20f\n",G[s-1][g-1]);
  }
  return 0;
}

Measured memory_bytes: 3464
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<stdlib.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<numeric>
#include<iomanip>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int count = 0;
	int count2 = 0;
	for (int i = 1; i<= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (i % j == 0) {
				count++;
			}
		}
		if (count == 8&&i%2==1) {
			count2++;
		}
		count = 0;
	}
	cout << count2 << endl;
}



Measured memory_bytes: 256
n = gets.to_i
a = n.times.map{gets.to_i}.sort

if n==2
  p (a[0]-a[1]).abs
  exit
end

ans = 0
l = 1
r = n-2
#
x = [a[-1],a[0]]
ans += (a[-1]-a[0]).abs
#
(n-2).times.map{|i|
  x.sort!
  if (x[1]-a[l]).abs > (x[0]-a[r]).abs
    ans += (x[1]-a[l]).abs
    x[1] = a[l]
    l += 1
  else
    ans += (x[0]-a[r]).abs
    x[0] = a[r]
    r -= 1
  end
}
ans

p ans

Measured memory_bytes: 5352
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}


int main(){
 ll n ;cin>> n ;
 vector<ll> A(n) ; rep(i,n) cin>>A[i] ;
 ll sum=0 ;
 rep(i,n){
  sum^=A[i] ;
 }
 rep(i,n){
   ll ans= sum^A[i] ;
   cout<<ans<<endl ;
 }
 return 0 ; 
}

Measured memory_bytes: 4804
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
#define pi acos(-1);
ll strtoint(string str);
int main(){
	fast;
	ll n,cnt=0; cin>>n;
	string s; cin>>s;
	for(auto i=0;i+1<n;++i){
		if(s[i]==s[i+1])continue;
		else
			++cnt;
	}
	++cnt;
	cout<<cnt<<'\n';
	return 0;
}
ll strtoint(string str){
	ll x=0;
	stringstream ss;
	ss<<str;
	ss>>x;
	return x;
}

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

using namespace std;

#define INF 3e18
#define ll long long
ll n, a, b, c, d;
vector<ll> x;
vector<ll> co;
map<ll, ll> mp;

ll mul(ll a, ll b)
{
    if(a >= INF/b) return INF;
    return (a*b);
}

ll calc(ll n)
{
    if(n == 0) return 0;
    if(n == 1) return d;
    if(mp.find(n) != mp.end()) return mp[n];
    ll mins = mul(n, d);
    for(int i=0; i<x.size(); i++){
        ll p = x[i], cost = co[i];
        if(n%p == 0){
            ll newN = n/p;
            mins = min(mins, min(mul(n-newN, d), cost)+calc(newN));
        }
        else if(n < p){
            ll hi = p - n%p;
            ll newN = (n+hi)/p;
            mins = min(mins, min(mul(n-newN, d), cost)+calc(newN)+(n-newN)*d);
        }
        else {
            ll lo = n%p;
            ll hi = p - lo;
            ll newN1 = (n-lo)/p;
            mins = min(mins, min(mul(n-newN1, d), cost)+calc(newN1)+lo*d);
            ll newN2 = (n+hi)/p;
            mins = min(mins, min(mul(n-newN2, d), cost)+calc(newN2)+hi*d);
        }
    }
    //cout << n << " " << mins << endl;
    return mp[n] = mins;
}

int main()
{
    //freopen("in.txt", "r", stdin);
    int cases;
    scanf("%d", &cases);
    while(cases--){
        scanf("%lld %lld %lld %lld %lld", &n, &a, &b, &c, &d);
        x = {2, 3, 5};
        co = {a, b, c};
        ll ans = calc(n);
        cout << ans << endl;
        mp.clear();
    }
}


Measured memory_bytes: 4440
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
typedef unsigned long long ull;
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define f(i,a,b) for(ll i=a;i<=b;i++)
// #define testcases ll t;cin>>t;while(t--)
#define dec(x) greater<x>()

/*** Define Values ***/
#define mx 200005
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-7
#define size1 100005
const char nl = '\n';

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define mem(name, value) memset(name, value, sizeof(name))

/*** STLs ***/
typedef vector <ll> vll;
typedef set <ll> sll;
typedef multiset <ll> msll;
typedef queue <ll> qll;
typedef map <ll, ll> mll;
typedef pair <ll, ll> pll;
typedef vector <pair <ll , ll> > vpll;

/*** Sorts ***/
#define all(v) (v).begin(), (v).end()
#define rev(v) reverse(all(v))
#define srt(v) sort(all(v))
#define srtGreat(v) sort(all(v), greater<ll>())
inline bool cmp(pll a, pll b) { if (a.ff == b.ff)return a.ss < b.ss; return a.ff > b.ff; }

#define en cout << '\n';
#define no cout << "NO" << '\n'
#define yes cout << "YES" << '\n'
#define case cout << "Case " << t++ << ": "

/*** Functions
ll BigMod(ll base, ll pow, ll modvalue){ if (pow == 0) return 1;  ll ans = BigMod(base, pow / 2, modvalue);ll total = ((ans % modvalue) * (ans % modvalue)) % modvalue;  if(pow % 2 == 0) return total; else{ return (total * (base % modvalue) ) % modvalue; } }
ll InverseMod(ll base, ll pow) { if(pow == 0) return 1; ll ans = InverseMod(base, pow / 2); ans = (ans * ans) % mod; if(pow & 1){ return (ans * base) % mod; } else{ return ans; } }
bool checkprime(ll num) { if(num < 2) return false; for(ll i = 2; i * i <= num; i++){ if(num % i == 0) return false; } return true; }
ll EularPHI(ll num) { double ans = num; for(ll i = 2; i * i <= num; i++){ if(num % i == 0){ while (num % i == 0) { num /= i; } ans *= (1.0 - (1.0 / (double)i)); } } if(num > 1) ans *= (1.0 - (1.0 / (double)num)); return (ll)ans; }
ll sumofdigit(ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}
ll countDigit(ll n) { if (n == 0) return 0; return 1 + countDigit(n / 10); }
ll countDigit(ll n) { return floor(log10(n) + 1); } //only positive
 ***/

template <class T> inline T gcd(T a, T b) {if (b == 0)return a; return gcd(b, a % b);}
template <class T> inline T lcm(T a, T b) {return a * b / gcd<T>(a, b);}
template <class T> inline T power(T b, T p) {ll ans = 1; while (p--) ans *= b; return ans;}
ll sumofdigit(ll n){ll sum=0;while(n){sum=sum+n%10;n=n/10;}return sum;}

vll v[100001];
ll vis[100001];

void dfs(ll node)
{
	vis[node]=1;

	for(auto child: v[node])
	{
		if(!vis[child])
			dfs(child);
	}
}

void solve()
{	
	ll n,m,a,b;
	cin>>n>>m;
	f(i,1,m)
	{
		cin>>a>>b;
		v[a].pb(b);
		v[b].pb(a);
	}

	ll cc=0;

	f(i,1,n)
	{
		if(!vis[i])
			dfs(i),cc++;
	}

	cout<<cc-1;
}


int main()
{

#ifndef ONLINE_JUDGE
	freopen("C:/Users/91731/Documents/input.txt", "r", stdin);
	freopen("C:/Users/91731/Documents/output.txt", "w", stdout);
	freopen("C:/Users/91731/Documents/error.txt", "w", stderr);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

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


Measured memory_bytes: 11040
#include "bits/stdc++.h"

// clang-format off
template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); }
char capitalize(char c) { return static_cast<char>(std::toupper(static_cast<unsigned char>(c))); }
// template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); }
// template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); }
// clang-format on

#define int long long
#define YES "Yes"
#define NO  "No"
#define MOD 1000000000+7

#define forit(v) for(auto it = v.begin(); it != v.end(); ++it)

using namespace std;

int f(int n, int x) {
  if (n == -1) return 0;
  else return n / x + 1;
}

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

  int num = 0;
  // num = numeric_limits<int>::max();
  // num = numeric_limits<int>::min();
  bool flag = false;
  // flag = true;

  int n, m; cin >> n >> m;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
  vector<int> c(m);
  vector<int> d(m);
  for (int i = 0; i < m; ++i) cin >> c[i] >> d[i];

  for (int i = 0; i < n; ++i) {
    int l = 0;
    int dist = 0;
    for (int j = 0; j < m; ++j) {
      if (j == 0) dist = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      else {
        int tmp = abs(a[i] - c[j]) + abs(b[i] - d[j]);
        if (tmp < dist) {
          l = j;
          dist = tmp;
        }
      }
    }
    cout << l + 1 << endl;
  }
  
    
  // cout << num << endl;
  // cout << (flag ? YES : NO) << endl;
  
  return 0;
}


Measured memory_bytes: 256
n, k = map(int, input().split())
count = [1] * n

# for i in range(k):
#    d[i] = int(input())
#   a.append(list(map(int, input().split())))

for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for j in a:
        count[j-1] = 0

print(sum(count))


Measured memory_bytes: 9052
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	q := getNextInt(scanner)
	aa := make([]int64, n)
	ss := make([]int64, n+1)
	odd := make([][]int64, 2)
	for i := 0; i < 2; i++ {
		odd[i] = make([]int64, n+1)
	}

	for i := 0; i < n; i++ {
		aa[i] = getNextInt64(scanner)
		ss[i+1] = ss[i] + aa[i]
		odd[0][i+1] = odd[0][i]
		odd[1][i+1] = odd[1][i]
		odd[i%2][i+1] += aa[i]
	}

	for i := 0; i < q; i++ {
		x := getNextInt64(scanner)
		l := -1
		r := n
		for l+1 < r {
			m := (l + r) >> 1
			if aa[m] < x {
				l = m
				continue
			}
			r = m
		}
		r = n
		for l+1 < r {
			m := (l + r) >> 1
			if (m+1)*2 <= n || (n-(n-m-1)*2-1 >= 0 && absint(aa[m]-x) < absint(x-aa[n-(n-m-1)*2-1])) {
				l = m
				continue
			}
			r = m
		}

		ans := ss[n] - ss[r]
		if r-(n-r) >= 0 {
			ans += odd[(n-1)%2][r-(n-r)]
		}
		fmt.Fprintln(writer, ans)
	}
}
func absint(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}


Measured memory_bytes: 9472
s = input()
a = int(s[0:2])
b = int(s[2:4])

if a >= 1 and a <= 12:
    if b >= 1 and b <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if b >= 1 and b <= 12:
        print("YYMM")
    else:
        print("NA")

Measured memory_bytes: 3060
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))


c1=0
c2=0

from math import floor
for i in range(n):
    if a[i]>b[i]:
        c1+=a[i]-b[i]
    elif a[i]<b[i]:
        c2+=floor((b[i]-a[i])/2)

if c2>=c1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 10440
S = input()

white_counter = 0
tile_color = '1'
for tile in S:
    if tile_color == tile:
        pass
    else:
        white_counter += 1
    if tile_color == '1':
        tile_color = '0'
    else:
        tile_color = '1'

black_counter = 0
tile_color = '0'
for tile in S:
    if tile_color == tile:
        pass
    else:
        black_counter += 1
    if tile_color == '1':
        tile_color = '0'
    else:
        tile_color = '1'

print(min(white_counter, black_counter))


Measured memory_bytes: 3188
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> pii;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod = 998244353;
int rnd(int x) { return mrand() % x; }
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
// head

const int MAXN = 2000 + 5;
int a[] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	//	freopen("a.in","r",stdin);
	//	freopen("a.out","w",stdout);
	int k;
	cin >> k;
	cout << a[k - 1] << endl;
	return 0;
}


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

using namespace __gnu_pbds; 
using namespace __gnu_cxx;
using namespace std;
using ll = long long;

#define eb emplace_back
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define precision(n) fixed<<setprecision(n)

#ifdef LOCAL
    #include "debug.h"
#else
    #define debug(...) 42
#endif

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);    
    #ifdef LOCAL
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
}

template<typename T> using oset = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update >;
template<typename T> using MinPriorityQueue = priority_queue <T, vector <T>, greater <T> >;
template<typename T> void done(T ans) {cout << ans << "\n"; exit(0);}

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937_64 mt(seed);

clock_t time_p=clock();
void printTime(){
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
  for(auto& i:x)
    input>>i;
  return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
  for(auto& i:x)
    output<<i<<' ';
  return output;
}

 

const int mod = 1e9;
const int N = 3e5 + 5;
template <typename T>
long long myrand(T m) {
    long long mod = m;
    long long x = mt()%mod;

    return x;
}

int main(){
    io();
    ll a, b, n;
    cin >> a >> b >> n;
    ll x = min(b - 1, n);

    ll ans = (a * x) / b;
    ans -= (a * (x / b));
    cout << ans;


}



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

int n, c;
ll ans;

int main(){
	scanf("%d", &n);
	for(int x; n--; ){
		scanf("%d", &x);
		ans += (x - 1) / (c + 1);
		if(!c) c = 1;
		else if(x == c + 1) c++;
	}
	printf("%lld\n", ans);
}

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

int main()
{
	long long s;
	std::cin >> s;
	
	int min = 56562;
	int diff;
	int num;
	int k = 1;
	while (true) {
		num = s / k % 1000;
		if (num < 100) break;
		diff = std::abs(753 - num);
		if (min > diff) min = diff;
		k *= 10;
	}
	
	std::cout << min << std::endl;
	
	return 0;
}


Measured memory_bytes: 3176
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
static const int MAX=10000;
static const int I=(1<<20);
static const int W=0;
static const int G=1;
static const int B=2;

int n;
vector<pair<int,int> > adj[MAX];

void di(){
  priority_queue<pair<int,int> > PQ;
  int color[MAX];
  int d[MAX];
  for(int i=0;i<n;i++){
    d[i]=I;
    color[i]=W;
  }


  d[0]=0;
  PQ.push(make_pair(0,0));
  color[0]=G;

  while(!PQ.empty()){
    pair<int,int> f=PQ.top(); PQ.pop();
    int u=f.second;
    color[u]=B;

    if(d[u] < f.first*(-1)) continue;

    for(int j=0;j<adj[u].size();j++){
      int v = adj[u][j].first;
      if(color[v]==B) continue;
      if(d[v]>d[u]+adj[u][j].second){
        d[v]=d[u]+adj[u][j].second;
        PQ.push(make_pair(d[v]*(-1),v));
        color[v]=G;
      }
    }
  }


  for(int i=0;i<n;i++){
    cout << i << " " << (d[i]==I?-1:d[i]) << endl;
  }
}


int main(){
  int k,u,v,c;

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

  di();

  return 0;
}





Measured memory_bytes: 7992
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		long k = sc.nextLong();

		char c[] = s.toCharArray();
		int one = 0;
		if (c[0] == '1') {
			while (c[one] == '1') {
				one++;
				if(one==s.length()){

					break;
				}
			}
		}
		long i=one;

		// 1からiまで
if(k<=i){
	System.out.println(1);
}else{
	System.out.println(c[one]);
}
	}
}

Measured memory_bytes: 21716
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 4e3 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int a, b, c;
	cin >> a >> b >> c;
	int x;
	cin >> x;
	int cnt = 0;
	for (int i = 0; i <= a; i++)
	{
		for (int j = 0; j <= b; j++)
		{
			for (int k = 0; k <= c; k++)
			{
				if (i * 500 + j * 100 + k * 50 == x)
				{
					cnt++;
				}
			}
		}
	}
	cout << cnt << endl;
	return 0;
}


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

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    ll r=a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}
int main (){
    int n,q;
    cin >> n >>q;
    string s;
    cin >> s;
    vector<int>rui(n);
    vector<int>ans(q);
    int ac=0;
    bool flag=false;
    rep(i,n){
        if(s[i]=='A') flag=true;
        else{
            if(s[i]=='C'&&flag==true) ac++;
            flag=false;
        }
        rui[i]=ac;
    }
    rep(i,q){
        int l,r;
        cin >> l >>r;
        ans[i]=rui[r-1]-rui[l-1];
    }
    rep(i,q) cout <<ans[i] <<endl;
    return 0;
}



Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
using namespace std;
int n,c,k,cnt=2000000000,until,ans,t[100005];
int main()
{
	scanf("%d%d%d",&n,&c,&k);
	for(int i=1;i<=n;++i) scanf("%d",&t[i]);
	sort(t+1,t+1+n);
	for(int i=1;i<=n;++i) {
		++cnt;if(cnt>c) {++ans;cnt=1;until=t[i]+k;}
		else if(until<t[i]) {cnt=1;++ans;until=t[i]+k;}
	}
	printf("%d\n",ans);
	return 0;
}

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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

const int MAX_N = 45;

int fib[MAX_N];
int n;

void init(){
    rep(i,MAX_N) fib[i] = -1;
}

int calc_fib(int _n){
    int fib1, fib2;
    if(fib[_n-1] != -1) fib1 = fib[_n-1];
    else fib1 = calc_fib(_n-1);
    if(fib[_n-2] != -1) fib2 = fib[_n-2];
    else fib2 = calc_fib(_n-2);
    return fib[_n] = fib1 + fib2;
}

int main()
{
    cin >> n;
    init();
    fib[0] = fib[1] = 1;
    cout << calc_fib(n) << endl;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#include <math.h>
#define _USE_MATH_DEFINES
using namespace std;

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    double R;
    cin >> R;

    cout << 2 * R * M_PI << "\n";
}

Measured memory_bytes: 3804
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
	vint ans(110,0);
	queue<int> q2,q5;
	int cnt=0;
	vint seki(17,0);
	vint vis(110,-1);
	for(int i=0;;++i){
		rep(j,17){
			if(seki[j]) seki[j]--;
		}
		if(i%5==0&&cnt<100){
			cnt++;
		}
		bool ff=false;
		rep(j,cnt){
			if(vis[j]==-1){
				ff=true;
				if(j%5==1){
					rep(k,17-4){
						if(seki[k]==0&&seki[k+1]==0&&seki[k+2]==0&&seki[k+3]==0&&seki[k+4]==0){
							seki[k]=seki[k+1]=seki[k+2]=seki[k+3]=seki[k+4]=17*(j%2)+3*(j%3)+19;
							vis[j]=i;
							break;
						}
					}
				}
				else{
					bool f=false;
					rep(k,16){
						if(seki[k]==0&&seki[k+1]==0){
							seki[k]=seki[k+1]=17*(j%2)+3*(j%3)+19;
							f=true;
							vis[j]=i;
							break;
						}
					}
					if(!f) break;
				}
				if(vis[j]==-1) break;
			}
		}
		if(cnt==100&&!ff) break;
	}
	// rep(i,10){
	// 	cout<<vis[i]<<endl;
	// }
	int n;
	while(cin>>n){
		cout<<vis[n]-n*5<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

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

int main()
{
    int a,b,k;
    cin >> a >> b >> k;
    vector<int> v;
    for(int i=1; i<= max(a,b); i++){
        if(a%i == 0 && b%i == 0) v.push_back(i);
    }
    
    cout << v[v.size() - k] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }

int main() {
    map<char,int> m;
    char c;
    while(cin >> c)m[c]++;
    for(auto a : m)if(a.second%2){
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long l[86];
int n;
int main() {
    l[0]=2; l[1]=1;
    for (int i=2; i<=86; i++) l[i]=l[i-1]+l[i-2];
    
    cin >> n; cout << l[n]; 
}

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
using namespace std;

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

    int len = s.length();

    vector<int> childN(len);
    vector<bool> stopArea(len);
    auto posS = s.find("RL");
    while (posS != string::npos) {
        stopArea[posS] = true;
        stopArea[posS+1] = true;
        posS = s.find("RL", posS+1);
    }

    char past;
    int pos, cnt;
    for (int i = 0; i < len; i++) {
        if (i != 0 && !stopArea[i] && past == s[i]) {
            cnt++;  // 帳尻合わせ --でもよい
            if (cnt%2 == 0) childN[pos]++;
            else if (s[pos] == 'R') childN[pos+1]++;
            else childN[pos-1]++;
            continue;
        }

        cnt = 0;
        pos = i;
        while (!stopArea[pos]) {
            if (s[pos] == 'R') pos++;
            else pos--;
            cnt++;
        }
        if (cnt % 2 == 0) childN[pos]++;
        else if (s[pos] == 'R') childN[pos+1]++;
        else childN[pos-1]++;
        
        past = s[pos];
    }

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

Measured memory_bytes: 1024
#include <bits/stdc++.h>
typedef long long ll;
const ll mod=1e9+7;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
int64_t rs64() {
	int64_t n;
	scanf("%" SCNd64, &n);
	return n;
}
#define MOD 1000000007
template<int mod>
struct ModInt{
	int x;
	ModInt():x(0){}
	ModInt(long long y):x(y>=0?y%mod:(mod-(-y)%mod)%mod){}
	ModInt &operator+=(const ModInt &p){
		if((x+=p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator-=(const ModInt &p){
		if((x+=mod-p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator*=(const ModInt &p){
		x=(int)(1LL*x*p.x%mod);
		return *this;
	}
	ModInt &operator/=(const ModInt &p){
		*this*=p.inverse();
		return *this;
	}
	ModInt &operator^=(long long p){
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator-()const{return ModInt(-x);}
	ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
	ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
	ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
	ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
	ModInt operator^(long long p)const{return ModInt(*this)^=p;}
	bool operator==(const ModInt &p)const{return x==p.x;}
	bool operator!=(const ModInt &p)const{return x!=p.x;}
	explicit operator int() const { return x; }						   // added by QCFium
	ModInt operator=(const int p) {x = p; return ModInt(*this);} // added by QCFium
	ModInt inverse()const{
		int a=x,b=mod,u=1,v=0,t;
		while(b>0){
			t=a/b;
			a-=t*b;
			std::swap(a,b);
			u-=t*v;
			std::swap(u,v);
		}
		return ModInt(u);
	}
	friend std::ostream &operator<<(std::ostream &os,const ModInt<mod> &p){
		return os<<p.x;
	}
	friend std::istream &operator>>(std::istream &is,ModInt<mod> &a){
		long long x;
		is>>x;
		a=ModInt<mod>(x);
		return (is);
	}
};
typedef ModInt<MOD> mint;

struct MComb {
	std::vector<mint> fact;
	std::vector<mint> inversed;
	MComb(int n) { // O(n+log(mod))
		fact = std::vector<mint>(n+1,1);
		for (int i = 1; i <= n; i++) fact[i] = fact[i-1]*mint(i);
		inversed = std::vector<mint>(n+1);
		inversed[n] = fact[n] ^ (MOD-2);
		for (int i = n - 1; i >= 0; i--) inversed[i]=inversed[i+1]*mint(i+1);
	}
	mint ncr(int n, int r) {
		return (fact[n] * inversed[r] * inversed[n-r]);
	}
	mint npr(int n, int r) {
		return (fact[n] * inversed[n-r]);
	}
	mint nhr(int n, int r) {
		assert(n+r-1 < (int)fact.size());
		return ncr(n+r-1, r);
	}
};

mint ncr(int n, int r) {
	mint res = 1;
	for (int i = n - r + 1; i <= n; i++) res *= i;
	for (int i = 1; i <= r; i++) res /= i;
	return res;
}

int main() {
	ll x,y;
	x = ri();
	y = ri();
	if((x+y)%3){
		std::cout<<0;
	}else{
		ll m = (2*x-y)/3;
		ll n = (2*y-x)/3;
		if(m<0||n<0){
			std::cout<<0;
			return 0;
		}
		//std::cout<<m<<" "<<n<<"\n";
		MComb comb(m+n);
		std::cout<<comb.ncr(m+n,n);
	}
	
	return 0;
}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main()
{
    string n;
    cin >> n;
    int s = 0;
    for (int i = 0; i < n.length(); i++)
    {
        if (n[i] == '7')
        {
            s = 1;
        }
    }
    if (s == 1)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

int main()
{
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define NIL 2000000001
typedef struct{
  int p,l,r,key; 
}node;

node tree[500001];
queue<int> q[2];
int root=NIL;

void insert(int key,int i){
  node z={NIL,NIL,NIL,key};
  int x=(root==NIL?NIL:root),y=NIL;
  if(root==NIL)root=i;
  while(x!=NIL){
    y=x;
    if(z.key<tree[x].key){
      x=tree[x].l;
    }else{
      x=tree[x].r;
    }
  }
  z.p=y;
  if(y==NIL){
    tree[0]=z;
  }else if(z.key<tree[y].key){
    tree[y].l=i;
  }else {
    tree[y].r=i;
  }
  tree[i]=z;
}

void print(int n=0){
  if(n==NIL)return;
  q[1].push(tree[n].key);
  print(tree[n].l);
  q[0].push(tree[n].key);
  print(tree[n].r);
}

int find(int key){
  int f=0,x=root;
  while(x!=NIL){
    if(tree[x].key>key){
      x=tree[x].l;
    }else if(tree[x].key<key){
      x=tree[x].r;
    }else{
      f=1;
      break;
    }
  }
  return f;
}

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string a;
    cin>>a;
    
    if(a[0]=='i'){   
      int k;
      cin>>k;
      insert(k,i);
      
    }else if(a[0]=='f'){
      int key;
      cin>>key;
      cout<<(find(key)?"yes":"no")<<endl;
    }else{
      print();
      for(int j=0;j<2;j++){
	while(!q[j].empty()){
	  cout<<" "<<q[j].front();
	  q[j].pop();
	}
	cout<<endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 12388
import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    k = ni()
    l = 50
    ans = [l - 1 for _ in range(l)]

    for i in range(l):
        ans[i] += k // l
        
        tgt = k % l
        if i < tgt:
            ans[i] += l
            ans[i] -= tgt - 1
        else:
            ans[i] -= tgt

    print(l)
    print(*ans, sep=" ")


if __name__ == '__main__':
    main()


Measured memory_bytes: 9456
N, Y = list(map(int, input().split()))

#10000 x + 5000 y + 1000 (N-x-y) = Y
#9000 x + 4000 y + 1000N  = Y

for x in range(2001):
    y = (Y - 1000 * N - 9000 * x) // 4000
    z = N - x - y
    if y>=0 and z>=0 and (Y-1000*N- 9000*x)%4000==0:
        z = N-x-y
        print(x,y,z)
        exit()

print(-1,-1,-1)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
class Radix {
private:
  const char* s;
  int a[128];
public:
  Radix(const char* s = "0123456789ABCDEF") : s(s) {
    int i;
    for(i = 0; s[i]; ++i)
      a[(int)s[i]] = i;
  }
  std::string to(long long p, int q) {
    int i;
    if(!p)
      return "0";
    char t[64] = { };
    for(i = 62; p; --i) {
      t[i] = s[p % q];
      p /= q;
    }
    return std::string(t + i + 1);
  }
  std::string to(const std::string& t, int p, int q) {
    return to(to(t, p), q);
  }
  long long to(const std::string& t, int p) {
    int i;
    long long sm = a[(int)t[0]];
    for(i = 1; i < (int)t.length(); ++i)
      sm = sm * p + a[(int)t[i]];
    return sm;
  }
};

int main(void) {
    long long int N, K,ans=0;
    cin >> N >> K;
/*
    long long int tmp = N;

    while(tmp < K){
      if(tmp%K)
        s.push_back(tmp%K);

      tmp = tmp/K;
    }
*/
Radix r;
    string s;
    s = r.to(N,K);
    cout << s.size() << endl;

    return 0;
}


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

public class Main {
    public static void main(String[] args) {
        MyScanner scn = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        // Start writing your solution here. -------------------------------------

        /*
         * int n = sc.nextInt(); // read input as integer long k = sc.nextLong(); //
         * read input as long double d = sc.nextDouble(); // read input as double String
         * str = sc.next(); // read input as String String s = sc.nextLine(); // read
         * whole line as String
         * 
         * int result = 3*n; out.println(result); // print via PrintWriter
         */

        // Stop writing your solution here. -------------------------------------

        long x = scn.nextLong();
        long b = scn.nextLong();
        long t = scn.nextLong();

        out.println(((x + b - 1) / b) * t);
        out.close();
    }

    public static PrintWriter out;

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

Measured memory_bytes: 32844
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int mod=10000,MAX=203,INF=1<<30;

using namespace std;

int main(){
    ll K;
    cin >> K;
    ll A[K];
    rep(i, K){
        cin >> A[K-i-1];
    }

    ll l = 2;
    ll r = 2;

    rep(i, K){
        if (A[i] > r) {
            cout << -1 << endl;
            return 0;
        } else {
            ll tmp = l / A[i];
            if (tmp > 0 && l % A[i] == 0) {
                l = l;
            } else if (tmp > 0 && A[i] * (tmp + 1) <= r) {
                l = A[i]*(tmp+1);
            } else if (tmp > 0 && A[i] * (tmp + 1) > r){
                cout << -1 << endl;
                return 0;
            } else {
                l = A[i];
            }
            tmp = r / A[i];

            r = A[i] * tmp + A[i] - 1;



        }
//        cout << l << " " << r << endl;
    }
    cout << l << " " << r << endl;
}

Measured memory_bytes: 1024
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
int a[200100];
int main()
{
	int n;cin>>n;
	rep(i,n){
		cin>>a[i];a[i]-=i;
	}
	sort(a,a+n);
	lint out=0;
	rep(i,n) out+=abs(a[i]-a[n/2]);
	cout<<out<<endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

int a, b, c, ans;
int na, nb, nc;
int main()
{
	ans = 0;
	na = nb = nc = 0;
	scanf("%d %d %d", &a, &b, &c);
	if(a % 2 != 1 && a == b && b == c) printf("-1\n");
	else {
		if(a % 2 != 1 && b % 2 != 1 && c % 2 != 1) {
			while(true)
			{
				if(na % 2 == 1 || nb % 2 == 1 || nc % 2 == 1) break;
				ans++;
				na = (b + c) / 2;
				nb = (a + c) / 2;
				nc = (a + b) / 2;
				a = na;
				b = nb;
				c = nc;
			}
			printf("%d\n", ans);
		}
		else printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll a[100010],b[100010];
int main(){
    int na,nb,nm;
    scanf("%d%d%d",&na,&nb,&nm);
    rep(i,0,na)scanf("%lld",a+i);
    rep(i,0,nb)scanf("%lld",b+i);
    ll ans=1e9;
    rep(_,0,nm){
        int x,y,c;
        scanf("%d%d%d",&x,&y,&c);
        ans=min(ans,a[x-1]+b[y-1]-c);
    }
    sortup(a,na);
    sortup(b,nb);
    printf("%lld",min(ans,a[0]+b[0]));
}


Measured memory_bytes: 2556
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;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 SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VRSORT(v) sort(v.rbegin(), v.rend());//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int>a(4,0);;
  REP(i,4){
    int n;
    cin>>n;
    if(n==1) a[0]++;
    if(n==9) a[1]++;
    if(n==7) a[2]++;
    if(n==4) a[3]++;
  }
  REP(i,4){
    if(a[i]==0){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}

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

using namespace std;

int main() {
	double x = 0.0, y = 0.0;
	int deg = 90;
	while (1) {
		int r, t;
		scanf("%d,%d", &r, &t);
		if (!r&&!t)
			break;
		x += r * cos(deg*M_PI/180.0);
		y += r * sin(deg*M_PI/180.0);
		deg -= t;
	}
	printf("%d\n%d\n", (int)x, (int)y);
	return 0;
}

Measured memory_bytes: 0
N = int(input())
ans = []

for A in range(1,1+int(N/2)):
  tmp = 0
  B = N - A
  A = str(A)
  B = str(B)
  for i in range(0,len(A)):
    tmp += int(A[i])
  for i in range(0,len(B)):
    tmp += int(B[i])
  ans.append(tmp)

print(min(ans))

Measured memory_bytes: 9244