akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int n;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int w,h;
    cin>>h>>w>>n;

    cout<<n/max(h,w)+(n%max(h,w)>0);
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := range a {
		fmt.Scan(&a[i])
	}
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	ans := 0
	for i, v := range a {
		if i % 2 == 0 {
			ans = ans + v
		} else {
			ans = ans - v
		}
	}
	fmt.Println(ans)
}

Measured memory_bytes: 512
#include <stdio.h>

int n, A[20];

int solve (int i, int m) {
   
   if ( m == 0 ){
      return 1; 
   }
   if ( i >= n ) {
      return 0;
   }
   int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
   return res;
}

int main() {
   int q, M, i;

   scanf("%d", &n);
   for ( i = 0; i < n; i++ ) {
      scanf("%d", &A[i]);
   }
   scanf("%d", &q);
   for ( i = 0; i < q; i++ ) {
      scanf("%d", &M);
      if ( solve(0, M) ) {
         printf("yes\n");
      } else {
         printf("no\n");
      }
   }

   return 0;
}

Measured memory_bytes: 580
//Bismillahirrahmanirrahim

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t;
int cev;
string s;
vector<int> v;

int main(void){
	fio();
	cin>>s;
	if(s[2]==s[3] && s[4]==s[5]){cout<<"Yes\n";}
	else cout<<"No\n";
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  if (S == "SUN") {
    cout << 7 << endl;
  }
  if (S == "MON") {
    cout << 6 << endl;
  }
  if (S == "TUE") {
    cout << 5 << endl;
  }
  if (S == "WED") {
    cout << 4 << endl;
  }
  if (S == "THU") {
    cout << 3 << endl;
  }
  if (S == "FRI") {
    cout << 2 << endl;
  }
  if (S == "SAT") {
    cout << 1 << endl;
  }
}

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

char name[20][30];
int i,j,n,win,draw,point[20],order[20];

void swap (int* x,int* y){
	int z;
	z=*x;
	*x=*y;
	*y=z;
}

int main(){
	while(scanf("%d",&n)*n){
		if(i>0)printf("\n");
		for(i=0;i<n;i++){
			scanf("%s %d %*d %d",name[i],&win,&draw);
			point[i]=win*3+draw;
			order[i]=i;
			for(j=i;j>0;j--){
				if(point[i]>point[order[j-1]]){
					swap(&order[j],&order[j-1]);
				}
				else break;
			}
		}
		for(i=0;i<n;i++)printf("%s,%d\n",name[order[i]],point[order[i]]);
	}
	return 0;
}

Measured memory_bytes: 604
#include <iostream>
using namespace std;
int N,a[200000],cnt=0;
int main() {
    cin >> N;
    for (int i=0; i<N; i++) cin >> a[i];
    for (int i=0,n=1; i<N; i++) {
        if (a[i] == n) n++;
        else cnt++;
    }
    if (cnt == N) cnt = -1;
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		String str1, str2;
		int hit, blow;
		char r[], a[];
		
		while(true){
			str1 = scan.next();
			str2 = scan.next();
			if(str1.equals("0") && str2.equals("0"))break;
		
			hit = 0;
			blow = 0;
		
			r = str1.toCharArray();
			a = str2.toCharArray();
		
			for(int i = 0; i < 4; i++){
				for(int j = 0; j < 4; j++){
					if(a[i] == r[j]){
						if(i == j)hit++;
						else blow++;
					}
				}
			}
			System.out.println(hit + " " + blow);
		}
	}
}

Measured memory_bytes: 43412
//
//  main.cpp
//  1
//
//  Created by RISHAV SINGH MEHTA on 01/12/19.
//  Copyright © 2019 RISHAV SINGH MEHTA. All rights reserved.
//

#include <iostream>
#define ll long long
using namespace std;
int main(int argc, const char * argv[]) {
    // insert code here...
    ll int i,j,k,N,m,B,month,d1,m2,d2;
    cin>>month>>d1>>m2>>d2;
    if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12 )
    {
        if (d1 == 31) {
            cout<<1<<endl;
        }else{
            cout<<0<<endl;
        }
    }
    else if ( month == 4 || month == 6 || month == 9 || month == 11 )
    {
        if (d1 == 30) {
            cout<<1<<endl;
        }else{
            cout<<0<<endl;
        }
    }
    else if ( month == 2 )
    {
        if ( (d1 == 28) || (d1 == 29) ){
            cout<<1<<endl;
        }else{
            cout<<0<<endl;
        }
    }
    else
    {
        cout<<0<<endl;
    }
    
    return 0;
}


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

int main(){
  int64_t n,d;
  cin >> n >> d;
  int64_t d2 = d*d;
  int count = 0;
  for (int i=0; i < n; i ++){
    int64_t x ,y;
    cin >> x >> y;
    int64_t x2 = x*x;
    int64_t y2 = y*y;
    if (x2 + y2 <= d2) count ++;
  }
  cout << count << endl;
}

Measured memory_bytes: 3600
# pragma GCC optimize("O3")
# include <bits/stdc++.h>
# define maxn 100005
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define db(x) cerr << #x << " = " << x << '\n'
# define pb push_back
# define mp make_pair
# define sz(x) (int)((x).size())
//# define int ll
using namespace std;


int32_t main(){_
    //freopen("input","r",stdin);
	string s;
	cin >> s;
	string ss = s;
	reverse(ss.begin(),ss.end());
	rc((ss == s ? "Yes" : "No"));
}


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

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b, a % b);
}
const ll P =  1000000007;
ll factorial(ll n){
   ll ans = 1;
   for(int i = n;i>=1;i--){
     ans *= i;
     ans %= P;
   }
   return ans;
}
using Graph = vector<vector<int>>;

ll kzyou(ll a,ll k){//aのk乗を返す
    ll zyou = 1;
    for(ll i = 1;i<=k;i++){
        zyou *= a;
    }
    return zyou;
}

int main(){
  vector<int> v(3);
  rep(i,3){
    cin >> v[i];
  }
  sort(v.begin(),v.end());

  if(v[0] == v[1] && v[1] != v[2]) cout << "Yes" << endl;
  else if(v[0] != v[1] && v[1] == v[2]) cout << "Yes" << endl;
  else cout << "No" <<endl;
}

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

int main()
{
    int a, b;
    char op;
    cin >> a >> op >> b;
    if (op=='+'){
        cout << a+b << endl;
    } else {
        cout << a-b << endl;
    }
}

Measured memory_bytes: 256
import sys


def slove():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    print("Yes" if s.count("R") > s.count("B") else "No")


if __name__ == '__main__':
    slove()


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

int main() {
  int n;
  cin >> n;

  vector<int> cards(n);
  for (int i = 0; i < n; i++) {
    cin >> cards.at(i);
  }
  sort(cards.begin(), cards.end());

  int a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      a += cards.at(i);
    } else {
      b += cards.at(i);
    }
  }

  int diff;
  diff = (a > b)? a - b : b - a;

  cout << diff << endl;
}

Measured memory_bytes: 764
import sys
from collections import deque
h, w = (int(x) for x in input().split())
ch, cw = (int(x) for x in input().split())
dh, dw = (int(x) for x in input().split())
ch-=1
cw-=1
dh-=1
dw-=1
directions = [[1, 0], [0, 1], [-1, 0], [0, -1]]
directions_warp = [[-2, -2], [-2, -1], [-2, 0], [-2, 1], [-2, 2], [-1, -2], [-1, 2], [0, -2], [0, 2], [1, -2], [1, 2], [2, -2], [2, -1], [2, 0], [2, 1], [2, 2], [-1, -1], [1, 1], [-1, 1], [1, -1]]
s = []
for i in range(h):
    sh = input()
    s.append(sh)
gone = [[-1]*w for i in range(h)]
que = deque([[ch, cw]])
gone[ch][cw]=0
boo = True
count = 0
while boo ==True:
    now = []
    while que:
        nh, nw = que.pop()
        now.append((nh, nw))
        for gh, gw in directions:
            if nh+gh<0 or nh+gh>=h or nw+gw<0 or nw+gw>=w:
                pass
            elif gone[nh+gh][nw+gw]==0:
                pass
            else:
                if s[nh+gh][nw+gw]=="#":
                    pass
                else:
                    now.append((nh+gh, nw+gw))
                    gone[nh+gh][nw+gw]=0
                    que.appendleft([nh+gh, nw+gw])
    if gone[dh][dw]==0:
        print(count)
        break
    boo2 = False
    for nh, nw in now:
        for gh, gw in directions_warp:
            if nh+gh<0 or nh+gh>=h or nw+gw<0 or nw+gw>=w:
                pass
            else:
                if s[nh+gh][nw+gw]=="#":
                    pass
                elif gone[nh+gh][nw+gw]==0:
                    pass
                else:
                    boo2 = True
                    gone[nh+gh][nw+gw]=0
                    que.appendleft([nh+gh, nw+gw])
    if boo2 == False:
        print(-1)
        break
    count+=1


        
    



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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int res = 0;

  for (int a = 0; a <= A; ++a) {
    for (int b = 0; b <= B; ++b) {
      for (int c = 0; c <= C; ++c) {
        int total = 500 * a + 100 * b + 50 * c;
        if (total == X)
          ++res;
      }
    }
  }
  cout << res << endl;
}

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

using namespace std;

using ll = long long;
using db = double;
using vi = vector<int>;
#define pb push_back
#define fir first
#define sec second
const int maxn = 100006; 

int n; 
ll l;
ll a[maxn]; 

int main() {
	cin>>n>>l; 
	for (int i = 1; i <= n; ++i) scanf( "%lld", &a[i] ); 
	for (int i = 1; i < n; ++i) 
		if (a[i]+a[i+1] >= l) {
			puts("Possible"); 
			for (int j = 1; j < i; ++j) printf( "%d\n", j ); 
			for (int j = n-1; j >= i+1; --j) printf( "%d\n", j ); 
			printf("%d\n", i); 
			return 0; 
		}
	puts( "Impossible" ); 
}


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

int64_t mod = 1000000007;
int64_t large = 9223372036854775807;
double PI = 3.141592653589793;

int main()
{
    int N, T;
    cin >> N >> T;
    vector<int> c(N);
    vector<int> t(N);
    for (int i = 0; i < N; i++)
        cin >> c[i] >> t[i];
    int cost = mod;
    for (int i = 0; i < N; i++)
    {
        if (c[i] < cost && t[i] <= T)
            cost = c[i];  
    }
    if (cost == mod)
        cout << "TLE";
    else
        cout << cost;
}

Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<deque>
#include<cstdlib>
using namespace std;
using ulli = unsigned long long int;

int main() {
    int n, m;
    cin >> n >> m;
    int ll = 1;
    int rr = n;
    for (int i = 0; i < m; i++) {
        int l, r;
        cin >> l >> r;
        ll = max(ll, l);
        rr = min(rr, r);
    }
    cout << ((rr - ll >= 0) ? rr - ll : -1) + 1 << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}

int main(void){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	int sum=a+b+c;
	int max=a<b?b<c?c:b:a<c?c:a;
	int ans;
	if((sum&1)==(max&1)){
		ans = max*3-sum;
	}else{
		ans = (max+1)*3-sum;
	}
	printf("%d\n", ans/2);
}


Measured memory_bytes: 128
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};
 
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; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};
 

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Timer TM;

    ll n;
    cin>>n;
    ll a[200010]={},b[200010]={};
    vll v;
    ll sum=0;
    ll m=LLINF;
    rep(i,n){
        cin>>a[i]>>b[i];
        sum+=a[i];
        if(a[i]>b[i]){
            v.pb(b[i]);
            chmin(m,b[i]);
        }
    }
    if(v.size()>0) sum-=m;
    else sum=0;
    cout<<sum<<endl;
    return 0;
}

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

using fint64 = int_fast64_t;
template<fint64 MOD>
struct ModInt{
    fint64 x;
    ModInt():x(0){}
    ModInt(fint64 x):
        x(x>=0?x%MOD:(MOD-(-x)%MOD)%MOD)
        {}
    // 負号
    ModInt operator -() const{
        return ModInt(-x);
    }
    // 加算
    ModInt &operator +=(const ModInt &rhs){
        x+=rhs.x;
        if(x>=MOD) x-=MOD;
        return (*this);
    }
    ModInt operator +(const ModInt &rhs) const{
        return ModInt(*this)+=rhs;
    }
    // 減算
    ModInt &operator -=(const ModInt &rhs){
        x+=MOD-rhs.x;
        if(x>=MOD) x-=MOD;
        return (*this);
    }
    ModInt operator -(const ModInt &rhs) const{
        return ModInt(*this)-=rhs;
    }
    // 乗算
    ModInt &operator *=(const ModInt &rhs){
        x*=rhs.x;
        if(x>=MOD) x%=MOD;
        return (*this);
    }
    ModInt operator *(const ModInt &rhs) const{
        return ModInt(*this)*=rhs;
    }
    // 除算
    ModInt &operator /=(const ModInt &rhs){
        (*this)*=rhs.inverse();
        return (*this);
    }
    ModInt operator /(const ModInt &rhs) const{
        return ModInt(*this)/=rhs;
    }
    // 等号
    bool operator ==(const ModInt &rhs){
        return x==rhs.x;
    }
    bool operator !=(const ModInt &rhs){
        return x!=rhs.x;
    }
    // 累乗
    ModInt pow(fint64 n) const{
        fint64 tmp=x;
        fint64 ret=1;
        while(n>0){
            if(n&1) ret=ret*tmp%MOD;
            tmp=tmp*tmp%MOD;
            n>>=1ll;
        }
        return ModInt(ret);
    }
    // 逆元
    ModInt inverse() const{
        fint64 a=x,b=MOD,s=1,t=0;
        while(b>0){
            fint64 u=a/b;
            a-=u*b;
            s-=u*t;
            swap(a,b);
            swap(s,t);
        }
        return ModInt(s);
    }
    // 入出力
    friend istream &operator >>(istream &lhs,ModInt<MOD> &rhs){
        fint64 x; lhs>>x;
        rhs=ModInt<MOD>(x);
        return lhs;
    }
    friend ostream &operator <<(ostream &lhs,const ModInt<MOD> &rhs){
        return lhs<<rhs.x;
    }
};

const int MOD = 1e9 + 7;
using mint = ModInt<MOD>;
// dp[i][j] := iまで見て最近がjである
mint dp[44][1 << 16];
int main() {
	int n; cin >> n;
	int x, y, z; cin >> x >> y >> z;
	--x; --y; --z;
	dp[0][0] = 1;
	for(int i = 0; i < n; ++i) {
		for(int mask = 0; mask < (1 << 16); ++mask) {
			for(int d = 0; d < 10; ++d) {
				int tmp = mask;
				tmp <<= (d + 1);
				tmp |= (1 << d);
				int next = tmp % (1 << 16);
				if((tmp >> z) & 1) {
					tmp >>= (z + 1);
					if((tmp >> y) & 1) {
						tmp >>= (y + 1);
						if((tmp >> x) & 1) {
							continue;
						}
					}
				}
				dp[i + 1][next] += dp[i][mask];
			}
		}
	}
	mint ans = 10;
	ans = ans.pow(n);
	for(int i = 0; i < (1 << 16); ++i) {
		ans -= dp[n][i];
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 22784
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
using namespace std;
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define max3(x,y,z) max(x,max(y,z))
#define min3(x,y,z) min(x,min(y,z))
#define ff first
#define ss second
#define rev(a) reverse(a.begin(),a.end())
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define lb lower_bound
#define ub upper_bound
#define rsz resize
#define ins insert
#define pb emplace_back
#define sz(x) (int)(x).size()
#define MOD 1000000007  //1e9 + 7
#define INF 2000000000 //2e9
#define DESPACITO 1000000000000000000 //1e18
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T> T chmin(T &a, T b) { a = min(a, b); return a; }
template<class T> T chmax(T &a, T b) { a = max(a, b); return a; }
using pii = pair<int, int>;
using ll = long long;
const int N = 4e3 + 5;
int l[N][3], r[N][3];
int32_t main() {
    IOS;
    int i, j, k, n, ans = 0; string s;
    cin >> n >> s;
    s = '#' + s;
    auto val = [] (char c) {
        return c == 'R'? 0 : c == 'G'? 1 : 2;
    };

    for(i = 1; i <= n; i++) {
        l[i+1][val(s[i])]++;
        for(j = 0; j < 3; j++) 
            l[i][j] += l[i-1][j];
    }

    for(i = n; i; i--) {
        r[i-1][val(s[i])]++;
        for(j = 0; j < 3; j++) 
            r[i][j] += r[i+1][j];
    }

    for(int mid = 1; mid <= n; mid++) {
        for(i = 0; i < 3; i++) {
            if(i != val(s[mid])) continue;
            for(j = 0; j < 3; j++) {
                if(i == j) continue;
                for(k = 0; k < 3; k++) {
                    if(k == j or k == i) continue;
                    ans += l[mid][j] * r[mid][k];
                }
            }
        }       
    }

    for(i = 1; i <= n; i++) {
        for(j = i+1; j <= n; j++) {
            if(s[i] == s[j] or j-i+j > n) continue;
            k = j-i+j;
            if(s[i] != s[k] and s[j] != s[k]) ans--;
        }
    }
    
    cout << ans;
    return 0;
}

Measured memory_bytes: 3812
#include <cmath>
#include <iostream>
#include <iomanip>
using namespace std;
#define PI 3.141592653589793238

int main(){
	int a , b , c;
	cin >> a >> b >> c;
	cout << fixed << setprecision(9) << a*b*sin(PI/180*c)/2 << endl;
	cout << fixed << setprecision(9) << a+b+sqrt(a*a+b*b-2*a*b*cos(PI/180*c)) << endl;
	cout << fixed << setprecision(9) << b*sin(PI/180*c) << endl;
	return 0;
}

Measured memory_bytes: 1288
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        boolean ans = false;
        for (int i = a; i <= b; i++) {
            if(i % k == 0){
                ans = true;
            }
        }
        System.out.println(ans ? "OK" : "NG");
        sc.close();

    }

}


Measured memory_bytes: 35768
#include <stdio.h>

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

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

if(a > b) {
d=a;
a=b;
b=d;
}
if(b > c) {
d=b;
b=c;
c=d;
}
if(a > b) {
d=a;
a=b;
b=d;
}

printf("%d %d %d\n", a,b,c);

return 0;
}

Measured memory_bytes: 2664
import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		while (true) {
			int a = sc.nextInt(); String s = sc.next(); int b = sc.nextInt();
			if (s.equals("?")) return;
			
			if (s.equals("+")) System.out.println(a+b);
			else if (s.equals("-")) System.out.println(a-b);
			else if (s.equals("*")) System.out.println(a*b);
			else if (s.equals("/")) System.out.println(a/b);
		}
		
	}
}


Measured memory_bytes: 26356
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const int N=2005;
int n,m,k,ans[N][N],cnt[N],idn;
char s[N][N];

signed main(){
	read(n,m,k);
	for(int i=1;i<=n;i++) scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) cnt[i]+=s[i][j]=='#';
	for(int i=1;i<=n;i++) if(cnt[i]){
		bool flag=0;
		for(int j=1;j<=m;j++){
			if(s[i][j]=='#'){
				if(!flag) flag=1;
				idn++;	
			}
			if(flag) ans[i][j]=idn;
			else ans[i][j]=idn+1;
		}
	}
	for(int i=2;i<=n;i++) if(!cnt[i]&&cnt[i-1]){
		cnt[i]=1;
		for(int j=1;j<=m;j++) ans[i][j]=ans[i-1][j];
	}
	for(int i=n-1;i;i--) if(!cnt[i]&&cnt[i+1]){
		cnt[i]=1;
		for(int j=1;j<=m;j++) ans[i][j]=ans[i+1][j];
	}
	for(int i=1;i<=n;i++,puts("")) for(int j=1;j<=m;j++) write(ans[i][j]),putchar(' ');
}

Measured memory_bytes: 5840
def resolve():
    '''
    code here
    '''
    import collections

    N = int(input())
    A_list = [int(input()) for _ in range(N)]
    cnt_dic = collections.Counter(A_list)

    cnt = 0
    for v in cnt_dic.values():
        if v % 2 == 1:
            cnt += 1

    print(cnt)

if __name__ == "__main__":
    resolve()


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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
    ll x;
    cin>>x;
    ll c=100, y=0;
    while(c<x){
        c+=(c/100);
        y++;
    }
    cout<<y<<endl;
    return 0;
}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int inf=2147483647;
LL read()
{
	LL 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<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
LL a,b,c,x,y;
int main()
{
	a=read(),b=read(),c=read(),x=read(),y=read();
	LL ans1=x*a+y*b;
	if(x<y)swap(x,y),swap(a,b);
	LL ans2=y*2LL*c+(x-y)*a;
	LL ans3=x*2LL*c;
	printf("%lld",min(ans1,min(ans2,ans3)));
}


Measured memory_bytes: 256
package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

func main() {
	var n int
	fmt.Scan(&n)
	h := make([]int, n)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := 0; i < n; i++ {
		h[i] = nextInt(sc)
	}
	ans, right := 0, 0
	for left := 0; left < n; left++ {
		for right < n {
			if right > 0 && h[right-1] >= h[right] {
				right++
			} else {
				break
			}
		}
		if right-left+1 > ans {
			ans = right - left + 1
		}
		if right == left {
			right++
		}
	}
	fmt.Println(ans - 1)
}


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

int main(){
	int H1 , M1 , H2 , M2 , K;
	cin >> H1 >> M1 >> H2 >> M2 >> K;
	cout << (H2 - H1) * 60 + (M2 - M1) - K;
	return 0;
}


Measured memory_bytes: 3636
if __name__ == "__main__":
    (N,M,K) = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    a = [0]
    b = [0]
    for i in range(N):
        a.append(a[i]+A[i])
    for i in range(M):
        b.append(b[i]+B[i])

    ans, j = 0, M
    for i in range(N+1):
        if a[i] >K:
            break
        while b[j] > K-a[i]:
            j -= 1
        ans = max(ans, i+j)
    print(ans)

Measured memory_bytes: 47360
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
template<typename T> inline int sz(T &x) { return x.size(); }
const int MOD  = int(1e9)+7;


struct mint {
  ll x;
  mint(ll x=0) : x((x%MOD+MOD)%MOD) {}
  mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this; }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
};
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
using Vm = vector<mint>;


int main() {
  ll n, k; cin >> n >> k;

  Vm c;
  int l = 1;
  while (l <= n) {
    int r = n/(n/l) + 1;
    c.push_back(r-l);    
    l = r;
  }
  int m = sz(c);
  Vm dp = c;
  rep(i, m-1) dp[i+1] += dp[i];

  rep(i, k-1) {
    Vm _dp(m);
    rep(j, m) _dp[j] = dp[m-1-j] * c[j];
    swap(dp, _dp);
    rep(i, m-1) dp[i+1] += dp[i];
  }

  cout << dp[m-1] << '\n';
}


Measured memory_bytes: 4764
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <string>
#include <stdio.h>
#include <math.h>
#include <string.h>
#define N 26
#define M 110

using namespace std;

int number[N];

int check()
{
    for (int i=0;i<N;i++)
    {
        if (number[i]%2)
        {
            return 0;
        }
    }
    return 1;
}

int main()
{
    char s[M];
    scanf("%s",s);
    int len = strlen(s);
    memset(number,0,sizeof(number));
    for (int i=0;i<len;i++)
    {
        int x = s[i]-'a';
        number[x]++;
    }
    if (check())
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }

int main() {
    init();

    int n; cin >> n;
    int ans = 0;
    eFOR(i, 1, n)ans += i;
    cout << ans << "\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define ull unsigned long long int  // ranges from (0 - twice of long long int)
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define mod 1000000007LL
#define llpair pair<ll,ll>
#define INF 1000000000000000000ll
#define np next_permutation
#define PI acos(-1)
#define deb(x) cout<<#x<<" "<<x<<endl;
//ALWAYS USE ll DATA TYPE FOR INTEGER(FASTER THAN INTEGER AS WELL AS SOMETIMES WITHOUT USE LONG UR ANSWER WILL NOT ACCEPTED) && DOUBLE FOR DECIMAL VALUE
template<typename T> // for removing front element from the vector
void pop_front(std::vector<T> &v)
{
    if (v.size() > 0) {
        v.erase(v.begin());
    }
}
template<typename R> // for removing back element from the vector or can directly
void pop_back(std::vector<R> &v) // use vec.pop_back() function...
{
    if (v.size() > 0) {
        v.erase(v.begin()+v.size()-1);
    }
}

bool isprime(ll n)  //IN  O(sqrt(n))
{
    if(n<=1) return false;
    for(ll i=2;i*i<=n;i++)
        if(n%i==0)
            return false;

    return true;
}

vector<ll> factors(ll n){    //IN  O(sqrt(n))

    vll v;
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            v.pb(i);
            if((n/i)!=i)
            v.pb(n/i);
        }
    }
    return v;
}

ll power(ll a, ll n)  // using Binary Exponential in TC O(logn)
{                     // Self Written By </ME> :)
    ll res=1;
    while(1)
    {
        if(n%2){
            res=res*a; n--;
        }
        if(n==0) break;
        a=a*a; n/=2;
    }
    return res;
}

ll ts(ll arr[],int l,int r,int x) // ternary search to find x in sorted array arr
{
    
    while(l<=r)
    {
        ll mid1= l+(r-l)/3;
        ll mid2= r -(r-l)/3;
        if(arr[mid1]==x || arr[mid2]==x)
            return 1;
        if(x<arr[mid1])
            r=mid1-1;
        else if(x>arr[mid2])
            l=mid2+1;
        else
        {
            l=mid1+1;
            r=mid2-1;
        }
    }

    return -1;
}

int main() {
    //auto start = chrono::high_resolution_clock::now();
    fio;
    
    ll t=1;
    //cin>>t;
    while(t--)
    {
      ll n,a,b; cin>>n>>a>>b;
      ll v =(a+b);
      ll res = (n/(a+b));
      ll m  =n %(a+b);
      //deb(res); deb(m);
      ll ans = res*a + min(a,m); 
      cout<<ans<<"\n"; 

    }

    
    //auto finish = chrono::high_resolution_clock::now();
    //cerr << "Time elapsed: " << (chrono::duration<long double>(finish-start)).count() << "s\n";
    return 0;
}





Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
string str;
void solve(){
    int red=0;
    int blue=0;
    for(int i=0;i<str.size();i++){
        if(str[i]=='0')red++;
        else blue++;
    }
    cout<<2*min(blue,red)<<'\n';
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> str;
    solve();
}

Measured memory_bytes: 512
#include <stdio.h>

int main(int argc, char const *argv[]) {
	char str[101];
	int n;

	fgets(str, 100, stdin);
	sscanf(str, "%d\n", &n);

	if (n < 1000) {
		printf("ABC\n");
	} else {
		printf("ABD\n");
	}

	return 0;
}


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

#define rep(i,n) for(ll i=0;i<n;i++)
#define repm(i,m,n) for(ll i=m;i<n;i++)
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define YesNo(a) (a)?cout<<"Yes"<<endl:cout<<"No"<<endl
#define YESNO(a) (a)?cout<<"YES"<<endl:cout<<"NO"<<endl
#define INF (2e9)
#define PI (acos(-1))
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007

typedef long long ll;

int main(){
  int a; cin >> a;
  cout << a + a*a + a*a*a << endl;
  
}

Measured memory_bytes: 3632
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    ll a, b;
    cin >> a >> b;
    ll x = (b / a + 1) * a;
    if (1 + (x - b) / a + ((x - b) % a) <= x / a) x = -1;
    cout << x << endl;

    return 0;
}



Measured memory_bytes: 3104
import re
import math
num = int(input())
a = []
b = []
c = []
for i in range(num-1):
    x,y,z = map(int,input().split(" "))
    a.append(x)
    b.append(y)
    c.append(z)
for i in range(num-1):
    time = 0
    for j in range(i,num-1):
        if(time < b[j]):
            time = b[j]
        for k in range(c[j]):
            temp = time + k
            if(temp % c[j] == 0):
                time = temp
        time += a[j]
        # print(time,j)
    print(time)
print(0)
    
    

Measured memory_bytes: 3444
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7



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


	for (int i = 0; i < 1000000; i++) {
		if ((A-1) * i  >= B -1) {
			printf("%d", i);
			break;
		}

	}


}






Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using llong = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

vector<int> primes(1e6 + 1, 0);
llong mod_pow(llong x, int y) {
   llong res = 1;
   while (y) {
      if (y & 1) {
         res *= x;
         res %= mod;
      }
      x *= x;
      x %= mod;
      y >>= 1;
   }
   return res;
}

llong inv(llong x) {
   return mod_pow(x, mod - 2);
}
void factor(int x) {
   int cnt = 0;
   int i;
   for (i = 2; i * i <= x; i++) {
      while (x % i == 0) {
         cnt++;
         x /= i;
      }
      primes[i] = max(cnt, primes[i]);
      cnt = 0;
   }
   if (x != 1) {
      primes[x] = max(1, primes[x]);
   }
}
int main() {
   int n;
   cin >> n;
   vector<int> a(n);
   rep(i, n) cin >> a[i];
   rep(i, n) { factor(a[i]); }
   llong lcm = 1;
   rep(i, primes.size()) {
      lcm *= mod_pow(i, primes[i]);
      lcm %= mod;
   }
   llong ans = 0;
   rep(i, n) {
      ans += lcm * inv(a[i]);
      ans %= mod;
   }
   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 4224
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    List<String> str = new ArrayList<>();
    
    for (int i=0;i<2;i++){
      str.add(scan.nextLine());
    }
    
    String[] a = str.get(0).split(" ",0);
    String[] b = str.get(1).split(" ",0);
    int workD = 0;
    for(int i=0;i<b.length;i++){
      workD += Integer.parseInt(b[i]);
    }
    if(Integer.parseInt(a[0]) < workD ){
      System.out.println("-1");
    } else {
      System.out.println(Integer.parseInt(a[0]) - workD);
    }
  }
 }

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

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

# define C continue;
# define R return

#define int long long
# define D double
# define I insert
# define ld long double
# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vull vector < ull >
# define vld vector < ld >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) v.begin() , v.end()
# define allcomp(v) v.begin() , v.end() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

#define PQ(type) priority_queue<type>
#define PQD(type) priority_queue<type, vector<type>, greater<type>>

#define mii map<int, int>
#define mll map<ll, ll>
#define mci map<char, int>
#define msi map<string, int>
#define mis map<int, string>
#define mib map<int, bool>
#define mcb map<char,bool>

#define umii unordered_map<int, int>
#define umll unordered_map<ll, ll>
#define umci unordered_map<char, int>
#define umsi unordered_map<string, int>
#define umis unordered_map<int, string>

#define init(arr,val) memset(arr,val,sizeof(arr))
#define REP(i,a,b) for(int i=a; i<b; i++)
#define distance(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define nl "\n"
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = { -2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.1415926535897932384626 ;
const int mod = 1e9 + 7 ;
#define test int t; cin>>t;
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .
void a_b_c()
{
    #ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
    #endif
}

void solve()
{
  int n,cnt=0;
  cin>>n;
  int a[n];
  REP(i,0,n) cin>>a[i];
  sort(a,a+n);
  REP(i,0,n)
  {
      REP(j,i+1,n)
      {
          REP(k,j+1,n)
          {
              if(((a[i]+a[j]>a[k])&&(a[i]+a[k]>a[j])&&(a[j]+a[k]>a[i]))&&(a[i]!=a[j]&&(a[k]!=a[i]&&a[k]!=a[j]))) cnt++;
          }
      }
  }
  cout<<cnt;
}
int32_t main()
{	fast
    int t=1;
    //freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
    //int t;  cin>>t;
    for(int i=1; i<=t; i++) solve();

}



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

int n,a,s=0;
bitset<4000010>f;

int main()
{
	scanf("%d",&n);
	f[0]=1;
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		f|=(f<<a);
		s+=a;
	}
	for(int i=(s+1)/2;i<=s;i++)
	  if(f[i]){
	  	printf("%d",i);
	  	return 0;
	  }
}

Measured memory_bytes: 1664
// "include" {{{
#include <deque>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <utility>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long  
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1000000007;

int gcd(int a,int b){return b ? gcd(b,a%b) : a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}

int a[10000];
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	rep(i,n){
		cin >> a[i];
	}
	int maxv = -100;
	rep(i,n){
		for(int j = i+1;j < n;++j){
			maxv = max(maxv,abs(a[i] - a[j]));
		}
	}
	cout << maxv << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void) {
	vector<vector<int> > c(3, vector<int>(3));
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 3; ++j)
			cin >> c[i][j];

	int a0, a1, a2, b0, b1, b2;
	a0 = 0;
	b0 = c[0][0];
	b1 = c[0][1];
	b2 = c[0][2];
	a1 = c[1][0] - b0;
	a2 = c[2][0] - b0;

	vector<int> a = { a0,a1,a2 }, b = { b0,b1,b2 };
	bool ok = true;
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 3; ++j)
			if (c[i][j] != a[i] + b[j])
				ok = false;
	cout << (ok ? "Yes" : "No") << endl;
	return 0;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define ll long long
static const int MAX = 10000;
static const ll INFTY = 1e12;

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; }

const ll MRINF = 5000000000000000;

int main() {

 
   ll N;
   cin >> N;
    ll ans = 0;
    ll count = 0;
   while(1){
       if(count >= N){
           ans = count - N;
           break;
       }
       count += 1000;
   } 
   cout << ans << endl;

}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 3620
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		long n = scan.nextLong();
		long a = scan.nextLong();
		long b = scan.nextLong();

		long sum = n / (a + b) * a;
		long remain = n % (a+b);

		if(remain < a) {
			sum += remain;
		}else {
			sum += a;
		}
		System.out.println(sum);
		scan.close();
	}

}


Measured memory_bytes: 24020
import java.util.*;

public class Main {
    public static int[] a;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        a = new int[N];
        for (int i=0;i<N;i++) {
            a[i] = Integer.parseInt(sc.next());
        }

        long ans = 0L;
        Arrays.sort(a);
        // System.out.println(Arrays.toString(a));
        for (int i=0;i<N;i++) {
            for (int j=i+1;j<N;j++) {
                ans += binary_search(a[i]+a[j])-j-1;
                // System.out.println("N: " + N + "binary: " + (binary_search(a[i]+a[j])-j-1));
                // ans += N;
            }
        }
        System.out.println(ans);
    }
    public static boolean isOK(int index, int key) {
        if (a[index] >= key) return true;
        else return false;
    }

    public static int binary_search(int key) {
        int left = -1;
        int right = a.length;

        while (right - left > 1) {
            int mid = left + (right - left) / 2;

            if (isOK(mid, key)) right = mid;
            else left = mid;
        }
        return right;
    }
}

Measured memory_bytes: 25708
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n;
int i,j,k,m,q[211],a[211];
bool cmp(int x,int y){
	return q[x]<q[y];
}
int main(){
	scanf("%lld",&n);n++;
	for (m=1;(1LL<<m)<=n;m++) q[m]=2*m;
	m--;n-=(1LL<<m);
	while (n){
		for (i=0;(1LL<<i)<=n;i++);
		i--;n-=(1LL<<i);q[++m]=2*i+1;
	}
	for (i=1;i<=m;i++) a[i]=i;
	sort(a+1,a+1+m,cmp);
	printf("%d\n",2*m);
	for (i=1;i<=m;i++) printf("%d ",a[i]);
	for (i=1;i<=m;i++) printf("%d ",i);
	puts("");
	return 0;
}

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

long inv(int a, int m) {
	long i = 1, j = 0;
	for (int b = m; a > 1; swap(i, j), swap(a, b)) {
		j = (j + b / a * (m - i)) % m;
		b %= a;
	}
	return i;
}
long d[1111111];
int main() {
	int n, p = 998244353;
	cin >> n;
	long r = 0;
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);
		(d[a] += a) %= p;
		(r += p - a) %= p;
	}
	for (int i = 1; i < 1111111; i++) {
		for (int j = i + i; j < 1111111; j += i)
			(d[i] += d[j]) %= p;
		(d[i] *= d[i]) %= p;
	}
	for (int i = 1111111; --i;) {
		for (int j = i + i; j < 1111111; j += i)
			(d[i] += p - d[j]) %= p;
		(r += d[i] * inv(i, p)) %= p;
	}
	cout << r * inv(2, p) % p << endl;
	return 0;
}


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

class Main{
 public static int[] A;
    public static void main(String[] args){
        int i;
        int n=0;
        String s;
        //int[] A;
        try{
            BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
            s = bf.readLine();
            n = Integer.parseInt(s);
            A = new int[n+1];
            StringTokenizer S = new StringTokenizer(bf.readLine());

            for(i=1 ; i<=n ; i++){
                A[i] = Integer.parseInt(S.nextToken());
            }
            bf.close();
        }
        catch(IOException e){
        System.out.println(e);
        }

        for(i=1 ; i<=n ; i++){
            System.out.print("node "+i+": key = "+A[i]+", ");
            if( (i/2) != 0 ){
                System.out.print("parent key = "+A[(i/2)]+", ");
            }
            if( (2*i) <= n ){
                System.out.print("left key = "+A[(2*i)]+", ");
            }
            if( (2*i+1) <= n ){
                System.out.print("right key = "+A[(2*i+1)]+", ");
            }
            System.out.print("\n");
        }
    }
}



Measured memory_bytes: 25220
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    int ans = 0;
    vint agree(m,0);
    REP(i,n){
        int k;
        cin >> k;
        REP(j,k){
            int a;
            cin >> a;
            agree[a-1]++;
        }
    }
    REP(i,m){
        if(agree[i]==n)ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256