akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
//#include "testlib.h"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define int long long
#define ll long long
#define M 1000000007
#define MM 998244353
#define inputarr(a,n) for(int i=0;i<n;++i) cin>>a[i]
#define GCD(m,n) __gcd(m,n)
#define LCM(m,n) m*(n/GCD(m,n))
#define mii  map<ll ,ll >
#define sz(a) (int)a.size()
#define msi  map<string,ll >
#define rep(a,b)    for(ll i=a;i<b;i++)
#define rep0(n)    for(ll i=0;i<n;i++)
#define repi(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define vi vector<ll>
#define vs vector<string>
#define ppb pop_back
#define endl '\n'
#define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define r0 return 0;
#define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
#define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define Set(a, s) (a, s, sizeof (a))
#define FOR repi
#define pii pair<int,int>
#define REVERSE(v) reverse(all(v))
#define trav(a, x) for(auto& a : x)
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl
#define debug cerr<<"bhau"<<endl
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
template<typename T, typename U> static inline void amin(T &x, U y) 
{ 
    if (y < x) 
        x = y; 
}
template<typename T, typename U> static inline void amax(T &x, U y) 
{ 
    if (x < y) 
        x = y; 
}
 
ll max(ll a, ll b) { return (a > b)? a : b;}
int min(int a, int b) { return (a < b)? a : b;} 


int solve(){
	int h,w;cin>>h>>w;
	int total=h*w;
	int ans=total/2;
	if(total % 2) ans++;
	if(h==1 || w==1) return cout<<1,0;
	cout<<ans<<endl;



    return 0;
}
signed main(){
    asdf
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
typedef long long ll;
typedef unsigned long long ull;
typedef long double LD;
using namespace std;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const ll INF64 = 1e18;
const ll INF264 = 0x3f3f3f3f3f3f3f3f;
const double INFD = 1e30;
const double EPS = 1e-9;
const double PI = acos(-1);
const int MOD = 998244353;
template <typename T>
inline T read() {
    T X = 0, w = 0;
    char ch = 0;
    while (!isdigit(ch)) {
        w |= ch == '-';
        ch = getchar();
    }
    while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
    return w ? -X : X;
}
const int MAXN = 55;
int n, m, k;
int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1, 0, -1};
int dr2[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int dc2[8] = {1, 0, -1, 1, 0, -1, 1, -1};
int CASE = 1;
ll dp[MAXN][10005];
bool vis[MAXN][10005];
struct Edge {
    int u, v, a, b;
};
vector<Edge> G[MAXN];
int C[MAXN], D[MAXN];
struct Node {
    int u, c;
    ll dis;
    bool operator<(const Node& node) const { return dis > node.dis; }
};
priority_queue<Node> PQ;
int main() {
#ifdef LOCALLL
    freopen("in", "r", stdin);
    freopen("out", "w", stdout);
#endif
    int s;
    scanf("%d%d%d", &n, &m, &s);
    memset(dp, 0x3f, sizeof(dp));
    for (int i = 0; i < m; i++) {
        int u = read<int>(), v = read<int>(), a = read<int>(), b = read<int>();
        G[u].push_back({u, v, a, b});
        G[v].push_back({v, u, a, b});
    }
    for (int i = 1; i <= n; i++) {
        scanf("%d%d", &C[i], &D[i]);
    }
    s = min(s, 5000);
    dp[1][s] = 0;
    PQ.push({1, s, 0});
    while (!PQ.empty()) {
        auto u = PQ.top();
        PQ.pop();
        if (u.c < 5000) {
            ll dist = dp[u.u][u.c] + D[u.u];
            if (dist < dp[u.u][u.c + C[u.u]]) {
                dp[u.u][u.c + C[u.u]] = dist;
                PQ.push({u.u, u.c + C[u.u], dist});
            }
        }
        for (auto e : G[u.u]) {
            if (u.c >= e.a) {
                ll dist = dp[u.u][u.c] + e.b;
                if (dist < dp[e.v][u.c - e.a]) {
                    dp[e.v][u.c - e.a] = dist;
                    PQ.push({e.v, u.c - e.a, dist});
                }
            }
        }
    }
    for (int i = 2; i <= n; i++) {
        ll ans = INF264;
        for (int j = 0; j <= 5000; j++) {
            ans = min(ans, dp[i][j]);
        }
        printf("%lld\n", ans);
    }
    return 0;
}

Measured memory_bytes: 11676
import numpy as np
n,*a = map(int,open(0).read().split())
a = np.array(a)
mod = 10**9+7
ans = 0
for i in range(61):
  b = np.count_nonzero(a>>i&1)
  ans += b*(n-b)*1<<i
print(ans%mod)

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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
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; }
//end



int main(){
   ll n,k; cin>>n>>k;
   ll a=n/k;
   printf("%lld\n",min(n-k*a,-(n-k*(a+1))));
   return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int x;
    int i = 1;
    while (1)
    {
        scanf("%d", &x);
        if (x == 0)
        {
            break;
        }
        else
        {
            printf("Case %d: %d\n", i, x);
        }
        i++;
    }
    return 0;
}


Measured memory_bytes: 1988
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

#define PUTLINE cout<<__LINE__<<endl;

int main() {
	string str1,str2,str3;
	for(;;){
		cin>>str1;
		if(str1=="-")break;
		cin>>str2>>str3;
		int i=0,j=1,k=0;
		char now=str2[0];
		string res="";
		for(;i<str1.size()||j<str2.size();){
			if(now==str3[k]){
				now=str1[i++];
				++k;
			}else{
				res+=now;
				now=str2[j++];
			}
		}
		if(now!=str3[str3.size()-1])res+=now;
		cout<<res<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;
public class Main
{
	static int h,w;
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		int dx[]={1,0,-1,0};
		int dy[]={0,1,0,-1};
		int M=1000000;
		for(;;)
		{
			w=in.nextInt();
			h=in.nextInt();
			if((w|h)==0)
				return;
			int field[][]=new int[h][w];
			int cost[]=new int[4];
			for(int i=0;i<h;i++)
				for(int j=0;j<w;j++)
					field[i][j]=in.nextInt();
			for(int i=0;i<4;i++)
				cost[i]=in.nextInt();

			int dp[][][]=new int[h][w][4];//現在置と向いてる方向
			boolean visit[][][]=new boolean[h][w][4];
			visit[0][0][0]=true;

			for(int i=0;i<h;i++)
				for(int j=0;j<w;j++)
					for(int k=0;k<4;k++)
						dp[i][j][k]=M;
			dp[0][0][0]=0;
			for(;;)
			{
				boolean flag=false;
				for(int i=0;i<h;i++)
					for(int j=0;j<w;j++)
						for(int k=0;k<4;k++)
						{
							if(!visit[i][j][k])
								continue;
							for(int l=0;l<4;l++)
							{
								int addcost=cost[l];
								int nextk=k;
								if(field[i][j]==l)
									addcost=0;
								nextk=(k+l)%4;
								int nexth=i+dy[nextk];
								int nextw=j+dx[nextk];
								if(inner(nexth,nextw))
								{
									if(dp[nexth][nextw][nextk]>dp[i][j][k]+addcost)
									{
										dp[nexth][nextw][nextk] = dp[i][j][k] + addcost;
										flag=visit[nexth][nextw][nextk]=true;
									}
								}
							}
						}
				if(!flag)
					break;
			}
			int ans=M; 
			for(int k=0;k<4;k++) 
				ans= Math.min(ans, dp[h-1][w-1][k]);
			System.out.println(ans);
		}
	}

	static boolean inner(int y,int x)
	{
		return x>=0 && y>=0 && x<w && y<h;
	}
}

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

using namespace std;

int main(void) {
  long long N;
  cin >> N;
  
  long long x = 100;
  int cnt = 0;
  
  while (x < N) {
    cnt++;
    x *= 1.01;
    
    if (x >= N) {
      cout << cnt << endl;
      break;
    }
  }

  return 0;
}

Measured memory_bytes: 3636
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;




int main() {
ll N,A,B;
cin>>N>>A>>B;
if(A>B){
  cout<<0<<endl;
  return 0;
}
if((N==1)&&(A<B)){
  cout<<0<<endl;
  return 0;
}
cout<<A+B*(N-1)-(N-1)*A-B+1<<endl;
return 0;
}

Measured memory_bytes: 3592
import math
import itertools

n = int(input())
x, y = [], []
for _ in range(n):
    i, j = map(int, input().split())
    x.append(i)
    y.append(j)

ans = []
for i in itertools.permutations([i for i in range(n)]):
    length = 0
    for j in range(n-1):
        length += math.sqrt((x[i[j]] - x[i[j+1]])**2 + (y[i[j]] - y[i[j+1]])**2)
    ans.append(length)
print(sum(ans)/len(ans))

Measured memory_bytes: 4400
n = int(input())
a = list(map(int, input().split()))
dp = [[0] * n for _ in range(n)]
for i in range(n):
    dp[i][i] = a[i]

for i in range(n - 2, -1, -1):
    for j in range(i + 1, n):
        dp[i][j] = max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1])

print(dp[0][n - 1])

Measured memory_bytes: 113116
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] a = new int[5];
		int i,j;
		for(i = 0; i < 5; i++)
			a[i] = scan.nextInt();

		int k = scan.nextInt();

		for(i = 0; i < 4; i++) {
			for(j = i + 1; j < 5; j++) {
				if(Math.abs(a[i] - a[j]) > k) {
					System.out.println(":(");
					return;
				}
			}
		}
		System.out.println("Yay!");
	}
}


Measured memory_bytes: 21204
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int main(int argc, void **arg)
{
    int n, a, b;
    int train, taxi;

    scanf("%d %d %d", &n, &a, &b);

    train = n * a;
    taxi = b;

    if( train > taxi ) {
        printf("%d\n", taxi);
    } else {
        printf("%d\n", train);
    }

    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)

int main() {
    int a, b, k; cin >> a >> b >> k;
    int c = 0;
    for (int i = 100; i >= 0; --i) {
        if (a % i == 0 && b % i == 0) {
            c++;
        }
        if (c == k) {
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<string> s(8);
    for(int i=0; i<8; ++i)
        cin >> s[i];

    for(int i=0; i<3; ++i){
        vector<string> ret(8, string(8, ' '));
        for(int j=0; j<8; ++j){
            for(int k=0; k<8; ++k){
                ret[k][7-j] = s[j][k];
            }
        }

        cout << ((i+1)*90) << endl;
        for(int j=0; j<8; ++j)
            cout << ret[j] << endl;

        s = ret;
    }

    return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int X, A, B;
	cin >> X >> A >> B;
	X -= A;
	X %= B;
	cout << X << endl;
}

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

int main() {

    int r;
    scanf("%d",&r);

    //char s[4];
    //scanf("%s",s);
   
    if(r<1200){
        printf("ABC");
    }else if(r<2800){
        printf("ARC");
    }else{
        printf("AGC");
    }
    return 0;

}


Measured memory_bytes: 128
X,Y,A,B,C=map(int,input().split())
P=sorted([int(x) for x in input().split()])
Q=sorted([int(x) for x in input().split()])
R=sorted([int(x) for x in input().split()],reverse=True)

p=A-X
q=B-Y

final=sorted(P[p:]+Q[q:])

ans=sum(final)

i=0

for item in R:
	if item > final[i]:
		ans-=final[i]
		ans+=item
		i+=1

print(ans)


Measured memory_bytes: 23200
#include <bits/stdc++.h>
using namespace std;
int INF = 1000000000;
int main(){
  int N, M, X;
  cin >> N >> M >> X;
  vector<vector<int>> A(N, vector<int>(M));
  vector<int> C(N);
  for (int i = 0; i < N; i++){
    cin >> C[i];
    for (int j = 0; j < M; j++){
      cin >> A[i][j];
    }
  }
  int ans = INF;
  for (int i = 0; i < (1 << N); i++){
    vector<int> sum(M, 0);
    int cost = 0;
    for (int j = 0; j < N; j++){
      if ((i >> j) & 1){
        cost += C[j];
        for (int k = 0; k < M; k++){
          sum[k] += A[j][k];
        }
      }
    }
    bool flg = true;
    for (int j = 0; j < M; j++){
      if (sum[j] < X){
        flg = false;
      }
    }
    if (flg){
      ans = min(ans, cost);
    }
  }
  if (ans == INF){
    cout << -1 << endl;
  } else {
    cout << ans << endl;
  }
}

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

// colours
#define RESET   "\033[0m"
#define BLACK   "\033[30m"
#define RED     "\033[31m"
#define GREEN   "\033[32m"
#define YELLOW  "\033[33m"
#define BLUE    "\033[34m"
#define MAGENTA "\033[35m"
#define CYAN    "\033[36m"
#define WHITE   "\033[37m"

// debugging : values of variables
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << YELLOW << "debug statement : " << *it << " = " << a << RESET << endl;
    err(++it, args...);
} 

void testCase(){
    int k, a, b;
    cin>>k>>a>>b;
    bool flag = false;
    for(int i = a; i <= b; i++){
        if(i%k == 0){
            flag = true;
            break;
        }
    }
    if(flag) cout<<"OK"<<endl;
    else cout<<"NG"<<endl;
}

int main(){
    int t;
    t = 1;
    // cin>>t;
    while(t--){
        testCase();
    }
}

Measured memory_bytes: 3636
N,M=map(int,input().split())

A=list(map(int,input().split()))
A.sort(reverse=True)
honsuu=[0,2,5,5,4,5,6,3,7,6]

def ketadp(N,M,A):
  dp=[0]*(N+1)
  for i in range(N):
    for j in A:
      if (i+1-honsuu[j])==0 or (i+1-honsuu[j]>0 and dp[i+1-honsuu[j]]!=0):
        dp[i+1]=max(dp[i+1],dp[i+1-honsuu[j]]+1)
  return dp
  

ans=""
keta=ketadp(N,M,A)
remain=keta[N]
match=N
#print(keta)

while(match>0):
  for i in A:
    #print(i,match,remain,keta[match-honsuu[i]])
    if match-honsuu[i]<0:
      continue;
    if(keta[match-honsuu[i]]==remain-1) and not (match-honsuu[i]!=0 and remain==1):
      ans+=str(i)
      remain-=1
      match-=honsuu[i]
      break;
print(ans)

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

#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

class ModInt{
public:
    long long n;
    int p;

    ModInt(){
    }

    //値と割る値を受け取って、オブジェクトを返す
    ModInt(long long _n, int _p){
        p = _p;
        n = _n % _p;

        //負の値を受け取ったときには正の値に戻す
        if(n < 0){
            n += p;
        }
    }

    ModInt operator+(ModInt a){

        ModInt tmp = ModInt(*this);

        tmp.n += a.n;

        if(tmp.n > tmp.p){
            tmp.n -= tmp.p;
        }
        
        return tmp;
    }

    ModInt operator-(ModInt a){

        ModInt tmp = ModInt(*this);

        tmp.n -= a.n;

        if(tmp.n < 0){
            tmp.n += tmp.p;
        }

        return tmp;
    }

    ModInt operator*(ModInt a){

        ModInt tmp = ModInt(*this);

        tmp.n = (tmp.n * a.n) % tmp.p;

        return tmp;
    }

    int modpow(int b, int k){
        if(k == 0){
            return 1;
        }else if(k % 2 == 1){
            long long tmp = b;
            tmp = tmp * modpow(b, k - 1) % p;
            
            return tmp;
        }else{
            long long tmp = modpow(b, k / 2);
            return tmp * tmp % p;
        }
    }

    int modinv(int b){
        return modpow(b, p - 2);
    }

    ModInt operator/(ModInt a){

        ModInt tmp = ModInt(*this);

        tmp.n = tmp.n * modinv(a.n) % tmp.p;
        return tmp;
    }
};

ModInt mypow(ModInt a, int x){

    if(x == 0) return ModInt(1, MODN);
    if(x == 1) return a;

    if(x % 2 == 0){
        ModInt tmp = mypow(a, x / 2);
        return tmp * tmp;
    }else{
        ModInt tmp = mypow(a, (x - 1) / 2);
        return tmp * tmp * a;
    }
}

int main(){

    int n,k;
    cin >> n >> k;

    vector<ModInt> ansv(k + 1, ModInt(0, MODN));

    for(int i = k; i >= 1; i--){
        ModInt tmp = ModInt(k / i, MODN);
        tmp = mypow(tmp, n);

        for(int j = i * 2; j <= k; j = j + i){
            tmp = tmp - ansv[j];
        }

        ansv[i] = tmp;
    }

    ModInt ans = ModInt(0, MODN);

    rep(i, k){
        ans = ans + ansv[i + 1] * ModInt(i + 1, MODN);
    }

    cout << ans.n << endl;
    
    return 0;
}


Measured memory_bytes: 4844
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split(' ');
	var n = toInt(input[0]);
	var k = toInt(input[1]);
	var ans = 0;
	if((n%2)*(k%2)===0){
		ans = 'No';
	}else{
		ans = 'Yes';
	}
	console.log(ans);

}

Measured memory_bytes: 21064
#include <cstdio>

int main() {
  int N;
  scanf("%d", &N);

  int A = N / 1000;
  N %= 1000;
  int B = N / 100;
  N %= 100;
  int C = N / 10;
  int D = N % 10;

  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2; ++k) {
        int lhs = A;
        lhs += (i? B:-B);
        lhs += (j? C:-C);
        lhs += (k? D:-D);
        if (lhs == 7)
          return !printf("%d%c%d%c%d%c%d=7\n",
                         A, "-+"[i], B, "-+"[j], C, "-+"[k], D);
      }
}

Measured memory_bytes: 256
A, B, C, D = gets.strip.split.map(&:to_i)

all = B - A + 1

def count(m)
    m_min = ((A + (m - 1)) / m) * m
    m_max = (B / m) * m

    return (m_max - m_min) / m + 1
end

ccnt = count(C)
dcnt = count(D)
cdcnt = count(C.lcm(D))

result = all - ccnt - dcnt + cdcnt

puts result

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
ll N;
  cin>>N;
  ll ans=0;
  vector<ll> A(N);
  for(ll i=0;i<N;i++) {
cin>>A[i];
  }
   vector<ll> B(N);
  for(ll i=0;i<N;i++) {
cin>>B[i];
  }
   vector<ll> C(N-1);
  for(ll i=0;i<N-1;i++) {
cin>>C[i];
  }
  
 for(ll i=0;i<N;i++) {
ans+=B[i];
 }
  
  for(ll i=0;i<N-1;i++) {
    ll k=A[i];
    if(A[i+1]==k+1) {
ans+=C[k-1];
    }
  }
  
  cout<<ans<<endl;
}


  
  
  
  
  
  
  
  
  
  
  
  
  

Measured memory_bytes: 3624
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# input
n = int(input())
a_list = []
a_dic = {}
for ai in input().split():
    int_ai = int(ai)
    a_list.append(int_ai)
    if int_ai in a_dic:
        a_dic[int_ai] += 1
    else:
        a_dic[int_ai] = 1

a_solution_dic = {}
all_sum_select = 0
for key in list(a_dic.keys()):
    all_sum_select += int(a_dic[key] * (a_dic[key]-1) / 2)
    #a_solution_dic_at_k[key] = int((a_dic[key]-1) * (a_dic[key]-2) / 2)

for k, ak in enumerate(a_list):
    sum_select_at_k = all_sum_select + int((a_dic[ak]-1) * (a_dic[ak]-2) / 2) \
                       - int(a_dic[ak] * (a_dic[ak]-1) / 2)


    print(sum_select_at_k)


Measured memory_bytes: 92660
S = input()

flag = False

if S[0] == 'A' and S[2:-1].count('C') == 1 :
  if S.count('A') == 1 and S.count('C') == 1:
    if S.replace('A', 'a').replace('C','c').islower():
      flag = True

log = 'AC' if flag else 'WA'
print(log)


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

typedef struct {
	int key;
	struct node	*left, *right, *parent;
}node;

node *root_node, *NIL;

//copy from the notes
void insert(int k) {
	node* y = NIL, * x = root_node, * z;
	z = (node*)malloc(sizeof(node));
	z->key = k;	z->left = NIL;	z->right = NIL;

	while (x != NIL) {
		y = x;
		if (k < x->key) {
			x = x->left;
		}
		else {
			x = x->right;
		}
	}
	z->parent = y;

	if (y == NIL) root_node = z;
	else {
		if (k < y->key) {
			y->left = z;
		}
		else {
			y->right = z;
		}
	}
}

void search(int k) {
	node* node_copy = root_node;

	while (node_copy != NIL) {
		if (node_copy->key == k) {
			printf("yes");
			return;
		}

		if (k < node_copy->key) node_copy = node_copy->left;
		else node_copy = node_copy->right;
	}

	printf("no");

}

void inOrder(node* input_node) {
	if (input_node == NIL)return;
	inOrder(input_node->left);
	printf(" %d", input_node->key); //from note put space before number
	inOrder(input_node->right);
}
void preOrder(node* input_node) {
	if (input_node == NIL)return;
	printf(" %d", input_node->key);
	preOrder(input_node->left);
	preOrder(input_node->right);
}

int main() {
	int i, size, number;
	scanf("%d", &size);
	char input[7];

	for (i = 0; i != size; i++) {
		scanf("%s", input);
		if (strcmp(input, "insert") == 0) {
			scanf("%d", &number);
			insert(number);
		}
		if (strcmp(input, "find") == 0) {
			scanf("%d", &number);
			search(number);
			printf("\n");
		}
		if (strcmp(input, "print") == 0) {
			inOrder(root_node);
			printf("\n");
			preOrder(root_node);
			printf("\n");
		}
	}

	return 0;
}


Measured memory_bytes: 20456
#include <bits/stdc++.h>
using namespace std;
const int MAX_N=1010;

int n,j,now;
string S[MAX_N];

void solve(){
    for (int i=1;i<n;++i){
        for (j=0;j+1<S[i].size();++j){
            if (S[i][j]=='.'&&S[i][j+1]!='.'){
                S[i][j]='+'; break;
            } else S[i][j]=' ';
        }
        now=i-1;
        while(0<=now&&S[now][j]==' '){
            S[now][j]='|'; --now;
        }
    }
    for (int i=0;i<n;++i) cout << S[i] << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n,n){
        for (int i=0;i<n;++i) cin >> S[i];
        solve();
    }
}


Measured memory_bytes: 3716
import sys

def riffle(list):
    n = len(list) / 2
    tmp = [list[:n], list[n:]]
    ret = []
    for i in xrange(2*n):
        ret.append(tmp[i%2][i/2])
    return ret

def cut(list, op):
    return list[op:] + list[:op]

# fp = open("input.txt", "r")
fp = sys.stdin

n = int(fp.readline())
list = range(1, 2*n+1)

m = int(fp.readline())

for i in xrange(m):
    op = int(fp.readline())
    if op == 0:
        list = riffle(list)
    else:
        list = cut(list, op)

for i in xrange(2*n):
    print list[i]

Measured memory_bytes: 4248
#include <iostream>
#include <algorithm>
#include <string.h>

using namespace std;

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

    int pointer = 0;

    int mode = 0;

    while ((S.length() - pointer) >= 5) {
        if (S.substr(pointer, 11) == "dreameraser") {
            pointer += 11;
        } else if (S.substr(pointer, 5) == "dream") {
            if (pointer + 5 < S.length()) {
                if (S.substr(pointer + 5, 5) == "erase") {
                    pointer += 10;
                } else if (S.substr(pointer + 5, 2) == "er") {
                    pointer += 7;
                } else {
                    pointer += 5;
                }
            } else {
                pointer += 5;
            }
        } else if (S.substr(pointer, 5) == "erase") {
            if (pointer + 5 < S.length()) {
                if (S.substr(pointer + 5, 1) == "r") {
                    pointer += 6;
                } else {
                    pointer += 5;
                }
            } else {
                pointer += 5;
            }
        } else {
            break;
        }
    }

    if (S.length() - pointer == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 512
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use num::clamp;
use proconio::{input, marker::*, fastout};
use superslice::*;

#[fastout()]
fn main() {
    input! {
        n: usize,
        a: [isize; n+1],
    }
    if n == 0 && a[0] == 1 {
        println!("{}", 1);
        return;
    }
    if a[0] != 0 {
        println!("-1");
        return;
    }

    let mut cum = vec![0; n+1];
    cum[0] = a[0];
    for i in 1..n+1 {
        cum[i] = cum[i-1] + a[i];
    }

    let mut ans = 0isize;
    let mut b = 1 - a[0];
    for i in 1..n+1 {
        ans += a[i] + b;
        let sum_a = cum[n] - cum[i];
        b = min(2*b - a[i], sum_a);
        if b < 0 {
            println!("-1");
            return;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4348
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>

typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
  
using namespace std;
 
const ll inf = 1e18;
const ll N = 3e5;
const ll bits = 20;
const ld pi = 3.14159265358979323846;
const ll mod = 1e9+7;
const ll p = 29;


int main(){

    FASTIO;
    PRECISION; 

    string s;
    cin>>s;
    int n1 = (s[0]-'0')*10 + (s[1]-'0');
    int n2 = (s[2]-'0')*10 + (s[3]-'0');
    
    if(n1>12 && n2>12){
        cout<<"NA\n";
    }else if(n1<=12 && n2<=12){
        if(n1!=0 && n2!=0){
            cout<<"AMBIGUOUS\n";
        }else if(n1==0 && n2==0){
            cout<<"NA\n";
        }else if(n2==0){
            cout<<"MMYY\n";
        }else{
            cout<<"YYMM\n";
        }
    }else if(n1<=12){
        if(n1==0){
            cout<<"NA\n";
        }else{
            cout<<"MMYY\n";
        }
    }else{
        if(n2==0){
            cout<<"NA\n";
        }else{
            cout<<"YYMM\n";
        }
    }
}


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

using namespace std;

int main() {
	int N, H; cin >> N >> H;
	vector<int> a, b;
	for (int i = 0; i < N; i++) {
		int a_, b_; cin >> a_ >> b_;
		a.push_back(a_);
		b.push_back(b_);
	}
	auto max_a = *max_element(a.begin(), a.end());
	sort(b.rbegin(), b.rend());
	int count = 0;
	for (auto e: b) {
		if (e <= max_a || H <= 0) break;
		H -= e;
		count++;
	}
	if (H > 0) {
		count += (H + max_a - 1) / max_a;
	}
	cout << count << "\n";
}

Measured memory_bytes: 1276
#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 n,k;
    cin>>n>>k;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    double calc=0,ans=0;
    rep(i,k){
        calc+=(double)a[i]/2+0.5;
    }
    ans=max(ans,calc);
    rep(i,n-k){
        calc-=(double)a[i]/2+0.5;
        calc+=(double)a[i+k]/2+0.5;
        ans=max(ans,calc);
    }
    printf("%.10f\n",ans);
    return 0;
}

Measured memory_bytes: 4064
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <utility>
#include <algorithm>

using namespace std;



int main(void){
    // Your code here!
    vector<int> nums;
    int N;
    cin >> N;
    
    for(int i = 0 ; i < N; i++){
        int tmp; 
        cin >> tmp;
        nums.push_back(tmp);
    }

    sort(nums.begin(), nums.end());
    int alice = 0, bob = 0;
    for(int i = 1; i <= nums.size(); i++){
        if(i % 2){
            alice += nums[(N - (i))];
        }else{
            bob += nums[(N - (i))];
        }
    }
    cout << alice - bob;
}


Measured memory_bytes: 256
n=int(raw_input())
i = 1
print "",
while(i<=n):
    x=i
    if x%3 is 0:
        print i,
    elif x%10 is 3:
        print i,
    elif (x/10)%10 is 3:
        print i,
    elif (x/10**2)%10 is 3:
        print i,
    elif (x/10**3)%10 is 3:
        print i,
    elif (x/10**4)%10 is 3:
        print i,
    i = i+1

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

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

int n;
int a[125252];

int main(){
  scanf("%d",&n);
  int ans = 0;
  REP(i,n)scanf("%d",a+i);
  REP(i,n-2){
    int x = a[i];
    int y = a[i+1];
    int z = a[i+2];
    if((x<y&&y>z) || (x>y&&y<z))continue;
    if(i+2==n-1){
      swap(a[i+1], a[i+2]);
      ans++;
      continue;
    }
    int w = a[i+3];
    if(x>y && y>z){
      x *= -1;
      y *= -1;
      z *= -1;
      w *= -1;
    }
    // x < y < z ? w
    // x < y < z < w -> x < y > z < w
    // x < y < z > w -> x < y > w < z   or   x < z > y < w
    if(z<w){
      swap(a[i+1], a[i+2]);
      ans++;
    }else if(w<y){
      swap(a[i+2], a[i+3]);
      ans++;
    }else if(w>y){
      swap(a[i+1], a[i+2]);
      ans++;
    }
  }
  printf("%d\n",ans);
  return 0;
}



Measured memory_bytes: 3632
import heapq
X,Y,Z = map(int,input().split())
N = X+Y+Z
src = [tuple(map(int,input().split())) for i in range(N)]
src.sort(key=lambda x:x[0]-x[1])

l_opt = [0]*(N+1)
r_opt = [0]*(N+1)

silver = bronze = 0
q_sb = []
heapq.heapify(q_sb)
for i,(g,s,b) in enumerate(src):
    heapq.heappush(q_sb, (s-b, s, b))
    silver += s
    if i >= Y:
        _, s2, b2 = heapq.heappop(q_sb)
        silver -= s2
        bronze += b2
    l_opt[i+1] = silver + bronze

gold = bronze = 0
q_gb = []
heapq.heapify(q_gb)
for i,(g,s,b) in enumerate(reversed(src)):
    heapq.heappush(q_gb, (g-b, g, b))
    gold += g
    if i >= X:
        _, g2, b2 = heapq.heappop(q_gb)
        gold -= g2
        bronze += b2
    r_opt[N-1-i] = gold + bronze

ans = 0
for l,r in list(zip(l_opt, r_opt))[Y:Y+Z+1]:
    ans = max(ans, l+r)
print(ans)

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

using namespace std;

int main() {
    int n;
    cin >> n;
    set<string> count;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        count.insert(s);
    }
    cout << count.size() << endl;
    return 0;
}


Measured memory_bytes: 19220
n,m=map(int,input().split(' '))
Mod=1000000007
spl=int(n**0.5)+1
f,k=[i for i in range(spl)]+[n//i for i in range(1,spl)][::-1],2*spl-1
dp=[0]+[1]*(k-1)
for i in range(m):
	dp2=[0]*k
	for j in range(1,k):
		dp2[j]=(dp2[j-1]+dp[k-j]*(f[j]-f[j-1]))%Mod
	dp=dp2
print(dp[k-1])

Measured memory_bytes: 55916
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5;

#define endl "\n"

int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	string str;
	cin>>str;
	sort(str.begin(),str.end());
	if(str[0]==str[1]&&str[2]==str[3]&&str[1]!=str[2]) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <vector>
#include <cmath>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <queue>
#include <numeric>
#include <iostream>
#include <set>

using namespace std;

vector<char> ps = {'7', '5', '3'};

bool contain753(string s) {

    bool contain7 = false;
    bool contain5 = false;
    bool contain3 = false;

    for (auto c:s) {

        if (c == '7') {
            contain7 = true;
        } else if (c == '5') {
            contain5 = true;
        } else if (c == '3') {
            contain3 = true;
        }
    }

    return contain7 && contain5 && contain3;

}

int solve(string s, long n) {

    // base
    if (stol(s) > n) {
        return 0;
    }

    int count = 0;

    if (contain753(s)) {
        count += 1;
    }

    for (auto p:ps) {
        count += solve(s + p, n);
    }

    return count;
}

int main() {


    long N;
    cin >> N;

    int result = 0;

    for (int i = 0; i < 3; i++) {
        result += solve(string(1, ps[i]), N);
    }


    cout << result << "\n";

    return 0;
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let n:i64 = read();
    let mut xn = read_vec::<i64>();
    let an  = xn.clone();
    xn.sort();

    let medi = ((n-2)/2) as usize;
    let a = xn[medi];
    let b = xn[medi + 1];
    let ans:Vec<i64> = (0..n).map(|k|{
        if an[k as usize] <= a{
            b
        } else {
            a
        }
    }).collect();
    for v in &ans{
        println!("{}",v );
    }
    
}

Measured memory_bytes: 12976
#include <iostream>
using namespace std;
int main()
{
    int x;
    int y;
    int c;
    int s;
    cin>>x>>y;
    if(x>=1&&y<=100)
    {
        c=2*(x+y);
        s=x*y;
    }
    cout<<s<<" "<<c<<endl;
}


Measured memory_bytes: 3080
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 10000
#define HMAX 10000

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef long long ll;
typedef pair<int ,int > P;

struct edge{
  int to,cost;
};

int A,B,C,N,W,H,ans,dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){

}

void debug(){

}

void answer(){
	cout << ans << "\n";
}

int main(){
	cin >> A >> B >> C;
	if(A+B >= C) cout << "Yes\n";
	else cout << "No\n";
	solve();
	#ifdef DEBUG
	debug();
	#endif
	// answer();

	return 0;
}

Measured memory_bytes: 256
use proconio::marker::Chars;
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {s: Chars};
    let s: Vec<char> = s;

    let v1 = vec!['R', 'U', 'D'];
    let v2 = vec!['L', 'U', 'D'];
    let mut flag = true;

    for (i, si) in s.iter().enumerate() {
        if (i + 1) % 2 == 0 {
            if !v2.contains(si) {
                flag = false;
            };
        } else {
            if !v1.contains(si) {
                flag = false;
            };
        }
    }

    if flag {
        println!("Yes")
    } else {
        println!("No")
    }
}


Measured memory_bytes: 2156
H,W=list(map(int,input().split()))
A=[list(map(int,input().split())) for _ in range(H)]

ans=[]
for y in range(H):
  for x in range(W-1):
    if A[y][x]%2==1:
      A[y][x]-=1
      A[y][x+1]+=1
      ans.append([y+1,x+1,y+1,x+2])

for i in range(H-1):
  if A[i][-1]%2==1:
    A[i][-1]-=1
    A[i+1][-1]+=1
    ans.append([i+1,W,i+2,W])

print(len(ans))
for i in ans:
  print(*i)


Measured memory_bytes: 30292
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
n-=1

ans = []

def Base_10_to_n(X, n, ans):
    if (int(X/n)):
        ans.append(chr(ord('a')+(X%n)))
        return Base_10_to_n(int(X/n)-1, n, ans)+str(X%n)
    ans.append(chr(ord('a')+(X%n)))
    return str(X%n)

num  = Base_10_to_n(n,26, ans)

ans.reverse()

print(*ans,sep='')

Measured memory_bytes: 9204
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>

#define mod 1000000007
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)

using namespace std;
using ll = long long;

int X[] = {-1, 0, 1, 1, 1, 0, -1, -1};
int Y[] = {1, 1, 1, 0, -1, -1, -1, 0};

void solve() {
    int n;
    cin >> n;
    ll a[n], b[n], res = INT_MAX;
    REP(i, n) cin >> a[i];
    b[0] = a[0];
    for(int i = 1; i < n; i++){
        b[i] = a[i]+b[i-1];
    }
    REP(i, n-1){
        res = min(res, abs(b[n-1]-b[i]*2));
    }
    cout << res << endl;
}

int main(){
    solve();
    return 0;
}

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

using namespace std;

#define fastio cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(0)
typedef long long ll;
//#define int ll
#define swap(x, y)((x)^=(y)^=(x)^=(y))
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> matrix;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(c) c.begin(),c.end()
#define mp make_pair
#define pb push_back
#define f first
#define tcase int _; cin>> _; for( ; _; --_)
#define s second
#define endl '\n'
const int MAX = 1e6+1;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1);
const double DEG = 180/PI;
const int MOD = 1e9+7;
int mod(int x, int m){ if(x >= 0) return x % m; if(-x < m) return m-(-x); return mod(x%m, m);}
int gcd (int a, int b) {while(b){a = mod(a, b); swap(a, b);} return a;}
int lcm (int a, int b) {return a / gcd(a, b) * b;}
int fexp(int base, int exp, int m){
	int total = 1;
	while(exp > 0){
		if(exp % 2 == 1){
			total = mod(((mod(total, m)) * (mod(base, m))), m);
			exp--;
		}
		base= mod((mod(base, m) * mod(base, m)), m);
		exp /= 2;
	}
	return mod(total, m);
}

int n;

string s;

void solve(){
	int a, b, c;

	cin>> a >> b >> c;

	cout<< (a+b+c >= 22 ? "bust\n": "win\n"); 
}

int32_t main(){
	fastio;
	solve();
	return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
int main() {
	long double a,b;
	cin>>a>>b;
	long long ans=a*b;
	cout<<ans;
}


Measured memory_bytes: 3796
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
    n,k=parseMap(split(readline()))
    h=reverse(sort(parseMap(split(readline()))))
    s=sum(h)
    for i in 1:min(k,length(h))
        s-=h[i]
    end
    println(s)
end
main()

Measured memory_bytes: 182980
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 24 21:28:20 2016

@author: dotha
"""

#aまでいけそうなら動かす。駄目そうならその項は終わり

def move(s, k):
    if len(s) == 1:
        return chr(97+(ord(s) + k - 97)%26)
    if s[0] == 'a' or 123-ord(s[0]) > k:
        return s[0] + move(s[1:], k)
    else:
        return 'a' + move(s[1:], k-(123-ord(s[0])))

def move_(l,k):
    if l =='a' or 123-ord(l) > k:
        return (l,k)
    else:
        return ('a', k-(123-ord(l)))

s = input()
K = int(input())
answer=[]
#print(move(s,K))

for l in s:
    (x,K) = move_(l,K)
    answer.append(x)

answer[-1] = chr(97++(ord(answer[-1]) + K - 97)%26)
    
print(''.join(answer))



Measured memory_bytes: 4340
function Main(input) {
	var idata = parseInt(input);
	var ans = 0;
	if(String(idata).length==1){
		ans = idata;
	}else if(String(idata).length==2){
		ans = 9;
	}else if(String(idata).length==3){
		ans = idata-90;
	}else if(String(idata).length==4){
		ans = 909;
	}else if(String(idata).length==5){
		ans = idata-9090;
	}else if(String(idata).length==6){
		ans = 90909;
	}
	console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define repi(i, s, n) for (long long i {s}, i##_len{n}; i < i##_len; ++i)
#define rep(i, n) repi(i, 0, n)
#define all(x) std::begin(x), std::end(x)

namespace xmaho
{
inline namespace input
{
template<typename T>
T get_value(std::istream& is = std::cin);
template<typename C>
C get_container(std::istream& is = std::cin, typename C::size_type length = std::numeric_limits<typename C::size_type>::max());
}
}
namespace xmaho
{
inline namespace integer
{
template<typename C>
constexpr auto ssize(const C& c) noexcept(noexcept(c.size()))
  -> typename std::common_type<std::ptrdiff_t, typename std::make_signed<decltype(c.size())>::type>::type;
template <class T, ptrdiff_t N>
constexpr std::ptrdiff_t ssize(const T (&)[N]) noexcept;
}
}
using namespace xmaho;

uint64_t f(uint64_t x) noexcept
{
  const auto left_attack {static_cast<uint64_t>(log2(x)) + 1};
  if (left_attack == 1) return 1;
  return f(x / 2) * 2 + 1;
}

int main()
{
  const auto n {get_value<uint64_t>()};
  cout << f(n) << '\n';
  return 0;
}

class initalization
{
  class custom_numpunct: public std::numpunct<char>
  {
  public:
    using numpunct::numpunct;
  protected:
    std::string do_truename() const override { return "Yes"; }
    std::string do_falsename() const override { return "No"; }
  };

public:
  initalization()
  {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.imbue(std::locale(std::cout.getloc(), new custom_numpunct{}));
    std::cout << std::boolalpha << std::fixed << std::setprecision(15);
  }
} initalize;

template<typename T>
T xmaho::input::get_value(std::istream& is)
{ T v {}; is >> v; return v; }

template<typename C>
C xmaho::input::get_container(std::istream& is, typename C::size_type length)
{
  C v {};
  if (length != std::numeric_limits<typename C::size_type>::max())
    v.reserve(length);
  typename C::value_type e {};
  for (auto i {length}; i != 0 && is >> e; --i)
    v.push_back(std::move_if_noexcept(e));
  return v;
}

template<typename C>
constexpr auto xmaho::integer::ssize(const C& c) noexcept(noexcept(c.size()))
  -> typename std::common_type<std::ptrdiff_t, typename std::make_signed<decltype(c.size())>::type>::type
{ return c.size(); }

template <class T, ptrdiff_t N>
constexpr std::ptrdiff_t xmaho::integer::ssize(const T (&)[N]) noexcept
{ return N; }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/math/special_functions/prime.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

constexpr array<int, 55> a{11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381};


int main() {
    ll N;
    cin >> N;
    for (auto &&i: irange(0LL, N-1)){
        cout << a.at(i) << " ";
    }
    cout << a.back();

    return 0;
}

Measured memory_bytes: 256
#include<iostream>

int univ[4][3][10];

int main(){

	int n;
	std::cin >> n;

	for (int i = 0; i < n; i++){
		int b, f, r, v;
		std::cin >> b >> f >> r >> v;
		b--, f--, r--;

		univ[b][f][r] += v;
	}

	for (int i = 0; i < 4; i++){
		for (int j = 0; j < 3; j++){
			for (int k = 0; k < 10; k++){
				std::cout << " " << univ[i][j][k];
			}
			std::cout << std::endl;
		}
		if (i != 3)std::cout << "####################" << std::endl;
	}

	return 0;
}

Measured memory_bytes: 1160
r = {}
n,k = map(int, input().split())
for i in range(n):
  a,b = map(int, input().split())
  if a in r.keys():
    r[a] += b
  else:
    r[a] = b

for i in sorted(r.keys()):
  k -= r[i]
  if k <= 0:
    print(i)
    break

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

int main() {
	int N, K; cin >> N >> K;
	int a[10], d;
	for(int i=0; i<10; ++i) a[i]=0;
	for(int i=0; i<K; ++i){
	    cin >> d;
	    ++a[d];
	}
	int min=0;
	while(a[min]) ++min;
	int ndig[6], ld;
	for(d=0; d<6; ++d){
	    if(N>0 && N<10) ld=d;
	    ndig[d]=N%10;
	    N /= 10;
	}
	int p;
	for(p=0; p<=ld || ndig[p]!=0; ++p){
	    if(p>ld) ld=p;
	    if(a[ndig[p]%10]){
	        for(int i=p-1; i>=0; --i) ndig[i]=min;
	        while(a[ndig[p]%10]) ++ndig[p];
	        if(ndig[p]>9) ++ndig[p+1];
	    }
	}
	for(int i=ld; i>=0; --i) cout << ndig[i]%10;
	cout << endl;
	return 0;
}


Measured memory_bytes: 256