akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    string S;
    cin >> S;
    int res = 700;
    REP(i, 3) {
        if (S[i] == 'o') {
            res += 100;
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
/**       In the name of Allah, the Gracious, the Merciful.
*               Praise be to Allah, Lord of the Worlds.
*               **************************************
*
*    I have not failed, I have just found 1000 WAYS that won't work.
*                 __________________________________
*                  Author  : Abd El-Twab  M. Fakhry
*                 __________________________________
*/

#include <ext/rope>
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define  read(arr, l, r)     for(int i = (l); i < (r); cin >> arr[i++])
#define  print(arr, l, r)    for(int i = (l); i < (r); cout << arr[i++] << " \n"[i == r])
#define  rep(i, l, r)        for (int i = l; i < r; i++)
#define  repr(i, r, l)       for (int i = r; i > l; i--)
#define  trav(a, x)          for (auto & a : x)
#define  PQ(T)               priority_queue < T, vector <T> , greater <T> >
#define  Unique(n)           (n).erase(unique(all(n)), (n).end())
#define  endl                '\n'
#define  all(a)              a.begin() , a.end()
#define  NumberOfDigits(n)   ((int)log10(n) + 1)
#define  sz(a)               (int)a.size()
#define  rall(a)             a.rbegin(), a.rend()
#define  rsz(sz)             resize(sz)
#define  ins(x)              insert(x)
#define  debug(x)            cout << #x << " = " << (x) << '\n'
#define  LINE_ON             cout << "line Number = " << __LINE__ << endl
#define  RT(n)               return cout << (n) << endl, 0;
#define  clr(arr, x)         memset(arr, x, sizeof(arr))
#define  F                   first
#define  S                   second
#define  PB                  push_back
#define  EB                  emplace_back
#define  get(n)              find_by_order(n)
#define  indexOf(n)          order_of_key(n)
#define  isPowerOfTwo(x)     (x && !(x & (x - 1)))
#define  Swap(n, k)           n ^= k, k ^= n, n ^= k;

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

template <class T>
using indexed_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update >;
typedef long long            ll;
typedef unsigned int         uint;
typedef unsigned long long   ull;

int Dx8[8] = { 1, -1, 0, 0, 1, 1, -1, -1 }, Dx4[4] = { 0, 0, 1,-1};
int Dy8[8] = { 0, 0, 1, -1, 1, -1, 1, -1 }, Dy4[4] = { 1,-1, 0, 0};

const double inf  = 1.0 / 0.0,      pi  = 2 * acos(0.0),   error = 1e-9;
const int    MxsZ = (int)2e6 + 6,   mod = (1 << 30) + 7,      oo = 0x3f3f3f3f;

ll Gcd(ll a, ll b)     { return b ? Gcd(b, a % b) : a; }
ll Lcm(ll a, ll b)     { return a * b / Gcd(a, b); }

void Fast()
{
    cin.sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin.exceptions(cin.failbit);
}

void File()
{
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
}

/**----------------------->>  Template  <<-----------------------**/

int n;
map <int, int> ma;

/**------------------>>  Initialization gap  <<------------------**/

int main()
{
    Fast();

    cin >> n; vector <int> v(n), temp; read(v, 0, n);
    rep(i, 0, n)
        ma[v[i]] = i + 1;
    for(auto it : ma) cout << it.S << " ";
}


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

using ll = long long;

const int N = 3005;

ll dp[N][N];
ll a[N];
int n;

void solve() {
    // dp[L][R]: the max value the first player can achieve with interval L, R
    memset(dp, 0, sizeof dp);
    for (int i = 0; i < n; ++i) scanf("%d", a + i);
    for (int L = n - 1; L >= 0; --L) {
        for (int R = L; R < n; ++R) {
            if (L == R) dp[L][R] = a[L];
            dp[L][R] = max(a[L] - dp[L + 1][R], a[R] - dp[L][R - 1]);
        }
    }
    printf("%lld\n", dp[0][n - 1]);
}

int main() {
    while (~scanf("%d", &n)) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 70784
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+5;
const int mod=1e9+7;
int s;
int dp[2005][2005];
int dfs(int sum,int s){
    if(dp[sum][s]!=-1)return dp[sum][s];
    if(sum==s)return dp[sum][s]=1;
    if(sum>s)return dp[sum][s]=0;
    int d=s-sum;
    ll ans=0;
    for(int i=3;i<=d;i++){
        ans+=dfs(sum+i,s);
        ans%=mod;
    }
    return dp[sum][s]=ans;
}

int main(){
    memset(dp,-1,sizeof dp);
    scanf("%d",&s);

    printf("%d\n",dfs(0,s));

    return 0;
}


Measured memory_bytes: 19476
#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;

int main()
{
  int input,h,m,s;
  cin >> input;
  h = input / 3600;
  m = (input - h*3600) / 60;
  s = input - h*3600 - m*60;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}

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

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

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;

// Library
//

int main() {
#ifdef MYLOCAL
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    int N; cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; ++i){
        cin >> A[i];
        A[i] *= 2;
    }

    // x0 = 0 のとき
    ll offset = 0;
    for (int i = 0; i < N; ++i){
        offset = A[i] - offset;
    }
    ll x = offset / 2;

    // 復元
    ll cur = x;
    for (int i = 0; i < N; ++i) {
        cout << cur << " ";
        cur = A[i] - cur;
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

const int H = 1e6 + 9;
const int MOD = 1e9 + 7;

int add(int a, int b) {
	return (a + b) % MOD;
}

int sub(int a, int b) {
	return (a - b + MOD) % MOD;
}

int mul(int a, int b) {
	return 1LL * a * b % MOD;
}

int dp[H];
int sb[H];

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

	int n, h, d;
	cin >> n >> h >> d;
	dp[0] = 1;
	int S = 0;
	{
		int c = 1;
		for (int i = 1; i <= n; i++) {
			c = mul(c, i);
			S = add(S, c);
		}
	}
	int C = 0;
	for (int m = 0; m <= h; m++) {
		C = sub(C, sb[m]);
		if (m > 0) {
			dp[m] = C;
		}
		int V = dp[m];
		if (m > 0) {
			V = mul(V, S);
		}
		C = add(C, V);
		if (m + d + 1 <= h) {
			sb[m + d + 1] = add(sb[m + d + 1], V);
		}
	}
	int ans = dp[h];
	for (int i = 1; i <= n; i++) {
		ans = mul(ans, i);
	}
	cout << ans << '\n';
}

Measured memory_bytes: 10956
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // dequef
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define all(a) (a).begin(), (a).end()
#define mod 1000000007
using ll = long long;
using namespace std;
int dfs(vvi &dis,int R, vi &r, int pos, int current, vi checked){
  int best = 1000000000;
  rep(i, R){
    if(!checked[i]){
      checked[i] = 1;
      best = min(best, dfs(dis, R, r, i, current + dis[pos][r[i]], checked));
      checked[i] = 0;
    }
  }
  return (best == 1000000000) ? current : best;
}
int main(){
  int n,m,R;
  cin >> n >> m >> R;
  vi r(n);
  rep(i, R){
    cin >> r[i];
    r[i]--;
  }
  vector<vector<pii>> root(n);
  rep(i, m){
    int a,b,c; // 0 ~
    cin >> a >> b >> c;
    a--; b--;
    root[a].push_back(make_pair(b, c));
    root[b].push_back(make_pair(a, c));
  }
  vvi distance(R, vi(n, -1));
  rep(i, R){
    priority_queue<pii, vector<pii>, greater<pii>> que;
    // <最短距離, 頂点>
    que.push(make_pair(0, r[i])); //0 をスタート地点として距離を0とする
    distance[i][r[i]] = 0;
    while(!que.empty()){
      pii info = que.top();
      que.pop();
      int pos = info.second;
      if(distance[i][pos] < info.first) continue;
      for(pii x : root[pos]){
        int next = x.first;
        int kyori = x.second + distance[i][pos];
        if(distance[i][next] == -1 || distance[i][next] > kyori){
          que.push(make_pair(kyori, next));
          distance[i][next] = kyori;
        }
      }
    }
  }
  vi checked(R);
  int ans = 1000000000;
  rep(i, R){
    checked[i] = 1;
    ans = min(ans, dfs(distance, R, r, i, 0, checked));
    checked[i] = 0;
  }
  cout << ans << endl;
}

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

int main(){
  string s; cin>>s;
  cout << count(s.begin(), s.end(), '1') << endl;
}

Measured memory_bytes: 3552
import math
l=int(input())-1
n=int(math.log2(l+1)+1)
E=[]
for i in range(n-1):
    E.append([i+1,i+2,0])
    E.append([i+1,i+2,2**i])
i=n-2
while l>2**(n-1)-1:
    t=l-2**i+1
    if t>2**(n-1)-1:
        E.append([i+1,n,t])
        l=t-1
    i-=1
print(n,len(E))
for i in range(len(E)):
    print(*E[i])

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

int main() {
    string s;
    cin >> s;
    int cnt=0;
    if (s[0] == 'R') {
        cnt++;
        if (s[1] == 'R') {
            cnt++;
            if (s[2] == 'R') {
                cnt++;
            }
        }
    } else {
        if (s[1] == 'R') {
            cnt++;
            if (s[2] == 'R') {
                cnt++;
            }
        } else {
            if (s[2] == 'R') {
                cnt++;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

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

int N; vector<pair<int,int>> P; vector<int> h;
void input()
{
    cin >> N;
    for(int i=0; i<N; ++i){
        int a,b,c; cin>>a>>b>>c;
        P.emplace_back(make_pair(a,b));
        h.emplace_back(c);
    }    
}

void solve()
{
    for(int i=0; i<=100; ++i){
        for(int j=0; j<=100; ++j){
            int H;
            for(int k=0; k<N; ++k){
                if(h[k] > 0) {
                    H = abs(i-P[k].first) + abs(j-P[k].second) + h[k]; 
                    break;
                }
            }
            bool chk = true;
            for(int k=0; k<N; ++k){
                if(H != abs(i-P[k].first) + abs(j-P[k].second) + h[k]){
                    if(h[k] == 0 && H < abs(i-P[k].first) + abs(j-P[k].second)){
                        continue;
                    }
                    chk = false; break;
                }
            }
            if(chk){
                cout << i << " " << j << " " << H << endl;
                return;
            }
        }
    }
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 3616
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
struct node{
	int l,r;
}a[100000+20];
bool cmp(node a,node b)
{
	if(a.r==b.r)
		return a.l<b.l;//右边相同比较左边
	return a.r<b.r;//对数据右排序
}
int main ()
{
	int n,m,i;
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++)
		scanf("%d %d",&a[i].l,&a[i].r);
	int mn=a[0].r;

	sort(a,a+m,cmp);//排序
    int now=0,ans=0;//找到最小的
	for(i=0;i<m;i++)
	{
		if(a[i].l>=now)
		{
			now=a[i].r;//如果下一个数据的左边大于切断桥的右边则仍然需要切桥
			ans++;
		}

	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 1024
t=int(input())
for i in range(1):
    #a=list(map(int,input().split(' ')))
    a=[int(i) for i in input().split()]
    s=0
    for i in a:
        s=s+i 
    s=s//t 
    ans=1e9
    k=0
    for i in range(2):
        k=0
        for j in a:
           k=k+(j-s-i)*(j-s-i)
        ans=min(ans,k)
    print(ans)
        

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
#include<ext/pb_ds/priority_queue.hpp>
using namespace std;

typedef long long LL;

LL N,A,B,C;

int main()
{
	#ifdef DMC
		freopen("DMC.txt","r",stdin);
	#endif
	
	cin >> N >> A >> B;
	if (A > B) cout << 0 << endl;
	else if (N == 1 && A != B) cout << 0 << endl;
	else if (N <= 2) cout << 1 << endl;
	else cout << (B - A) * (N - 2) + 1LL << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
#define INF (1<<29)

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long inf=1000000000000000000;
int main(){
    string s;
    cin>>s;
    if(s=="SSS")cout<<"0"<<endl;
    if(s=="SSR")cout<<"1"<<endl;
    if(s=="SRS")cout<<"1"<<endl;
    if(s=="RSS")cout<<"1"<<endl;
    if(s=="SRR")cout<<"2"<<endl;
    if(s=="RSR")cout<<"1"<<endl;
    if(s=="RRS")cout<<"2"<<endl;
    if(s=="RRR")cout<<"3"<<endl;
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
//long long num[100000];
int main(){
	long long x,t;
	cin>>x>>t;
	if((x-t)<0) cout<<0<<endl;
	else cout<<x-t<<endl;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
stop = False
for a in range(1, 3501):
    if stop:
        break
    for b in range(1, 3501):
        p = (n*a*b)
        q = 4*a*b - n*a - n*b
        if q > 0:
            r, s = divmod(p, q)
        
            if s == 0 and r > 0:
                print(a, b, r)
                stop = True
                break


Measured memory_bytes: 40796
#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

int main() {
    ll H, W;
    cin >> H >> W;
    vector<string> a(H);
    for (ll i = 0; i < H; i++) {
        cin >> a[i];
    }

    vector<bool> all_white_raw(H, true), all_white_col(W, true);
    for (ll i = 0; i < H; i++) {
        for (ll j = 0; j < W; j++) {
            if (a[i][j] == '#') {
                all_white_raw[i] = false;
                all_white_col[j] = false;
            }
        }
    }

    for (ll i = 0; i < H; i++) {
        if (all_white_raw[i]) {
            continue;
        }
        for (ll j = 0; j < W; j++) {
            if (all_white_col[j]) {
                continue;
            }
            printf("%c", a[i][j]);
        }
        printf("\n");
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MOD 1000000007
#define MOD2 1000000006
#define TEMPMOD1 998244353
#define TEMPMOD2 998244352
#define INF 1000000000000000007
#define NEGINF -1000000000000000007
#define vll vector<ll> 
#define vvll vector<vector<ll>>
#define pll pair<ll,ll>
#define plll pair<ll,pll>
#define vpll vector<pll>
using namespace std;
typedef long long int ll;


int main()
{
    ios_base::sync_with_stdio(false);
    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";
    }
    else
    {
        cout<<"No";
    }
    return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
int M,N,A,B,C,a,b,mod;
typedef pair<int,int> P;
typedef pair<int,P> PP;
vector< set<P> > ss;
set<P>::iterator it;
vector<PP> vc;
int ran(){
	a=36969*(a&mod)+(a>>16);
	b=18000*(b&mod)+(b>>16);
	return (C&((a<<16)+b))%1000000;
}
int main(){
	while(true){
		cin>>M>>N>>A>>B;
		if(M+N==0) break;
		ss.clear();
		vc.clear();
		a=A,b=B,C=~(1<<31),mod=(1<<16)-1;
		rep(i,M){
			int x,y,z;
			cin>>x>>y>>z;
			vc.pb(PP(x,P(-y,-z)));
		}
		rep(i,N){
			int x=ran(),y=ran(),z=ran();
			vc.pb(PP(x,P(-y,-z)));
		}
		sort(all(vc));
		N=M+N;
		rep(i,N) vc[i].sc.fs*=-1,vc[i].sc.sc*=-1;
		set<P> be;
		be.insert(P(-2,-2));
		ss.pb(be);
		int mx=0;
		rep(i,N){
			int y=vc[i].sc.fs,z=vc[i].sc.sc;
			int ub=mx+1,lb=-1;
			while(ub-lb>1){
				int m=(ub+lb)/2;
				it=ss[m].upper_bound(P(y-1,z-1));
				if(it==ss[m].begin()){
					ub=m;
					continue;
				}
				it--;
//				printf("m=%d, koko;%d,%d\n",m,it->fs,it->sc);
				if(it->sc<z) lb=m;
				else ub=m;
			}
			if(lb==-1) continue;
			int m=lb+1;
//			printf("m=%d\n",m);
			if(m>mx){
				set<P> be;
				be.insert(P(y,z));
				ss.pb(be);
				mx++;
			}else{
				it=ss[m].lower_bound(P(y,z));
				while(it!=ss[m].end()){
					if(it->sc<z) break;
//					printf("erase=(%d,%d)\n",it->fs,it->sc);
					it=ss[m].erase(it);
				}
				bool ok=true;
				it=ss[m].upper_bound(P(y,-1919));
				if(it!=ss[m].end()&&it->fs==y&&it->sc<z) ok=false;
				if(it!=ss[m].begin()){
					it--;
					if(it->sc==z) ok=false;
				}
				if(ok) ss[m].insert(P(y,z));
			}
/*			printf("i=%d,  y,z=(%d,%d)     mx=%d\n",i,y,z,mx);
			cout<<"ss[1]";
			for(auto s:ss[1]) cout<<"("<<s.fs<<","<<s.sc<<") ";
			puts("");
			if(ss.size()>2){
				cout<<"ss[2]";
				for(auto s:ss[2]) cout<<"("<<s.fs<<","<<s.sc<<") ";
				puts("");
			}*/
		}
		cout<<mx<<endl;
	}
}

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

typedef long long ll;

#define F first 
#define S second 
#define PB push_back
#define MP make_pair 
#define rep(i,a,b) for (ll i=a;i<b;i++)

typedef vector<int> vi;
typedef pair<int,int> pi;


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

    if(a+b+c >=22)
    {
        cout<<"bust"<<endl;
        return 0; 
    }
    else
    {
        cout<<"win"<<endl;
        return 0; 

    }

    return 0; 
}



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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
using Graph = vector<vector<int>>;

int main(){
    ll x,t; cin>>x>>t;
    cout<<max((ll)0,x-t)<<endl;
}

Measured memory_bytes: 3572
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, K, Q = sc.nextInt()
  val as = List.fill(Q)(sc.nextInt()).groupBy(identity).mapValues(_.length)
  val f = (i: Int) => if (0 < K - Q + i) "Yes" else "No"
  (1 to N).foreach(i => println(f(as.getOrElse(i, 0))))
}

Measured memory_bytes: 75552
#define _CRT_SECURE_NO_WARNINGS
#include <cmath>
#include <cstdio>

using namespace std;

int main()
{
    double a, b;
    if (scanf("%lf%lf", &a, &b) < 2) return 0;

    int ans = (int)ceil((a + b) / 2);

    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    int sum = 0;
    for(int i=0;i<n;++i) {
        cin >> a[i];
        sum += a[i];
    }

    int lb = (sum + 4*m - 1) / (4*m);
    int cnt = 0;
    for(int i=0;i<n;++i) {
        if(a[i] >= lb) ++cnt;
    }
    cout << ((cnt >= m) ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define forloop(n) for(int i = 0; i < n; i++)
#define ll long long
 
#define mod 1000000007
long long exp(long long taban, long long us) {
    long long carpan = taban;
    long long temp = us;
    long long res = 1;
    for(int i = 0;;i++){
        if(temp % 2) res = (res*carpan) % mod;
        temp /= 2;
        carpan = (carpan*carpan) % mod;
        if(temp == 0) break;
    }
    return res;
}
ll ebob(ll a, ll b){
	if(!a)return b;
	return ebob(b%a, a);
}
ll ekok(ll a, ll b){
	return (((a*b)%mod)*(exp(ebob(a,b), (ll)mod-2))) % mod;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n, k; cin>>n>>k;
	cout<<(n > 10 ? k : k + 100*(10-n))<<endl;
}


Measured memory_bytes: 256
// Tutorial question
#include<bits/stdc++.h>
#define D if (debug)
#define P(x) {if (debug) cout << x << endl;}
#define H(x) P(#x << ": " << (x))
#define FAR(i,a,b) for (auto i=(a); i!=(b); ++i)
#define FR(i,a,b) for (int i=(a); i<(b); ++i)
#define F(i,n) FR(i,0,n)
#define SZ(s) (int)(s).size()
#define ALL(v) v.begin(), v.end()
#define V vector
#define VI V<int>
#define S set
#define SI S<int>
#define PI pair<int, int>
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f

using namespace std;
const bool debug = 0;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b;
  cin >> a >> b;
  int ans = -INF;
  ans = max(ans, a+b);
  ans = max(ans, a-b);
  ans = max(ans, a*b);
  cout << ans << endl;
  return 0;
}


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

int main(){
    long N;
    cin>>N;

    int S,num=N;
    while(num){
    int dig = num % 10;
    S = S + dig;
    num = num / 10;
  }

  if(N%S==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

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

main(){
int n , k , x ,y;
cin>>n>>k>>x>>y;
if(n<=k){
    cout<<x*n<<endl;

}
else{
    cout<<(k*x) + ((n-k)*y)<<endl;
}
}


Measured memory_bytes: 3572
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int ans = INT_MAX;

    for (int i=0; i<n; i++) {
        int a;
        cin >> a;
        int cnt = 0;
        while(a%2 == 0) {
            a /= 2;
            cnt++;
        }

        ans = min(ans, cnt);
    }
    cout << ans << endl;
}

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

using namespace std;

typedef pair<int, int> P;

int dist(const P &p1, const P &p2)
{
    return abs(p1.first - p2.first) + abs(p1.second - p2.second);
}

int main()
{
    int H, W, D;
    cin >> H >> W >> D;
    // vector< vector<int> > A(H, vector<int>(D));
    unordered_map<int, P> position;
    int a;
    for (int i = 0; i < H; ++i)
    {
        for (int j = 0; j < W; ++j)
        {
            cin >> a;
            position[--a] = P(i, j);
        }
    }
    int Q;
    cin >> Q;
    vector< int > cost(H*W);
    for(int i=0;i<H*W-D;++i){
        cost[i+D] = cost[i] + dist(position[i], position[i+D]);
    }
    int l, r, ans;

    for (int i = 0; i < Q; ++i)
    {
        ans = 0;
        cin >> l >> r;
        --l;
        --r;
        cout << cost[r] - cost[l] << endl;
    }
}

Measured memory_bytes: 5284
#include <iostream>
#include <set>
#include <vector>

using namespace std;

set <int> a;

int main()
{
    int n, m, x;
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        int k;
        cin >> k;
        if (i == 1)
        {
            for (int j = 0; j < k; j++)
            {
                cin >> x;
                a.insert(x);
            }
        }
        else
        {
            set <int> two;
            for (int j = 0; j < k; j++)
            {
                cin >> x;
                two.insert(x);
            }
            vector <int> eras;
            for (auto j : a)
            {
                if (two.count(j) == 0)
                {
                    eras.push_back(j);
                }
            }
            for (auto j : eras)
                a.erase(j);
        }
    }
    cout << a.size();
    return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  
  vector<int> A(M), B(M);
  for (int i=0; i<M; i++){
    cin >> A[i] >> B[i];
  }
  
  map<int, set<int>> m;
  for (int i=0; i<M; i++) {
    m[A[i]].insert(B[i]);
    m[B[i]].insert(A[i]);
  }
  
  vector<int> AB(N+1);
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int key = q.front();
    for(auto v : m[key]) {
      if (AB[v] != 0) continue;
      AB[v] = key;
      q.push(v);
    }
    q.pop();
  }
  
  bool flag = false;
  for (int i=2; i<N+1; i++) {
    //cerr << AB[i] << endl;
    if(AB[i] == 0) flag = true;
  }

  if (flag) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    for (int i=2; i<N+1; i++) {
      cout << AB[i] << endl;
    }
  }
  
  return 0;
}

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

int main(){
	int n;
	cin>>n;
	map<int,int> mp[2];
	for(int i = 0; i < n; i++){
		int t;cin>>t;
		mp[i&1][t]++;
	}
	vector<pair<int,int>> pr[2];
	for(int i = 0; i < 2; i++){
		for(auto &p : mp[i]){
			pr[i].emplace_back(p.second, p.first);
		}
		if(pr[i].size() == 1){
			pr[i].emplace_back(0,-1);
		}
		sort(pr[i].rbegin(),pr[i].rend());
	}
	int rs  = 0;
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 2; j++){
			if(pr[0][i].second!=pr[1][j].second){
				rs= max(rs,pr[0][i].first+pr[1][j].first);
			}
		}
	}
	cout<<n-rs;
}

Measured memory_bytes: 6136
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <bitset>
#include <vector>
using namespace std;
 
const int N = 1e6 + 7;
vector<int> adj[N];
bool vis[N] = {false};

void dfs(int u, int p) {
    vis[u] = true;
    for (auto v : adj[u]) {
        if (v == p) {
            continue;
        }
        if (!vis[v]) {
            dfs(v, u);
        }
    }
}

int main() {
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    #endif
    int n, m;
    scanf("%d %d", &n, &m);
    for (int i = 0; i < m; ++i) {
        int x, y;
        scanf("%d %d", &x, &y);
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    int count = 0;
    for (int i = 1; i <= n; ++i) {
        if (!vis[i]) {
            count += 1;
            dfs(i, -1);
        }
    }
    printf("%d\n", count - 1);
    return 0;
}

Measured memory_bytes: 31412
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int A[3];
	int sum = 0;

	rep(i, 3) cin >> A[i];
	rep(i, 3) sum += A[i];

	cout << (sum >= 22 ? "bust" : "win") << endl;

	return 0;
}

Measured memory_bytes: 256
#1行目が整数の場合
r = int(input())
#問題分より
#半径 a の円に内接する正十二角形の面積は 3aの2乗
#入力値は半径r
#よって問題文をそのまま実装する
# a * b → a x b、a ** b→ aのb乗
print(3 * r ** 2)


Measured memory_bytes: 38384
#include <stdio.h>

int main(void){
  
  int a;
  int b;
  int c;
  
  scanf("%d %d %d",&a,&b,&c);
  
  if(a + b >= c){
    puts("Yes");
  }
  else{
    puts("No");
  }
  
  return 0;
}
   
  


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace Test1 {

    class ClassMain {

        static int[,] combi = new int[1001,1001];
        
        static void initCombi() {
            combi[0, 0] = 1;
            for (int n = 0; n <= 1000; n++) {
                combi[n, 0] = 1;
                combi[n, 1] = n;
                for (int x = 2; x < n; x++) {
                    combi[n, x] = combi[n - 1, x] + combi[n - 1, x - 1];
                    combi[n, x] %= 100000007;

                }
                combi[n, n] = 1;
            }
        
        }

        public static void Main(String[] args) {
            string line;
            initCombi();
            while ((line = Console.ReadLine()) != null) {
                string[] strs = line.Split(' ');
                int r = int.Parse(strs[0]), c = int.Parse(strs[1]);
                int a1 = int.Parse(strs[2]), a2 = int.Parse(strs[3]);
                int b1 = int.Parse(strs[4]), b2 = int.Parse(strs[5]);

                int xD = b1 - a1;
                if (xD < 0) { xD *= -1; }
                if (xD > r / 2) { xD = r - xD; }
                int yD = b2 - a2;
                if (yD < 0) { yD *= -1; }
                if (yD > c / 2) { yD = c - yD; }

                long kihon = combi_cal(xD + yD, xD);
                kihon %= 100000007;
                if (xD == r  - xD) { kihon *= 2; }
                if (yD == c  - yD) { kihon *= 2; }
                kihon %= 100000007;
                Console.WriteLine(kihon);
            
            }      
        }

        //combination. pick x elements out of n elements.
        public static long combi_cal(int n, int x) {
            if (n == 0) { return 1; }
            if (x == 0) { return 1; }
            if (x > n / 2) { x = n - x; }
            return combi[n,x];

        }

        

    }

}

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

int main()
{
  int N;
  float M;

  cin >> N >> M;

  vector<float> A(N);

  float sum = 0;

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

  int count = 0;

  for (int i = 0; i < N; i++)
  {
    if (A.at(i) >= sum / (4 * M))
    {
      count++;
    }
  }

  if (M <= count)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

char field[10][10];
bool visited[10][10];
bool possible = false;
int ans_cnt = 0;
struct Point {
	int y, x, cnt;
};

int H, W;

bool ng(int y, int x) {
	return y < 0 || H <= y || x < 0 || W <= x;
}

void grid_dfs(Point now) {
	int i, j;/*
	dump(now.y);
	dump(H - 1);
	dump(now.x);
	dump(W - 1);
	dump(now.cnt);
	dump(ans_cnt);*/
	if (now.y == H - 1 && now.x == W - 1) {
		if (now.cnt == ans_cnt) possible = true;
		else dump(now.cnt);
	}
	Point next = now;
	next.cnt++;
	rep(i, 2) {
		next.y = now.y + dy[i];
		next.x = now.x + dx[i];
		if (ng(next.y, next.x)) continue;
		if (visited[next.y][next.x]) continue;
		if (field[next.y][next.x] == '#') {
			field[next.y][next.x] = 'x';
			grid_dfs(next);
			field[next.y][next.x] = '#';
		}
	}
}

int main() {
	//.............
	cin >> H >> W;
	rep(i, H) {
		cin >> field[i];
	}
	//..............
	rep(i, H) rep(j, W) {
		if (field[i][j] == '#') ans_cnt++;
	}
	dump(ans_cnt);
	grid_dfs({ 0,0,1 });
	if (field[0][0] != '#') possible = false;
	puts(possible ? "Possible" : "Impossible");
	return 0;
}

Measured memory_bytes: 256
from sys import stdin, setrecursionlimit


def main():
    n, k = map(int, stdin.readline().split())
    p = list(map(int, stdin.readline().split()))

    sp = [0] * 1001

    for i in range(1, 1001):
        sp[i] = sum(range(i + 1)) / i

    summary = [0] * n
    summary[0] = sp[p[0]]
    for i in range(1, n):
        summary[i] = summary[i - 1] + sp[p[i]]

    max = summary[k - 1]
    for i in range(k, n):
        tmp = summary[i] - summary[i - k]
        if tmp > max:
            max = tmp
    print(max)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

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

const long long INF = 3e18 + 12;
const int inf = 1e9;

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

  int n = s.length();
  int ans = 0;

  rep(i, n) {
    if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
      int a = 0;
      rep(j, n - i) {
        if (s[i + j] == 'A' || s[i + j] == 'C' || s[i + j] == 'G' || s[i + j] == 'T') {
          a++;
          ans = max(ans, a);
          continue;
        }
        break;
      }
    }
  }
  cout << ans << endl;

  return 0;
}

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

using namespace std;

#define PI acos(-1)

struct xyz{
  double x,y,z;
};

double abs(xyz a) {
  return sqrt(a.x*a.x+a.y*a.y+a.z*a.z);
}

double product(xyz a,xyz b) {
  return a.x*b.x+a.y*b.y+a.z*b.z;
}

int main() {
  int n,m;
  while(cin >> n,n) {
    vector<xyz> s(n);
    for(auto&a:s) cin >> a.x>>a.y>>a.z;
    cin >> m;
    vector<pair<xyz,double> > t(m);
    for(auto &a:t)
      cin >> a.first.x>>a.first.y>>a.first.z >> a.second;
    int ans=0;
    for(int i=0;i<n;++i){
      for(int j=0;j<m;++j){
        double co=product(s[i],t[j].first);
        co/=abs(s[i])*abs(t[j].first);
        double theta=acos(co);
        if(theta>PI) theta-=PI;
        if(theta<=t[j].second) {
          ans++;
          break;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}


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

int main() {
	int x,y,s;
	int p[14][14]={0};
	while(scanf("%d,%d,%d",&x,&y,&s)>0){
		x+=2;y+=2;
		p[x][y]+=1;
		p[x+1][y]+=1;p[x][y-1]+=1;
		p[x][y+1]+=1;p[x-1][y]+=1;
		if(s==1) continue;
		p[x+1][y+1]+=1;p[x+1][y-1]+=1;
		p[x-1][y+1]+=1;p[x-1][y-1]+=1;
		if(s==2) continue;
		p[x+2][y]+=1;p[x-2][y]+=1;
		p[x][y+2]+=1;p[x][y-2]+=1;
	}
	int cnt=0,max=0;
	for(int i=2;i<12;i++){
		for(int j=2;j<12;j++){
			if(p[j][i]==0) cnt++;
			if(max<p[j][i]) max=p[j][i];
		}
	}
	cout<<cnt<<endl<<max<<endl;
	return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
#define  ll long long
const int N = 100005;
const int mod = 1e9+7;
int a[N];
int num[N];
ll qpow(ll a,ll b,ll p)
{
	ll ans=1%p;
	while(b)
	{
		if(b&1) ans=(ans*a)%p;
		b>>=1;
		a=(a*a)%p;
	}
	return ans;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
	{
      scanf("%d",&a[i]);  
      num[a[i]]++;
	}
	if(n%2==1)
	{
		int flag=1;
		for(int i=n-1;i>=0;i-=2)
		{
			
			if(i==0)
			{
				if(num[i]!=1)
				{
					flag=0;
					break;
				}
			}
			else
			{
				if(num[i]!=2)
				{
					flag=0;
					break;
				}
			}
		}
		if(flag==0)    printf("0\n");
		else
		{
			ll ans=qpow(2,n/2,mod)%mod;
			printf("%lld\n",ans);
		}
	}
	else
	{
		int flag=1;
		for(int i=n-1;i>=1;i-=2)
		{
			
				if(num[i]!=2)
				{
					flag=0;
					break;
				}
		}
		if(flag==0)    printf("0\n");
		else
		{
			ll ans=qpow(2,n/2,mod)%mod;
			printf("%lld\n",ans);
		}
	}
    return 0;
}


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

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

using namespace std;

const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;cin >>n >> k;
    int ans = 0;
    //int a=((n)%11)+1;
    int a=((n-2)%11);
    switch(k){
    case 0:ans+=(a>=1)+(a>=4)+(a>=6)+(a>=9)+(a>=7);
        break;
    case 1:ans+=(a>=2)+(a>=5)+(a>=8)+(a>=11)+(a>=3);
        break;
    case 2:ans+=(a>=1)+(a>=4)+(a>=7)+(a>=9)+(a>=10);
        break;
    case 3:ans+=(a>=3)+(a>=5)+(a>=8)+(a>=11)+(a>=6);
        break;
    case 4:ans+=(a>=1)+(a>=4)+(a>=7)+(a>=10)+(a>=2);
        break;
    case 5:ans+=(a>=3)+(a>=6)+(a>=8)+(a>=11)+(a>=9);
        break;
    case 6:ans+=(a>=2)+(a>=4)+(a>=7)+(a>=10)+(a>=5);
        break;
    case 7:ans+=(a>=3)+(a>=6)+(a>=11)+(a>=9)+(a>=1);
        break;
    case 8:ans+=(a>=2)+(a>=5)+(a>=7)+(a>=10)+(a>=8);
        break;
    case 10:ans+=(a>=2)+(a>=5)+(a>=8)+(a>=10)+(a>=11);
        break;
    case 9:ans+=(a>=1)+(a>=3)+(a>=6)+(a>=9)+(a>=4);
        break;
    }
    ans+=((n-2)/11)*5;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>

int main(){
while(1){
  int R0,W0,C,R;
  scanf("%d %d %d %d",&R0,&W0,&C,&R);
  if(R0==0)break;
  if(R0>=W0*C)printf("0\n");
  else printf("%d\n",(W0*C-R0+R-1)/R);
}
  return 0;
}



Measured memory_bytes: 3204
<?php
$n = intval(fgets(STDIN));
$A = array_map("intval", explode(" ", trim(fgets(STDIN))));
$j = 0;
$bits = 0;
$sum = 0;
foreach($A as $i => $a){
  while($bits & $A[$i]){$bits^=$A[$j];$j++;}
  $bits |= $a;
  $sum += $i - $j + 1;
}
echo $sum;


Measured memory_bytes: 27120
function main(input) {
    var k = input[0].split(' ')[1];
    var str = input[1].split('');
    str[k-1] = str[k-1].toLowerCase();
    str = str.join('');
    console.log(str);
  }
  main(require('fs').readFileSync('/dev/stdin', 'utf8').split('\n'));
  

Measured memory_bytes: 7372
fun main(arr:Array<String>) {
    val ans = readLine()!!.split(" ").map { it.toLong() }.let { getAns(it[0], it[1]) }
    println(ans)
}

fun getAns(l:Long, r:Long):Int {
    var num = l / 2019
    if(l % 2019 != 0L) {
        num++
    }
    num *= 2019
    if(num <= r) {
        return 0
    }
    num = l / 673
    if(l % 673 != 0L) {
        num++
    }
    num *= 673
    if(num <= r) {
        for(i in (l..r)) {
            if(i % 3  == 0L) {
                return 0
            }
        }
    }
    var ans = 2019
    for(i in (l..r)) {
        for(j in (l..r)) {
            if(i == j) {
                continue
            }
            ans = Math.min(ans, ((i*j)%2019).toInt())
        }
    }
    return ans
}


Measured memory_bytes: 37916
n = int(input())
pi = 3.141592653589793238462643383279
xy = [list(map(int, input().split())) for _ in range(n)]
import math

atan = [math.atan2(x[0], x[1]) for x in xy]
d = []


def hoge(a):
    ret = 0
    if a % (2*pi) < pi:
        ret = (a % pi)
    elif a % (2*pi)  > pi:
        ret = (a % pi)-pi
    else:
        ret = (a)
    #assert pi <= ret <= pi, 'range over'
    return ret  # -pi <= a <= pi


def seikika(A):
    ret = []
    for a in A:
        ret.append(hoge(a))
    return ret


gyoukaku = atan.copy()
gyoukaku.extend(seikika([a + pi for a in atan]))
M=60
for m in range(M):
    gyoukaku.extend(seikika([a + pi*(2*pi/M*m) for a in atan]))


def dist(xy):
    xx = sum([x[0] for x in xy])
    yy = sum([y[1] for y in xy])
    return (xx ** 2 + yy ** 2) ** 0.5


for g in gyoukaku:
    anglist = seikika([hoge(a - g) for a in atan])
    anglist = seikika(anglist)
    finalxy = []
    for i in range(n):
        if -pi / 2 -0.000001 <= anglist[i] <= pi / 2+0.000001:
            finalxy.append(xy[i])
    d.append(dist(finalxy))

print(max(d))


Measured memory_bytes: 3476
#pragma GCC optimize (3)
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<unordered_map>
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#include<ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>*/
//#include<ext/rope>
#define ll long long
#define ull unsigned long long
#define INFI 2147483647
#define INFL 9223372036854775807
#define INFU 18446744073709551615
using namespace std;
//using namespace __gnu_pbds;
//using namespace __gnu_cxx;
const double PI=acos(-1.0);
const double eps=1e-6;
inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
signed main()
{
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
    ll n;
    cin>>n;
    ll res=n-1; 
    for(ll a=1;a*a<=n;a++) if (n%a==0) res=min(res,a+n/a-2);
    cout<<res<<endl;
    return 0;
}


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

ll ans(int tw,int &n,int start,vector<pair<int,int>> vp,ll ** dp){
  if(tw == 0 || start == n){
      return 0;
  }
  if(dp[start][tw] != -1){
      return dp[start][tw];
  }
  ll op1 = tw >= vp[start].first ? (vp[start].second + ans(tw-vp[start].first,n,start+1,vp,dp)) : 0;
  ll op2 = ans(tw,n,start+1,vp,dp);
  return dp[start][tw] = max(op1,op2);
}

int main() {
    int n,tw;
    cin>>n>>tw;
    vector<pair<int,int>> vp(n);
    for(int i = 0;i < n ;i++){
        cin>>vp[i].first>>vp[i].second;
    }
    ll ** dp = new ll*[n];
    for(int i = 0;i < n;i++){
        dp[i] = new ll[100001];
        for(int j = 0;j < 100001;j++){
            dp[i][j] = -1;
        }
    } 
    cout<<ans(tw,n,0,vp,dp);
    for(int i = 0;i < n;i++){
        delete [] dp[i];
    }
    delete [] dp; 
}


Measured memory_bytes: 81840
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
P p[100010];
vector <ll>x;


int search(ll X){
  int L=0,M,R=x.size();
  while(L<R){
    M=(L+R)/2;
    if(X<=x[M]) R=M;
    else L=M+1;
  }
  return L;
}

int main(){
  ll n,T,q;
  cin>>n>>T>>q;

  for(int i=0,idx=-1,dir;i<n;i++){
    ll a;
    cin>>a>>dir;
    dir--;
    if(dir==0) idx=i;
    p[i]=P(a,dir);
    if(i&&idx!=-1&&dir==1){
      ll dis=(p[i].f+p[idx].f)/2;
      if(abs(p[i].f-dis)<=T)x.push_back(dis);
      idx=-1;
    }
  }

  //  for(int i=0;i<x.size();i++)cout <<x[i]<<" ";cout <<endl;

  while(q--){
    int Q;
    cin>>Q;
    Q--;
    ll a=p[Q].f;
    int dir=p[Q].s;
    int idx=search(a)-(dir? 1:0);
    ll ans=(dir? -1:1)*T+a;
    if(!((dir==1&&idx==-1)||(dir==0&&idx==(int)x.size()))&&abs(x[idx]-a)<=T)ans=x[idx];
    cout <<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 2984
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>
#include <cassert>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから-----------
int main(void){
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    bool ok = true;
    ll ans = 1;
    rep(i, n){
        if(a[i] == 0){
            cout << 0 << endl;
            return 0;
        }
        if(ans <= (ll)1e18 / a[i]){
            ans *= a[i];
        } else {
            ok = false;
        }
    }
    if(!ok){
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }
}


Measured memory_bytes: 4052
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int llint;
int main() {
	int n, d, x;
	int a;
	cin >> n >> d >> x;
	for (int i = 0;i < n;i++) {
		cin >> a;
		if (d%a == 0) {
			x += d / a;
		}
		else {
			x += d / a + 1;
		}
	}
	cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){fastio
    ll x,y;cin>>x>>y;
    if(abs(x-y)<=1){
        cout<<"Brown"<<endl;
    }else{
        cout<<"Alice"<<endl;
    }
    
    return 0;
}





Measured memory_bytes: 3556