akhauriyash/Code-Regression huggingface dataset:
//C
#include <cassert>
//#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

//ここまで標準include

using namespace std;

int main() {
	long long N, A, B;
	cin >> N >> A >> B;
	if ((abs(A - B) % 2) == 0) {
		cout << abs(A - B) / 2 << endl;
	}
	else {
		if (A > B) {
			swap(A, B);
		}
		if (A - 1 <= N - B) {
			cout << A - 1 + 1 + (abs(A - B) - 1) / 2 << endl;
		}
		else {
			cout << N - B + 1 + (abs(A - B) - 1) / 2 << endl;
		}
	}
}


Measured memory_bytes: 256
import java.util.*;
public class Main
{
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        int n,num,rem;
        n=in.nextInt();
        num=n;
        while(num!=0)
        {
            rem=num%10;
            if(rem==7)
            {
                System.out.println("Yes");
                System.exit(0);
            }
            num=num/10;
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 35792
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <sstream>
#include <deque>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdio>
const int M = 1e9 + 7;
#define ll long long int
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
using namespace std;

//insta  -------  __ansh7
//MSDIAN

// Basic Template




int main()
{
    fastio

    ll x,y;
    cin>>x>>y;

    ll sum=2*x;

    vector<ll>a;

    for(ll i=0;i<x+1;i++)
    {
        a.push_back(sum);
        sum=sum+2;
    }

    int z=0;


    for(ll i=0;i<a.size();i++)
    {
        if(a[i]==y)
        {
            z=1;
            cout<<"Yes"<<"\n";
            break;
        }

    }

    if(z==0)
    {
        cout<<"No"<<"\n";
    }



    return 0;
}

Measured memory_bytes: 3656
n,m = map(int,input().split())

h = list(map(int,input().split()))

root = [[] for i in range(n)]
for _ in range(m):
    a, b = (int(x) for x in input().split())
    root[b-1].append(a-1)
    root[a-1].append(b-1)

ans = 0

for i in range(n):
    flag = True
    if len(root[i]) > 0:
        for j in root[i]:
            if h[i] <= h[j]:
                flag = False
                break
    if flag:
        ans += 1
print(ans)

Measured memory_bytes: 92504
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1000000000;

ll dp[101][4][4][4];
//dp[ii][i][j][k]0='A',1='C',2='G',3='T';
int main()
{
	ll n;
	cin >> n;
	rep(i,4)
	rep(j,4)
	rep(k,4)
	{
		dp[0][i][j][k]=1;
	}
	dp[0][0][2][1] = 0;//AGC
	dp[0][0][1][2] = 0;//ACG
	dp[0][2][0][1] = 0;//GAC

	rep(ii,100)
	{
		rep(i,4)
		{
			rep(j,4)
			{
				rep(k,4)
				{
					rep(x,4)
					{
						if(j==0&&k==2&&x==1)continue;
						if(j==0&&k==1&&x==2)continue;
						if(j==2&&k==0&&x==1)continue;
						if(i==0&&j==2&&x==1)continue;
						if(i==0&&k==2&&x==1)continue;
						dp[ii+1][j][k][x] = (dp[ii][i][j][k]+dp[ii+1][j][k][x])%MOD;
					}
				}
			}
		}
	}
	ll ans = 0;
	rep(i,4)rep(j,4)rep(k,4)ans = (ans + dp[n-3][i][j][k])%MOD;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<cmath>
#include<iostream>
#include<iomanip>
#include<algorithm>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)
using namespace std;

class Point {
public:
    double x, y;

    Point(double x=0, double y=0): x(x), y(y) {}

    Point operator + (Point p) { return Point(x+p.x, y+p.y); }
    Point operator - (Point p) { return Point(x - p.x, y - p.y); }
    Point operator * (double a) { return Point(x*a, y*a); }
    Point operator / (double a) { return Point(x/ a, y/ a); }

    double abs() { return sqrt(norm()); }
    double norm() { return x*x, y*y; }
    bool operator < (const Point &p) const {
	return x != p.x ? x<p.x : y < p.y;
    }
    
    bool operator == (const Point &p) const {
	return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
    }
};

typedef Point Vector;

struct Segment {
    Point p0, p1;
};

typedef Segment Line;

double dot(Vector a, Vector b) {
    return a.x*b.x + a.y*b.y;
}

double norm(Vector a) {
    return a.x*a.x + a.y*a.y;
}

double abs(Vector a){
    return sqrt(norm(a));
}

/*
  ???????????§??????????????¨??????????????°??????
  |a*b|=|a||b|sin(theta)
 */
double cross(Vector a, Vector b){ 
    return a.x*b.y - a.y*b.x;
}

Point getCrossPoint(Segment s1, Segment s2){
    Vector base = s2.p1 - s2.p0;
    double d1 = abs(cross(base, s1.p0 - s2.p0));
    double d2 = abs(cross(base, s1.p1 - s2.p0));
    double t = d1 / (d1+d2);
    return s1.p0 + (s1.p1 - s1.p0) * t;
}


int main() {
    int n,i,d;
    
    Segment s1, s2;
    cin >> n;
    for(i=0;i<n;i++){
	cin >>  s1.p0.x >> s1.p0.y >> s1.p1.x >> s1.p1.y >> s2.p0.x >> s2.p0.y >> s2.p1.x >> s2.p1.y;
	Point p = getCrossPoint(s1,s2);
	cout << fixed << showpoint;
	cout << setprecision(8);
	cout << p.x << " " << p.y << endl;
    }
    return 0;

}

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

 using namespace std;

 int main() {
   int N;

   cin >> N;

   vector<int> A(N);

   for (int i = 0; i < N; i++) cin >> A.at(i);

   int minAN = 1000000000;
   int maxAN = 0;

   for (int i = 0; i < N; i++) {
     minAN = min(minAN, A.at(i));
     maxAN = max(maxAN, A.at(i));
   }

   cout << maxAN - minAN << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> v(n+1, 0);
    rep(i, 0, m)
    {
        int a, b;
        cin >> a >> b;
        v[a]++;
        v[b]++;
    }
    rep(i, 1, n + 1)
        cout << v[i] << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(int i=(a);i<=(b);++i)
#define rep(i,n) rep2(i,0,n-1)
int MOD=1000000000+7;
int INF=1e6;
 
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");

main(){
    int prime[55555]={};
    rep2(i,2,55555){
        if(!prime[i]){
            rep2(j,2,55555/i){
                prime[i*j]=1;
            }
        }
    }
    int f[55];
    int temp=6;
    rep(i,55){
        while(prime[temp]){
            temp+=5;
        }
        f[i]=temp;
        temp+=5;
    }
    int n;
    cin>>n;
    rep(i,n){
        cout<<f[i]<<" ";
    }
    return 0;
}

Measured memory_bytes: 512
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair< int, int > pii;
typedef pair< pii, int > ppi;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 2000100;



int main(){
        _
        int a,b,c; cin >> a >> b >> c;
        for(int i=1;i<b+1;i++){
        if((a*i)%b==c){
            cout << "YES" << endl;
              return 0;
            }
        }
        cout << "NO" << endl;


return 0;
}



Measured memory_bytes: 3640
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        Integer[] arr = new Integer[N];
        for( int i = 0; i < N; i++ ) arr[i] = sc.nextInt();
        Arrays.sort(arr, Collections.reverseOrder());
        long res = 0;
        for(int i = K; i < N; i++) {
            res += arr[i];
        }
        System.out.println(res);
    }
}


Measured memory_bytes: 63584
#!/usr/bin/env python3
import sys


def solve(K: int, A: int, B: int):
    a=[i for i in range(0, 1001) if i % K == 0]
    b=list(range(A,B+1))
    for i in range(len(b)):
        if b[i] in a:
            print("OK")
            exit()
    print("NG")
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(K, A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9236
# Reference: https://ikatakos.com/pot/programming_algorithm/data_structure/binary_indexed_tree
# Fenwick Tree
class BinaryIndexedTree:
    # a = [0] * n
    # O(n)
    def __init__(self, n):
        self.size = n
        self.data = [0] * (n+1)

    # return sum(a[0:i])
    # O(log(n))
    def cumulative_sum(self, i):
        ans = 0
        while i > 0:
            ans += self.data[i]
            i -= i & -i
        return ans

    # a[i] += x
    # O(log(n))
    def add(self, i, x):
        i += 1
        while i <= self.size:
            self.data[i] += x
            i += i & -i

from sys import stdin
input = stdin.buffer.readline

def main():
    n, m, q = map(int, input().split())
    lr = [tuple(map(int, input().split())) for _ in range(m)]
    pq = [(0, 0, 0)] * q
    for ind in range(q):
        i, j = map(int, input().split())
        pq[ind] = (i, j, ind)

    lr.sort(key=lambda x: x[0])
    l = [i for i, j in lr]
    r = [j for i, j in lr]
    pq.sort(key=lambda x: x[0])

    BIT = BinaryIndexedTree(n+1)
    for i in r:
        BIT.add(i, 1)

    # search r[lr_ind:]
    lr_ind = 0
    ans = [0] * q
    for left, right, pq_ind in pq:
        while lr_ind < m and l[lr_ind] < left:
            BIT.add(r[lr_ind], -1)
            lr_ind += 1

        ans[pq_ind] = BIT.cumulative_sum(right+1)

    for i in ans:
        print(i)

main()

Measured memory_bytes: 143556
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "Yes"<<endl
#define no  cout<< "No"<<endl
#define all(v) (v).begin(),(v).end()
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using namespace std;    
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {    
       double n,m;
       cin>>n>>m;
       double x=n/m;
       cout<<x;
       
    }
}
// 🍪 🍪 🍪

Measured memory_bytes: 3744
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/
vi v;
int m, n;
short dp[1 << 12][1 << 12];

int solve(int asked, int resp)
{
	if (dp[asked][resp] >= 0) return dp[asked][resp];
	int cnt = 0;
	REP(i, n)
	{
		if ((v[i] & asked) == resp) cnt++;
	}
	int res = m;
	if (cnt <= 1)
	{
		res = 0;
	}
	else
	{
		REP(i, m)
		{
			int nx = asked | (1 << i);
			if (nx == asked) continue;
			chmin(res, max(solve(nx, resp | (1 << i)), solve(nx, resp))+1);
		}
	}
	return dp[asked][resp] = res;
}

int tonum(string s)
{
	int res = 0;
	REP(i, s.size())
	{
		res *= 2;
		res += s[i] - '0';
	}
	return res;
}

int main()
{
	while (cin >> m >> n, m)
	{
		MS(dp, -1);
		v.resize(n);
		REP(i, n)
		{
			string s;
			cin >> s;
			v[i] = tonum(s);
		}
		cout << solve(0, 0) << endl;
	}
	return 0;
}

Measured memory_bytes: 35916
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <math.h>
#include <map>
#include<cmath>

typedef long long ll;
using namespace std;
#define mod 10007
#define rep(i,n) for(ll i=0;i<n;i++)
#define out(s) cout << s << endl



int main(){
    ll n;cin >> n;
    vector<string> s(n);
    rep(i,n){
        cin >> s[i];
        sort(s[i].begin(),s[i].end());
    }
    sort(s.begin(),s.end());
    ll idx_cnt=0;
    ll cnt=0;
    rep(i,n){
        if(i+1==n){
            ll sum=0;
            for(ll k=idx_cnt;k>=0;k--){
                sum+=k;
            }
            cnt+=sum;
            idx_cnt=0;
            break;
        }
        if(s[i]==s[i+1]){
            idx_cnt++;
        }
        else{
            ll sum=0;
            for(ll k=idx_cnt;k>=1;k--){
                sum+=k;
            }
            cnt+=sum;
            idx_cnt=0;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
using namespace std;
using dll=double long;
int n;
dll c[3005];
dll memo[3005][3005];
bool vis[3005][3005];
dll dp(int pos,int ca){
    if(pos==n){
        if(ca*2>n) return 1;
        else return 0;
    }
    if(vis[pos][ca]) return memo[pos][ca];
    dll ans;
    ans=c[pos]*dp(pos+1,ca+1) + (1-c[pos])*dp(pos+1,ca);
    vis[pos][ca]=true;
    return  memo[pos][ca]=ans;
}

int main() {
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    cout<<setprecision(10)<<dp(0,0)<<endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;

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

  int t = (c * 60 + d) - (a * 60 + b);
  cout << t - e;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include  <cstdio>
#include <algorithm>
#include  <cstdio>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
using namespace std;
#define maxn 110
int main()
{
 int N,T;
 cin >> N >>T;  //N个数
 int i;
 int ans = 99999999;
 for(i = 1;i <= N;i++)
 {
     int c,t;
     cin >> c >> t;
     if(t <= T)
     {
         if(c< ans)
            ans = c;
     }

 }
 if(ans ==99999999 )
    cout << "TLE"<<endl;
 else
    cout << ans <<endl;

return 0;
}



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

// コンテスト中のみ
//#define int long long

#define ll long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define P pair<ll,ll>
ll INF = (1LL << 60);
int MOD = 1000000007;

int N;
ll Q, K;
vector<vector<P>>G;
ll d[100010];

void dfs(ll v, ll p, ll cost) {
	d[v] = cost;
	for (auto nv : G[v]) {
		if (nv.first == p)continue;
		dfs(nv.first, v, cost + nv.second);
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> N;
	G.resize(N);
	rep(i, N - 1) {
		ll a, b, c; cin >> a >> b >> c; a--; b--;
		G[a].push_back({ b,c });
		G[b].push_back({ a,c });
	}
	cin >> Q >> K; K--;
	dfs(K, -1, 0);
	rep(_, Q) {
		ll x, y; cin >> x >> y; x--; y--;
		cout << d[x] + d[y] << endl;
	}
	return 0;
}

Measured memory_bytes: 15584
#include<bits/stdc++.h>
#define int long long
#define pb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(),v.end()
#define rep(i,start,lim) for(long long (i)=(start);i<(lim);i++)
#define revrep(i,n) for(long long i=n-1;i>=0;i--)
#define boost ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define osit ostream_iterator<int> output (cout," ")
#define endl '\n'
#define f first
#define s second
#define PI 3.141592653589793
#define MOD 1000000007
#define set0(x) memset(x,0,sizeof(x))
#define set1(x) memset(x,1,sizeof(x))
using namespace std;
typedef vector<int> vi;
typedef list<int> li;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
template<typename T> T gcd(T a,T b){if(a==0) return b; return gcd(b%a,a);}
template<typename P> P dectobin(P a){if(a==0)return 0; else return(a%2 + 10*dectobin(a/2));}
template<typename Y> Y bintodec(Y a){int ans=0,b=1,t=a; while (t){int ld=t%10; t/=10;ans+=ld* b;b=b*2;} return ans; }
template<typename H> H modExp(H x, H n){ int r=1; while(n>0){if(n%2==1){r=(r*x)%MOD;}x=(x*x)%MOD;n/=2;}return r;}
template<typename T> T isPowerOfTwo(T x){return x && (!(x & (x - 1)));}	
template<typename T> T lcm(T a,T b) {return a*b/gcd(a,b);}
//template<typename T> T extendedEuclid(T A,T B){if(B==0){d=A; x=1;y=0;}else{ extendedEuclid(B,A%B);int temp=x; x=y; y=temp-(A
//B)*y;}}
int32_t main(){
	boost;osit;
	int n,a,b;
	cin>>n>>a>>b;
	cout<<min(n*a,b);
	return 0;
}

Measured memory_bytes: 256
object Main extends App {

  var n = scala.io.StdIn.readLine.toInt
  val hArr = scala.io.StdIn.readLine.split(" ").map(_.toLong)

  def solve(): String = {
    for(i <- 0 until n-1) {
      val diff = hArr(i+1) - hArr(i)
      diff match {
        case x if x >= 1 => hArr(i+1) -= 1
        case 0 => hArr(i+1)
        case _ => return "No"
      }
    }
    "Yes"
  }
  println(solve)
}


Measured memory_bytes: 46420
#include<iostream>
#include<vector>
typedef long long ll;
using namespace std;

int main() {
	ll n, x;
	ll t,ans=0;
	cin >> n >> x;
	vector<ll>a(n);
	for (int i = 0; i < n; ++i)cin >> a[i];
	for (int i = 0; i < n-1; ++i) {
		t = 0;
		if (a[i] + a[i + 1] > x) {
			t = a[i]+a[i + 1] - x;
			a[i + 1] -= t;
			if (a[i + 1] < 0) {
				a[i + 1] = 0;//a[i+1]はマイナスになることがある
			}
		}
		ans += t;
	}
	cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define TEST int t = 1; while(t--) solve()

void solve(){
    int a,b,c;
    cin>>a>>b>>c;
    a=a+b+c;
    if(a>=22)
    {
    	 cout<<"bust";
    }
    else
    {
    	 cout<<"win";
    }
}

signed main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); TEST; return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
    int n;
    while(cin>>n, n){
        int v[10]={};
        rep(i,n){
            int s=0;
            rep(j,n){
                int t; cin>>t;
                printf("%5d",t);
                s+=t;
                v[j]+=t;
            }
            printf("%5d\n",s);
        }
        int s=0;
        rep(i,n){
            printf("%5d",v[i]);
            s+=v[i];
        }
        printf("%5d\n",s);
    }
}

Measured memory_bytes: 1144
/*
  || Shree Ganeshay Namah ||

     || Jai Shree Ram ||
  || Nabh Sparsham Diptam ||
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
#define block 180
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define f1 first
#define s1 second
#define pb push_back
// to floor a/b you can do a/b and to ceiling a/b you can do (a+b-1)/b
int jai_shree_ram()
{
    return 1;
}
int shree_ganeshay_namah()
{
    return 1;
}
ll power(ll x,ll y)
{
    ll r=1;
    while(y>0)
    {
        if(y%2!=0)
            r=(r%mod * x%mod)%mod;
        x=(x%mod * x%mod)%mod;
        y=y/2;
    }
    return r;
}
ll ncr(ll n,ll k)
{

    ll c[k+1];
    memset(c,0,sizeof(c));
    c[0]=1;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=min(i,k);j>0;j--)
            c[j]=c[j]+c[j-1];
    }
    return c[k];
}

bool prime[500001];
void sieve()
{
    ll i,j;
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(i=2;i<=sqrt(100001);i++)
    {
        if(prime[i])
        {
            for(j=i*i;j<=100001;j=j+i)
                prime[j]=false;
        }
    }
}
//Start of Matrix Exponentiation Code
void mat_mul(ll F[2][2],ll M[2][2]) {
   ll a = ((F[0][0]%mod * M[0][0]%mod)%mod + (F[0][1]%mod * M[1][0]%mod)%mod)%mod;
   ll b = ((F[0][0]%mod * M[0][1]%mod)%mod + (F[0][1]%mod * M[1][1]%mod)%mod)%mod;
   ll c = ((F[1][0]%mod * M[0][0]%mod)%mod + (F[1][1]%mod * M[1][0]%mod)%mod)%mod;
   ll d = ((F[1][0]%mod * M[0][1]%mod)%mod + (F[1][1]%mod * M[1][1]%mod)%mod)%mod;
   F[0][0] = a;
   F[0][1] = b;
   F[1][0] = c;
   F[1][1] = d;
}
void mpower(ll F[2][2], ll n) {
   if (n == 0 || n == 1)
      return;
   ll M[2][2] = {{1,1},{1,0}};
   mpower(F, n / 2);
   mat_mul(F, F);
   if (n % 2 != 0)
      mat_mul(F, M);
}
ll fib_mat(ll n) {
   ll F[2][2] = {{1,1},{1,0}};
   if (n == 0)
      return 0;
   mpower(F, n - 1);
   return F[0][0]%mod;
}
//End of Matrix Exponentiation
void fun(string s)
{
    ll n = s.size(),i,j;
    if(n%2==1)
    {
        for(i=n/2-1,j=n/2+1;;i--,j++)
        {
            if(i<0 || j>n)
                break;
            s[j]=s[i];
        }
        cout<<s<<"\n";
    }
    else
    {
        for(i=n/2-1,j=n/2;;i--,j++)
        {
            if(i<0 || j>n)
                break;
            s[j]=s[i];
        }
        cout<<s<<"\n";
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll l,r,d,i;
    cin>>l>>r>>d;
    ll f=0;
    for(i=l;i<=r;i++)
    {
        if(i%d==0)
            f++;
    }
    cout<<f;
    return 0;

}



Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		String stra = String.valueOf(a);
		String strb = String.valueOf(b);
		String A = stra;
		String B = strb;
		for (int i=1; i<b; i++)
			A = A.concat(stra);
		
		for (int i=1; i<a; i++)
			B = B.concat(strb);
		
		if (A.compareTo(B) < 0)
			System.out.print(A);
		else
			System.out.print(B);

		
		sc.close();

	}
}


Measured memory_bytes: 23252
n = int(input())
list_a = list(map(int, input().split()))

n_minus = 0

for a in list_a:
  if a < 0:
    n_minus += 1

if n_minus % 2 == 0:
  print(sum(list(map(abs, list_a))))
else:
  list_a_min = min(list(map(abs,list_a)))
  print(sum(list(map(abs, list_a))) - 2 * list_a_min)

Measured memory_bytes: 14412
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <functional>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#define SIZE 2005
#define INF 100000000000000000LL

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

ll A[SIZE];
ll now[SIZE];

int main()
{
	int n;
	ll x;
	scanf("%d %lld",&n,&x);
	for(int i=0;i<n;i++)
	{
		scanf("%lld",&A[i]);
		now[i]=A[i];
	}
	ll ret=INF;
	for(int i=0;i<=n;i++)
	{
		ll sum=(ll) i*x;
		for(int j=0;j<n;j++)
		{
			int back=(j-i+n)%n;
			now[j]=min(now[j],A[back]);
		}
		for(int j=0;j<n;j++) sum+=now[j];
		ret=min(ret,sum);
	}
	printf("%lld\n",ret);
	return 0;
}


Measured memory_bytes: 128
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

int64_t GetCount(const int64_t H) {
  if (H == 1LL) {
    return 1LL;
  }
  return 1LL + 2LL * GetCount(H / 2LL);
}

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

  int64_t H;
  cin >> H;
  cout << GetCount(H) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

#include <iostream>

#include <cstring>

using namespace std;

typedef long long ll;

 

#define row 1001333  //取一个比h2(k)大的质数

#define col 20

 

char H[row][col];

 

ll h1(ll key){

	return key%row;

}

 

ll h2(ll key){

	return 1+(key%(row-1));

}

 

ll chtonum(char s){  //character to number

	if(s=='A') return 1;

	if(s=='C') return 2;

	if(s=='G') return 3;

	if(s=='T') return 4;

	return 0;

}

 

ll get_key(char s[]){  //生成key值

	ll sum=0,p=1;

	int len=strlen(s);

	for(ll i=0;i<len;i++){

		sum+=p*chtonum(s[i]);

		p*=5;

	}

	return sum;

}

 

void insert(char s[]){

	ll key,h;

	key=get_key(s);

	ll i =0;

	while(1){

		h=(h1(key)+i*h2(key))%row;  //根据key值生成对应的位置

		if(strcmp(H[h],s)==0) return ;//这个元素字典里已经有了

		else if (strlen(H[h])==0){

			strcpy(H[h], s);//如果该位置没有别的值，就把这个元素插进去

			return ;

		} 

		i++;//如果这个i对应的h的位置已经有元素了，那么继续寻找下一个i对应的位置

	}

}

 

bool find(char s[]){

	ll key,h;

	key=get_key(s);

	ll i=0;

	while(1){

		h=(h1(key)+i*h2(key))%row;

		if(strcmp(H[h],s)==0) return true;//如果找到了该元素

		else if (strlen(H[h])==0) return false;

		i++;

	}

	return false;

}

 

int main (){

	int n;

	char c[20],s[20];

	for(int i = 0;i<row;i++) H[i][0]='\0'; //把数组初始化 方便比较

	scanf("%d",&n);

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

		cin>>c>>s;

		if(c[0]=='i') insert(s);

		else {

			if(find(s)) cout<<"yes"<<endl;

			else cout<<"no"<<endl;

		}

	}

	return 0;

}



Measured memory_bytes: 22784
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    n--;
    cout<<(n*(2+(n-1))/2)<<"\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stdlib.h>
#include <map>
#include <cmath>
#define MOD_P 1000000007
#define MOD_Q 998244353
#define PI 3.14159265358979
#define ll long long
using namespace std;

int main()
{
	string str;
	int n;
	cin >> n;
	int type[4] = { 0,0,0,0 };

	for (int i = 0; i < n; i++) {
		cin >> str;
		if (str == "AC") {
			type[0]++;
		}
		else if (str == "WA") {
			type[1]++;
		} else if(str == "TLE"){
			type[2]++;
		} else {
			type[3]++;
		}
	}

	printf("AC x %d\n", type[0]);
	printf("WA x %d\n", type[1]);
	printf("TLE x %d\n", type[2]);
	printf("RE x %d\n", type[3]);

	return 0;
}


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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e9 + 7;


// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, m, k, u, v;
string s, t;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>n>>m;
	cout<<max({2*n - 1,2*m - 1,n+m});
}

int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {
		MAIN();
	}
	return 0;
}

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

using ll = long long;
#define countof(a) (sizeof(a)/sizeof((a)[0]))
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_h(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << (i==c.size()-1?"\n":" "); }

#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 

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

    int N; cin >>N;
    vector<int> c(N+1);
    rep(i, N) {
        int A;
        cin >> A;
        c[A]++;
    }
    sort(all(c));
    vector<int> s(c.size() + 1, 0);
    rep(i, s.size() - 1) s[i+1] = s[i] + c[i];
    for (int K = 1; K <= N; K++) {
        int l = 0;
        int r = N / K +1;
        while (l + 1 < r) {
            int x = (l + r) / 2;
            int d = distance(c.begin(), lower_bound(c.begin(), c.end(), x));
            int sum = s[d] + x * (c.size() - d);
            if (sum >= x * K) {
                l = x;    
            } else {
                r = x;
            }
        }
        cout << l << endl;
    }
}


Measured memory_bytes: 3200
#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 1000000000;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef pair<int, int> P;

/** Problem2103 : Battle Town **/
int main()
{
	int T, W, H; cin>>T;
	bool first = true;
	string ds = "^>v<";
	
	rep(z, T) {
		cin>>H>>W;
		char field[H][W];
		P p; int d=0;
		
		rep(y, H) rep(x, W) {
			cin>>field[y][x];
			
			if (field[y][x]=='>') {
				p.first=x, p.second=y;
				d=1;
				field[y][x] = '.';
			}
			
			if (field[y][x]=='^') {
				p.first=x, p.second=y;
				d=0;
				field[y][x] = '.';
			}
			
			if (field[y][x]=='v') {
				p.first=x, p.second=y;
				d=2;
				field[y][x] = '.';
			}
			
			if (field[y][x]=='<') {
				p.first=x, p.second=y;
				d=3;
				field[y][x] = '.';
			}
		}
		
		string S; int N;
		cin>>N>>S;
		
		rep(i, N) {
			if (S[i] == 'S') {
				int sx = p.first, sy = p.second;
				while (1) {
					sx+=dx[d], sy+=dy[d];
					if_range(sx, sy, W, H) {
						if (field[sy][sx] == '#') break;
						if (field[sy][sx] == '*') {field[sy][sx]='.'; break;}
					} else {
						break;
					}
				}
			} else {
				if (S[i] == 'U')
					d=0;
				if (S[i] == 'D')
					d=2;
				if (S[i] == 'L')
					d=3;
				if (S[i] == 'R')
					d=1;
				
				int nx = p.first+dx[d], ny = p.second+dy[d];
				if_range(nx, ny, W, H) {
					if (field[ny][nx] == '.')
						p.first = nx, p.second = ny;
				}
			}
		}
		
		if (!first) cout << endl;
		rep(y, H) {
			rep(x, W) {
				if (x == p.first && y == p.second)
					cout << ds[d];
				else
					cout << field[y][x];
			}
			cout << endl;
		}
		
		first = false;
	}
}

Measured memory_bytes: 1212
n,k,c = map(int,input().split())
s = input()
l = [0]*k
r = [0]*k

count = 0
bef = 0
for i,j in enumerate(s):
    if j == 'o':
        if count == 0:
            l[0] = i+1
            count += 1
            bef = i
        elif i > bef + c:
            l[count] = i+1
            count += 1
            bef = i
    if count == k:
        break

count = 0
bef = 0
for i,j in enumerate(s[::-1]):
    if j == 'o':
        if count == 0:
            r[0] = n-i
            count += 1
            bef = i
        elif i > bef + c:
            r[count] = n-i
            count += 1
            bef = i
    if count == k:
        break
r = r[::-1]

for i in range(k):
    if l[i] != 0 and l[i] == r[i]:
        print(l[i])

Measured memory_bytes: 20712
#include <bits/stdc++.h>
using namespace std;
int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<int>> grid(H, vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> grid.at(i).at(j);
    }
  }
  
  vector<string> ans(H*W);
  int cnt = 0;
  int n = 0;
  stringstream ss;
  for (int i = 0; i < H; i++) {
    if (i % 2 == 0) { // 右へ走査
      for (int j = 0; j < W; j++) { 
        cnt++;
        if (cnt >= H*W) break;
        if (grid.at(i).at(j) % 2 != 0) {
          n++;
          if (j < W-1) { // まだ端じゃない
            ss << i+1 << " " << j+1 << " " << i+1 << " " << j+2 << endl;
            grid.at(i).at(j+1)++;
          } else { // 端
            ss << i+1 << " " << j+1 << " " << i+2 << " " << j+1 << endl;
            grid.at(i+1).at(j)++;
          }
        }
      }
    } else {
      for (int j = W-1; j > -1; j--) {
        cnt++;
        if (cnt >= H*W) break;
        if (grid.at(i).at(j) % 2 != 0) {
          n++;
          if (j > 0) {
            ss << i+1 << " " << j+1 << " " << i+1 << " " << j << endl;
            grid.at(i).at(j-1)++;
          } else {
            ss << i+1 << " " << j+1 << " " << i+2 << " " << j+1 << endl;
            grid.at(i+1).at(j)++;
          }
        }
      }
    }
  }
  cout << n << endl;
  cout << ss.str();
}


Measured memory_bytes: 8840
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  ll waru = 0;
  ll num = n;
  while(num > 0){
    waru += num%10;
    num/=10;
  }
  if(n%waru)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;

int main() {

    int a, b, c;
    cin >> a >> b >> c;
    
    cout << (c >= a && c <= b ? "Yes" : "No") << endl;
    
    return 0;
}

Measured memory_bytes: 256
n,m = map(int,input().split())


l = [1]*n
L,R = 0,float('inf')
for _ in range(m):
    a,b = map(int,input().split())
    L = max(L,a)
    R = min(R,b)
ans = R-L+1
if ans<=0:ans = 0
print(ans)


Measured memory_bytes: 75448
SA = input()
SB = input()
SC = input()

pointer = SA[0]
SA = SA[1:]
d = {'a': SA, 'b': SB, 'c': SC}

while True:
    if d[pointer] == '':
        ans = pointer
        break
    tmp = d[pointer][0]
    d[pointer] = d[pointer][1:]
    pointer = tmp

print(ans.upper())

Measured memory_bytes: 9048
#include<bits/stdc++.h>
#define debug(x) cerr << #x << ':' << x << endl
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define ALL(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<double> V(n,0.0);
    REP(i,n)cin >> V[i];
    double ans = 0.0;
    REP(i,n) ans += 1.0/V[i];
    cout << fixed << setprecision(10) << 1/ans << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
nF = list(map(str, input().split('T')))
finalx, finaly = list(map(int, input().split()))

x = []
y = []
for i in range(len(nF)):
    if i % 2 == 0:
        x.append(len(nF[i]))
    else:
        y.append(len(nF[i]))

posy = [0]
if len(x) == 0:
    posx = [0]
elif len(x) == 1:
    posx = [x[0]]
else:
    posx = [x[0]]
    for i in range(1, len(x)):
        plus_x = list(map(lambda elem: elem + x[i], posx))
        minus_x = list(map(lambda elem: elem - x[i], posx))
        plus_x.extend(minus_x)
        posx = list(set(plus_x))

if len(y) >= 1:
    for i in range(len(y)):
        plus_y= list(map(lambda elem: elem + y[i], posy))
        minus_y= list(map(lambda elem: elem - y[i], posy))
        plus_y.extend(minus_y)
        posy = list(set(plus_y))

if finalx in posx and finaly in posy:
    print('Yes')
else:
    print('No')



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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;
typedef long double ld;

const ll Inf = 1e18;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int n, r;
    cin >> n >> r;
    if (n >= 10) {
        cout << r << endl;
    } else {
        cout << r + 100 * (10 - n) << endl;
    }
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<ll>
#define pi pair<ll,ll>
#define vp vector<pi>
#define mp map<ll,ll>
#define pb push_back
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const ll inf=1e+18;


int32_t main(){
    
    fast;

    string s;
    cin>>s;
    
    if(s.size()<6)cout<<"NO"<<endl;
    else{
    if(s[2]==s[3] && s[4]==s[5])
    	cout<<"Yes"<<endl;
    else
    	cout<<"No"<<endl;}




    return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<N;i++)
using namespace std;

int main(){

int N;
cin>>N;

vector<pair<int,int>>v(N-1);
vector<vector<int>>to(N);
rep(i,N-1){
int a,b;
cin>>a>>b;
a--,b--;
v[i]=make_pair(a,b);
to[a].emplace_back(b);
to[b].emplace_back(a);
}
int K=0;
map<pair<int,int>,int>I;
queue<int>q;
bool checked[N]={};

int cs[N]={};//前の頂点からの辺の色
q.push(0);
checked[0]=true;
cs[0]=0;
while(!q.empty()){
    int now=q.front();q.pop();
    int cur=1;
    if(K<to[now].size())K=to[now].size();
    //K=max(K,to[now].size());

    for(auto vp:to[now]){
        if(checked[vp])continue;
        if(cur==cs[now])cur++;
        cs[vp]=I[make_pair(now,vp)]=I[make_pair(vp,now)]=cur++;
        q.push(vp);
        checked[vp]=true;
    }
}
cout<<K<<endl;

for(auto vp:v){
    cout<<I[vp]<<endl;
}



return 0;
}
/*


first 23m14s

3
1 2
2 3

2
1
2

8
1 2
2 3
2 4
2 5
4 7
5 6
6 8

4
1
2
3
4
1
1
2

6
1 2
1 3
1 4
1 5
1 6

5
1
2
3
4
5
*/


Measured memory_bytes: 19840
#include <iostream>
#include <algorithm>
//#include <numeric>
//#include <cmath>
#include <vector>
//#include <string>
typedef long long LL;
using namespace std;

int main(){
    int n, m;
    int tmp_l;
    int tmp_r;
    int ans;
    vector<int> l;
    vector<int> r;

    cin >> n >> m;
    for(int i=0; i<m; i++){
        cin >> tmp_l >> tmp_r;
        l.push_back(tmp_l);
        r.push_back(tmp_r);
    }

    sort(l.begin(), l.end());
    sort(r.begin(), r.end());

    ans = r[0] - l[m-1] + 1;
    if(ans<0){
        ans = 0;
    }

    cout << ans << endl;
}

Measured memory_bytes: 1276
n,T=map(int,input().split())
c_t=[]
for i in range(n):
    c,t=map(int,input().split())
    c_t.append([c,t])

c_t2=sorted(c_t, key=lambda x: x[0])

for a in c_t2: 
    if a[1] <= T:
        print(a[0])
        exit()
print('TLE')

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

using namespace std;

int main() {
int N;
int M;
cin>>N>>M;
  int sum=0;
  for(int i=0;i<M;i++){
    int A;
    cin>>A;
    sum+=A;
  }
  int kekka;
  if(N-sum<0){
    kekka=-1;
  }else{
    kekka=N-sum;
  }
  cout<<kekka<<endl;
  
}


Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int INF = (int)1e9;

struct Edge {
  int to, cap, rev;
  Edge(int to_, int cap_, int rev_) :
    to(to_), cap(cap_), rev(rev_) { }
};

struct FordFulkerson {
  const int V;
  vector<vector<Edge> > G;
  vector<bool> used;
  FordFulkerson(int v) : V(v), G(v), used(v) { }
  void add_edge(int from, int to, int cap) {
    G[from].emplace_back(to, cap, G[to].size());
    G[to].emplace_back(from, 0, G[from].size() - 1);
  }
  int find_flow(int v, int t, int f) {
    if(v == t) return f;
    used[v] = true;
    for(Edge &e : G[v]) {
      if(used[e.to] == false && e.cap > 0) {
        int d = find_flow(e.to, t, min(f, e.cap));
        if(d > 0) {
          e.cap -= d;
          G[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }
  int max_flow(int s, int t) {
    int flow = 0;
    while(true) {
      used.assign(V, false);
      int f = find_flow(s, t, INF);
      if(f == 0) return flow;
      flow += f;
    }
  }
};

int main() {
  while(true) {
    int m, n; cin >> m >> n;
    if(m == 0 && n == 0) break;
    int blue[m], red[n];
    for(int i = 0; i < m; i++) cin >> blue[i];
    for(int i = 0; i < n; i++) cin >> red[i];
    FordFulkerson flow(m+n+2);
    for(int i = 0; i < m; i++) {
      for(int j = 0; j < n; j++) {
        if(__gcd(blue[i], red[j]) != 1) {
          flow.add_edge(i, m + j, 1);
        }
      }
    }
    for(int i = 0; i < m; i++) flow.add_edge(m+n, i, 1);
    for(int i = 0; i < n; i++) flow.add_edge(m+i, m+n+1, 1);
    cout << flow.max_flow(m+n, m+n+1) << endl;
  }
}

Measured memory_bytes: 5484
#include<iostream>
#include<string>
using namespace std;
int main(){
string a;
int b;
cin>>a;
for(int i=0;i<a.size();i++){
	for(int s=0;s<a.size();s++){
		if(a[i]==a[s]){
			b++;
		}
	}
}	
if(a.size()<b){
cout<<"no"<<endl;
}
else{
cout<<"yes"<<endl;
}
}

Measured memory_bytes: 256
fn main() {
    let s: String = {
        let s = read::<String>();
        let mut v: Vec<char> = s.chars().collect();
        v.sort();
        v.into_iter().collect()
    };
    let t: String = {
        let t = read::<String>();
        let mut v: Vec<char> = t.chars().collect();
        v.sort();
        v.reverse();
        v.into_iter().collect()
    };

    if s < t {
        println!("Yes");
    } else {
        println!("No");
    }
}

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

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

#define ff first
#define ss second

#define pb push_back
#define mp make_pair
#define ins insert

#define f(i,n) for(int i = 0 ;  i < n ; i ++)
#define f1(i,n) for(int i = 1 ; i<= n ; i++)

#define int long long int

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test() int t;cin>>t;while(t--)





int32_t main()
{
	fast();

	int n;
	cin >> n;

	map<int,int> m;

	int cnt = 0 ;

	f1(i,n)
	{
		int x;
		cin >> x;

		if(m[i-x]!=0)
			cnt+=m[i-x];
		m[i+x]++;

	}

	cout<<cnt;
	
	return  0 ;
	
}




Measured memory_bytes: 26316
#include<bits/stdc++.h>
#define maxn 200005
using namespace std;
typedef long long LL;
int read()
{
    char c=getchar();int f=1,sum=0;
    while(c<'0' || c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0' && c<='9'){sum=sum*10+c-'0';c=getchar();}
    return sum*f;
}
const LL inf=1e18;
int n,q,x,y;
int pos[maxn];
LL f[maxn<<2],g[maxn<<2],h[maxn<<2],tag[maxn<<2];
void add(int x,LL v){if(f[x]!=inf)f[x]+=v,g[x]+=v,h[x]+=v,tag[x]+=v;}
void pushup(int id){f[id]=min(f[id<<1],f[id<<1|1]);g[id]=min(g[id<<1],g[id<<1|1]);h[id]=min(h[id<<1],h[id<<1|1]);}
void build(int id,int l,int r)
{
	f[id]=g[id]=h[id]=inf;if(l==r) return;
	int mid=l+r>>1;
	build(id<<1,l,mid);build(id<<1|1,mid+1,r);
}
void pushdown(int id){if(tag[id]) add(id<<1,tag[id]),add(id<<1|1,tag[id]);tag[id]=0;}
void modify(int id,int l,int r,int pos,LL val)
{
	if(l==r) {if(val<f[id]) f[id]=val,g[id]=val-l,h[id]=val+l;return;}
	pushdown(id);int mid=l+r>>1;
	if(pos<=mid) modify(id<<1,l,mid,pos,val);
	else modify(id<<1|1,mid+1,r,pos,val);
	pushup(id);
}
LL query(int id,int l,int r,int ql,int qr,int f)
{
	if(ql<=l && r<=qr) {return f?h[id]:g[id];}
	pushdown(id);
	int mid=l+r>>1;
	LL tmp=inf;
	if(ql<=mid) tmp=min(tmp,query(id<<1,l,mid,ql,qr,f));
	if(qr>mid) tmp=min(tmp,query(id<<1|1,mid+1,r,ql,qr,f));
	return tmp;
}
int main()
{
	n=read();q=read();x=read();pos[0]=y=read();
	for(int i=1;i<=q;i++) pos[i]=read();
	build(1,1,n);
	modify(1,1,n,x,0);
	for(int i=1;i<=q;i++)
    {
        LL tmp=min(query(1,1,n,1,pos[i],0)+pos[i],query(1,1,n,pos[i]+1,n,1)-pos[i]);
        add(1,abs(pos[i]-pos[i-1]));
		modify(1,1,n,pos[i-1],tmp);
    }
    printf("%lld\n",f[1]);
	return 0;
}


Measured memory_bytes: 25600