akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define lb lower_bound
#define ub upper_bound
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T> inline T mpow(T a, T n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}



signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  V<bool> v(3,false);
  int a,b;cin>>a>>b;
  v[a-1]=true;
  v[b-1]=true;
  rep(i,0,3){
      if(!v[i]){
          cout<<i+1<<ENDL;
          return 0;
      }
  }
}
//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#define int long long
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int INF = 1e+15;
int n, m, s, t;
vector<int> et[100000];
vector<int> ec[2][100000];	//円, すぬーく
int minCost[2][2][100000];	//始点{S, T}, {円, すぬーく}, 頂点
int sumCost[100000];

void bfs(int s, int type, int minCost[]) {
	typedef pair<int, int> P;
	static priority_queue<P, vector<P>, greater<P> > que;
	int i;
	
	rep(i, n) minCost[i] = INF;
	
	que.push(P(0, s));
	minCost[s] = 0;
	
	while (!que.empty()) {
		P now = que.top(); que.pop();
		int cst = now.first;
		int v = now.second;
		
		rep(i, et[v].size()) {
			int nv = et[v][i];
			int ncst = cst + ec[type][v][i];
			if (minCost[nv] > ncst) {
				minCost[nv] = ncst;
				que.push(P(ncst, nv));
			}
		}
	}
}

signed main() {
	int i;
	
	cin >> n >> m >> s >> t;
	s--; t--;
	rep(i, m) {
		int u, v, a, b;
		cin >> u >> v >> a >> b;
		u--; v--;
		et[u].push_back(v);
		et[v].push_back(u);
		ec[0][u].push_back(a);
		ec[0][v].push_back(a);
		ec[1][u].push_back(b);
		ec[1][v].push_back(b);
	}
	
	bfs(s, 0, minCost[0][0]);
	bfs(t, 1, minCost[1][1]);
	
	rep(i, n) {
		//s -> i -> t
		sumCost[i] = minCost[0][0][i] + minCost[1][1][i];
	}
	
	int mmin = INF;
	vector<int> ans;
	for (i = n - 1; i >= 0; i--) {
		mmin = min(mmin, sumCost[i]);
		ans.push_back(mmin);
	}
	
	for (i = n - 1; i >= 0; i--) {
		cout << INF - ans[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 24692
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	Info(){
		x = y = 0;
	}
	Info(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}
	bool operator<(const struct Info &arg) const{
			return x < arg.x;
	};
	double x,y;
};

int N;

bool compare_y(Info left,Info right){
	return left.y < right.y;
}

Info* info;

double closest_pair(Info* array,int tmp_N){
	if(tmp_N <= 1)return DBL_MAX;

	int mid = tmp_N/2;
	double x = array[mid].x;
	double dist = min(closest_pair(array,mid),closest_pair(array+mid,tmp_N-mid));
	inplace_merge(array,array+mid,array+tmp_N,compare_y);

	vector<Info> V;
	for(int i = 0; i < tmp_N; i++){
		if(fabs(array[i].x-x) >= dist)continue;

		for(int j = 0; j < V.size();j++){
			double dx = array[i].x - V[V.size()-j-1].x;
			double dy = array[i].y - V[V.size()-j-1].y;
			if(dy >= dist)break;
			dist = min(dist,sqrt(dx*dx+dy*dy));
		}
		V.push_back(array[i]);
	}
	return dist;
}

int main(){

	scanf("%d",&N);
	info = (Info*)malloc(sizeof(Info)*N);

	for(int i = 0; i < N; i++){
		scanf("%lf %lf",&info[i].x,&info[i].y);
	}

	sort(info,info+N);

	printf("%.7lf\n",closest_pair(info,N));

	return 0;
}

Measured memory_bytes: 7664
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
// #include<C:\Users\J\Desktop\AC\athead.h>
#define showa(v) for(int iii = 0; iii < v.size(); iii++){ cout << v[iii] << " ";} cout << endl;
#define show(iiii) cout << iiii << endl; 
#define shows(iiiii) cout << iiiii << " ";
#define divs 1000000007
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <set>
#include <deque>
#include <numeric>
#include<tuple>
#include <utility>
#include <map>
using namespace std;

int saiki(int n, vector<long long int> &memo){
    // showa(memo)
    long long int res = 0;
    if (memo[n] == -1){
        res += ((saiki(n-1, memo))+(saiki(n-2, memo)));
        memo[n] = res%divs;
        return memo[n];
    }
    else{
        return memo[n];
    }
}

int main(){
    int n;
    cin >> n;
    vector<int> b(n-1);
    vector<int> a(n);
    rep(i,n-1){
        cin >> b[i];
        // a[i] = -1;
    }
    int res = 0;
    a[0] = 100001;
    rep(i,n-1){
        a[i+1] = b[i];
        if(b[i] < a[i]) a[i] = b[i];
        res += a[i];
    }
    res += a[n-1];
    cout <<res;


}


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

using namespace std;
bool snuke[100];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k, counting = 0;
    cin >> n >> k;
    memset(snuke, 0, 100);
    while(k){
        int d;
        cin >> d;
        while(d){
            int m;
            cin >> m;
            snuke[m-1] = 1;
            d--;
        }
        k--;
    }

    for(int i=0;i<n;i++){
        if(!snuke[i])
            counting++;
    }
    cout << counting << endl;
    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0,1,0,-1 };
const ll dy[4] = { -1, 0, 1,0 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
double mysqrt(double x) {
	double l = 0, r = x;
	for (int i = 0; i < 64; ++i) {
		double m = (l + r) / 2.0;
		if (m*m < x)l = m;
		else r = m;
	}
	return l;
}
///////////////////////////////////////

int n;
vector<int>G[210];
int color[210]; //頂点iの色(1 or -1)
				//二分グラフ判定

bool dfs(int v, int c) {
	color[v] = c;//頂点vをcで塗る
	for (int i = 0; i < G[v].size(); ++i) {
		//隣接している頂点が同じ色ならfalse
		if (color[G[v][i]] == c)return false;
		if (color[G[v][i]] == 0 && !dfs(G[v][i], -c))return false;
	}
	return true;
}
int main() {
	cin >> n;
	REP(i, n)color[i] = 0;
	string S[210];
	REP(i, n) {
		cin >> S[i];
		REP(j, n) {
			if (S[i][j] == '1') {
				G[i].push_back(j);
				G[j].push_back(i);
			}
		}
	}
	if (!dfs(0, 1))cout << -1 << endl;
	else {
		int d[210][210];
		REP(i, n) {
			REP(j, n) {
				if (i == j)d[i][j] = 0;
				else {
					if (S[i][j] == '1') {
						d[i][j] = 1;
						d[j][i] = 1;
					}
					else {
						d[i][j] = INF;
						d[j][i] = INF;
					}
				}
			}
		}
		for (int i = 0; i < n; ++i) {//iは経由する頂点（部分集合）
			for (int j = 0; j < n; ++j) {
				for (int k = 0; k < n; ++k) {
					d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
				}
			}
		}
		int ans = 0;
		REP(i, n)REP(j, n) {
			if (d[i][j] == INF)continue;
			if (i == j)continue;
			else ans = max(ans, d[i][j]);
		}
		cout << ans + 1 << endl;
	}
	return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
#define fi(a) scanf("%d",&a);
#define fli(a) scanf("%ld",&a);
#define fll(a) scanf("%lld",&a);
#define pi(a) printf("%d\n",a);
#define ppi(i,a) printf("Case %d: %d\n",i,a);
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
void FI()
{
#ifndef ONLINE_JUDGE
    freopen("C:\\Users\\SHIHAB\\Desktop\\input.in","r",stdin);
#endif // ONLINE_JUDGE
}

int main()
{
    fast
   // FI(); /// skip this line for compile
   int cnt=0;
    string s,s2;
    cin >> s >> s2;;
    for(int i=0;i<s.size();i++){
        if(s[i]!=s2[i]) cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3836
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let n = nextInt()
    let ans = "Yes"
    let cx = 0
    let cy = 0
    let ct = 0
    while(hasNext()){
        let [t,x,y] = nextIntArray()
        const d = Math.abs(cx-x) + Math.abs(cy-y)
        if((t - ct)%2 !== d%2 || t - ct < d) {
            ans = "No"
            break
        }
        cx = x
        cy = y
        ct = t
    }
    console.log(ans)
}
Main()



Measured memory_bytes: 47164
import java.io.*;

/**
 * Copyright © 2018 Chris. All rights reserved.
 *
 * @author Chris
 * @see format
 */
public class Main {

    private static BufferedReader br;
    private static StreamTokenizer st;
    private static PrintWriter pw;

    static final int INF = 1000000007;
    static int MOD = (int) (1e9 + 7);


    private static void solve() throws IOException {
        int n = nextInt();
        int x = nextInt();
        pw.println((n < x) ? 0 : 10);
    }

    public static void main(String args[]) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        st = new StreamTokenizer(br);
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        st.ordinaryChar('\''); //指定单引号、双引号和注释符号是普通字符
        st.ordinaryChar('\"');
        st.ordinaryChar('/');

        solve();
        pw.flush();
    }

    static String next(int len) throws IOException {
        int b = br.read();
        while (b == '\n' || b == ' ' || b == '\r' || b == '\t') {
            b = br.read();
        }
        char ch[] = new char[len];
        ch[0] = (char) b;
        int idx = 1;
        while (idx < len && (b = br.read()) != ' ' && b != '\n' && b != '\r' && b != '\t') {
            ch[idx++] = (char) b;
        }
        return String.valueOf(ch).trim();
    }

    private static int nextInt() throws IOException {
        st.nextToken();
        return (int) st.nval;
    }

    private static double nextDouble() throws IOException {
        st.nextToken();
        return st.nval;
    }

    private static String[] nextSS(String reg) throws IOException {
        return br.readLine().split(reg);
    }

    private static String nextLine() throws IOException {
        return br.readLine();
    }
}


Measured memory_bytes: 21204
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int N;
int S,T;
vector<int> g[100010];

bool used[100010];
vector<int> path;

bool dfs(int now,int par){
    if(now==T) return used[T]=true;
    for(auto nex:g[now]){
        if(nex==par) continue;
        if(dfs(nex,now)){
            path.push_back(nex);
            return used[now]=true;
        }
    }
    return false;
}

int dp[100010];
int find(int now,int par){
    for(auto nex:g[now]){
        if(nex==par) continue;
        if(used[nex]) continue;
        dp[now]=max(dp[now],find(nex,now)+1);
    }
    return dp[now];
}

int main(){
  cin>>N;
  cin>>S>>T;
  S--;T--;
  rep(i,N-1){
      int a,b;
      cin>>a>>b;
      a--;b--;
      g[a].push_back(b);
      g[b].push_back(a);
  }

  dfs(S,-1);
  path.push_back(S);
  reverse(path.begin(),path.end());
  int n=((path.size()-1)-1)/2;
  int tar=path[n];

  for(int i=0;i<=n;i++) used[path[i]]=false;

  int ans=n+find(tar,-1);
  if((path.size()-1)%2==0) ans++;
  cout<<ans<<endl;


  return 0;
}


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

int main()
{
    ll n;
    cin >> n;
    ll power = 1;
    ll nt = 1e9 + 7;
    for(ll i = 1;i <= n;i++){
        power *= i;
        power %= nt;
    }
    cout << power << endl;
    
}


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

int main() {
  int a[5];
  int b[5];
  bool s;
  int x, y;
  while (scanf("%d,%d,%d,%d,%d", &a[0], &a[1], &a[2], &a[3], &a[4]) == 5) {
    sort(a, a+5);
    memset(b, 0, sizeof(int)*5);
    x = y = -1;
    for (int i=0; i<5; i++) {
      if (a[i] != x) {
        x = a[i];
        ++y;
      }
      ++b[y];
    }
    sort(b, b+5, greater<int>());
    s = true;
    for (int i=0; i<4; i++) {
      if (a[i]+1 != a[i+1]) {
        s = false;
        break;
      }
    }
    if (a[0]==1 && a[1]==10 && a[2]==11 && a[3]==12 && a[4]==13) s = true;  // exception
    if (b[0] == 4) {
      printf("four card\n");
    } else if (b[0] == 3 && b[1] == 2) {
      printf("full house\n");
    } else if (s) {
      printf("straight\n");
    } else if (b[0] == 3) {
      printf("three card\n");
    } else if (b[0] == 2 && b[1] == 2) {
      printf("two pair\n");
    } else if (b[0] == 2) {
      printf("one pair\n");
    } else {
      printf("null\n");
    }
  }

  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,l,r) for(int i=l;i<r;i++)
using ll = long long;
const int inf=2e9+10;
const ll MOD=1e9+7;
const ll INF=9e18+10;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

int main(){
        string s;cin>>s;
        cout<<s;
        if(s[s.size()-1]=='s')cout<<"e";
        cout<<"s"<<endl;
        return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
constexpr long long INFF = 9223372036854775807;

signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    ll H;cin >> H;
    if(H == 1){
        cout << 1 << endl;
        return 0;
    }
    ll sum = 1,ans = 0;
    REP(i,1000){
        if(H < sum){
            cout << ans << endl;
            return 0;
        }
        ans += sum;
        sum *= 2;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 30
#define INF 1e9
 
class Dice{
private:
    int tmp;
public:
    vector<int> d;
   
    void init(){
	d.resize(6);
    }
 
    int getTop(){
	return d[0];
    }
 
    int getFront(){
	return d[1];
    }
 
    int getRight(){
	return d[2];
    }
 
    void rollN(){
	tmp = d[0];
	d[0] = d[1];
	d[1] = d[5];
	d[5] = d[4];
	d[4] = tmp;
    }
   
    void rollE(){
	tmp = d[0];
	d[0] = d[3];
	d[3] = d[5];
	d[5] = d[2];
	d[2] = tmp;
    }
  
    void rollS(){
	tmp = d[0];
	d[0] = d[4];
	d[4] = d[5];
	d[5] = d[1];
	d[1] = tmp;
    }
  
    void rollW(){
	tmp = d[0];
	d[0] = d[2];
	d[2] = d[5];
	d[5] = d[3];
	d[3] = tmp;
    }
};
 
int H,W,sx,sy;
int field[MAX][MAX];
bool visited[MAX][MAX][6][6][6][6];
 
struct State{
    int x,y,n,dist;
    Dice d;
   
    State(int x,int y,int n,int dist,Dice d) : 
	x(x),y(y),n(n),dist(dist),d(d) {}
};
 
int ctoi(char ch){
    switch(ch){
    case 'k':
	return -1;
    case 'r':
	return 0;
    case 'g':
	return 1;
    case 'b':
	return 2;
    case 'c':
	return 3;
    case 'm':
	return 4;
    case 'y':
	return 5;
    case 'w':
	return 6;
    }
    return -1;
}
 
bool inField(int x,int y){
    return 0 <= x && x < W && 0 <= y && y < H;
}
 
Dice init(){
    Dice d; d.init();
    d.d[0] = 0;
    d.d[1] = 4;
    d.d[2] = 2;
    d.d[3] = 5;
    d.d[4] = 1;
    d.d[5] = 3;
    return d;
}
 
void solve(Dice &dice){
    Dice initDice = init(); 
    int ans = INF;
    const int dx[4] = {-1,0,1,0};
    const int dy[4] = {0,-1,0,1};
    queue<State> Q;
    Q.push(State(sx,sy,0,0,initDice));
    memset(visited,false,sizeof(visited));
  
    while(!Q.empty()){
	State s = Q.front(); Q.pop();
	int x = s.x,y = s.y,n = s.n;
	Dice d = s.d;
	int t = d.getTop(),f = d.getFront(),r = d.getRight();
 
	if(visited[y][x][t][f][r][n]) continue;
	visited[y][x][t][f][r][n] = true;
	if(n == 6){ ans = s.dist; break; }
 
	for(int i = 0 ; i < 4 ; i++){
	    int nx = x + dx[i], ny = y + dy[i];
	    if(!inField(nx,ny)) continue;
	    if(field[ny][nx] == -1) continue;
	    Dice nd = d;
	    if(i == 0){
		nd.rollW();
	    }else if(i == 1){
		nd.rollN();
	    }else if(i == 2){
		nd.rollE();
	    }else{
		nd.rollS();
	    }
	    if(field[ny][nx] == nd.getTop() && field[ny][nx] == dice.d[n]){
		Q.push(State(nx,ny,n+1,s.dist+1,nd));
	    }else if(field[ny][nx] == 6){
		Q.push(State(nx,ny,n,s.dist+1,nd));
	    }
	}
    }
    if(ans == INF){
	cout << "unreachable" << endl;
    }else{
	cout << ans << endl;
    }
}
 
int main(){
    char in;
    while(cin >> W >> H, W){
	Dice dice; dice.init();
	for(int i = 0 ; i < H ; i++){
	    for(int j = 0 ; j < W ; j++){
		cin >> in;
		if(in == '#'){
		    in = 'w';
		    sx = j; sy = i;
		}
		field[i][j] = ctoi(in);
	    }
	}
	for(int i = 0 ; i < 6 ; i++){
	    cin >> in;
	    dice.d[i] = ctoi(in);
	}
	solve(dice);
    }
    return 0;
}

Measured memory_bytes: 4468
#include<iostream>
#include<math.h>
using namespace std;

int main()
{
    int a;
    cin>>a;
   
    int ans=0;
    for(int i=2;i<=a;i++){
        for(int j=1;pow(j,i)<=a;j++){
            if(ans<pow(j,i)){
                ans=pow(j,i);
            }
        }
    }
    if(a==1){
        ans=1;
    }
    printf("%d",ans);
    
   
    return 0;
}

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

#include <math.h>
#include <stdlib.h>


#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true; } return false; }
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true; } return false; }

//INT_MAX	2,147,483,647 = 2*1.0e9

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int a, b;
    cin >> a >> b;

    if(a*b%2 == 0) cout << "Even" << endl;
    else cout << "Odd" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	int x,y,s;
	while(true){
		cin>>x>>y>>s;
		if(x==0)
			break;
		int best=0;
		for(int i=1;i<s;i++)
			for(int j=1;j<s;j++)
				if(i*(100+x)/100+j*(100+x)/100==s)
					if(i*(100+y)/100+j*(100+y)/100>best)
						best=i*(100+y)/100+j*(100+y)/100;
		cout<<best<<endl;

	}
    return 0;
}

Measured memory_bytes: 1156
////////////////////////////////////
///     Please Give Me AC!!!     ///
////////////////////////////////////

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define forin(in) for(int i=0; i<(int)in.size(); i++) cin>>in[i]
#define forout(out) for(int i=0; i<(int)out.size(); i++) cout<<out[i]<<endl
#define rep(i, n) for(int i=0; i<(n); i++)

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

int main(){
    int A, B; cin>> A >> B;
    if(B % A == 0) cout<< A + B << endl;
    else cout<< B - A << endl;
}

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

#define ll long long
#define endl "\n";
#define mod 1000000007
#define pii pair<int,int>
#define vii vector<pii>
#define mp make_pair
#define all(a) a.begin(), a.end()
#define mk(arr,n,type) type *arr=new type[n];

void fastio() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main() {
    fastio();
    int k, a, b;
    cin >> k >> a >> b;

    int quo1 = a / k;
    int quo2 = b / k;
    int count;
    if (a % k == 0) count = quo2 - quo1 + 1;
    else count = quo2 - quo1;

    if (count) cout << "OK";
    else cout << "NG";

    return 0;
}


Measured memory_bytes: 3652
#include<stdio.h>

int main()
{
  int a,b,c,d,e,k;
  
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  scanf("%d",&e);
  scanf("%d",&k);
  
 if((e-a)>k | (e-b)>k | (e-c)>k | (e-d)>k | (d-a)>k | (d-b)>k | (d-c)>k | (c-a)>k | (c-b)>k | (b-a)>k){
   printf(":(");
 }else{
   printf("Yay!");
 }
  
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    ll x, y, ans = 0;
    cin >> x >> y;
    if (abs(x) < abs(y))
    {
        if (x < 0)
            ans++;
        ans += abs(y) - abs(x);
        if (y < 0)
            ans++;
    }
    else
    {
        if (x > 0)
            ans++;
        ans += abs(x) - abs(y);
        if (y > 0)
            ans++;
    }
    cout << ans;
    return 0;
}

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

using namespace std;

const int MAX_N = 100000;

long long N,A,B;

vector<long long> h(MAX_N);

long long l = 0, r = 1e9, mid=0;

bool check(long long n,vector<long long> inp);

int main(){
	cin >> N >> A >> B;
	for(int i =0;i<N;i++){
		cin >> h[i];
	}
	
	while(l != r){
		mid = (long long)(r + l)/2;
		if(check(mid,h)){
			r = mid;
		}else{
			l = mid +1;
		}
	}
	
	printf("%lld\n",r);
	return 0;
}

bool check(long long n,vector<long long> inp){
	vector<long long> nokori;
	for(int i = 0; i< N; i++){
		inp[i] -=  B * n;
		if(inp[i] > 0) nokori.push_back(inp[i]);
	}
	
	if(nokori.size() == 0) return true;
	
	long long cnt = 0;
	for(int i = 0; i < nokori.size();i++){
		cnt += (long long)ceil(1.*nokori[i] / (A-B));
	}
	if(cnt <= n) return true;
	
	return false;
}


Measured memory_bytes: 3668
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
a=list(map(int,input().split()))
m=min(a)
M=max(a)
if M-m>1:
    print("No")
    exit()
elif M-m==0:
    if a[0]==n-1 or 2*a[0]<=n:
        print("Yes")
    else:
        print("No")
elif M-m==1:
    c=0
    for i in range(n):
        if a[i]==m:
           c+=1
    if 2<=2*(M-c)<=n-c:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 21000
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();

    int diff = 0;
    for (int i = 1; i <= n; i++) {
      int p = sc.nextInt();
      if (p != i) diff++;
    }
    if (diff == 2 || diff == 0) {
      os.println("YES");
    } else {
      os.println("NO");
    }
  }
}

Measured memory_bytes: 21844
s=int(input())
a=[0]*1000000
a[0]=s
for i in range(1,1000000):
  if a[i-1]%2==0:
    a[i]=a[i-1]/2
  else:
    a[i]=3*a[i-1]+1
for i in range(1000000):
  if a[i] in a[:i]:
    print(i+1)
    break

Measured memory_bytes: 34548
main = do
    getLine
    s1 <- getLine
    let (p,c,cs) | length s1 == 1 = (True,3,[])
                 | x == y = (False,6,xs)
                 | x /= y = (True,3,(y:xs))
                 where (x:y:xs) = s1
    print $ solve p c cs

solve _ c [] = c
solve p c (x:[]) | p = (c * 2) `mod` 1000000007
                 | otherwise = c
solve p c (x:y:xs) | p && x == y = solve (not p) ((c*2) `mod` 1000000007) xs
                   | not p && x == y = solve p ((c*3) `mod` 1000000007) xs
                   | p = solve p ((c*2) `mod` 1000000007) (y:xs)
                   | otherwise = solve (not p) c (y:xs)

Measured memory_bytes: 3760
#include <algorithm>
#include <iostream>
#include <math.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 a, b;
    cin >> a >> b;
    if ((a + b) % 2 == 0)
        cout << (a + b) / 2 << endl;
    else
        cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 256
N = STDIN.gets.chomp.split(' ').map(&:to_i)
T, A = STDIN.gets.chomp.split(' ').map(&:to_i)
H = STDIN.gets.chomp.split(' ').map(&:to_i)

def foo(height)
  return T - (height  * 0.006)
end

min = nil
index = nil

H.each_with_index do |h, i|
  s = (A - foo(h)).abs
  # puts "#{h}->#{s} min: #{min}"
  if min == nil || s < min
    min = s
    index = i
  end
end

puts index + 1


Measured memory_bytes: 1788
import java.util.Scanner;

/**
 * @author penguin_410
 *         Date: 2014/03/06
 */
public class Main {
    public static void main(String... args) {
        final Scanner scanner = new Scanner(System.in);
        String str;
        while (!(str = scanner.nextLine()).equals("0 0")) {
            int x = Integer.parseInt(str.split(" ")[0]);
            int y = Integer.parseInt(str.split(" ")[1]);
            System.out.println(x < y ? x + " " + y : y + " " + x);
        }
    }
}

Measured memory_bytes: 32540
import sys
from math import factorial
n, k = [int(i) for i in sys.stdin.readline().split()]
mod = 10**9+7
fact_ls = [1]
res = 1
for i in range(1, n+1):
    res = res * i % mod
    fact_ls.append(res)

def my_fact(r):
    return fact_ls[r]

def extgcd(a, b):
    r = [1, 0, a]
    w = [0, 1, b]
    while w[2] != 1:
        q = r[2] // w[2]
        r2 = w
        w2 = [r[0] - q * w[0], r[1] - q * w[1], r[2] - q * w[2]]
        r = r2
        w = w2
    # [x,y]
    return [w[0], w[1]]


# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a, m):
    x = extgcd(a, m)[0]
    return (m + x % m) % m

def nCr(n, r, mod):
    a = my_fact(r)
    b = 1
    for i in range(1, r + 1):
        b = b * (n - i + 1) % mod
    a = mod_inv(a, mod)
    return b * a

def nHr(n, r, mod):
    return nCr(n + r - 1, r, mod)

def calc_func(n, r):
    a = my_fact(r)
    c = my_fact(n - r)
    b = my_fact(n)
    d = my_fact(n-1)
    e = my_fact(n-1-r)
    a = mod_inv(a, mod)
    c = mod_inv(c, mod)
    e = mod_inv(e, mod)
    return b * a * c % mod * d * e * a % mod

res = 1
for i in range(1, min(n, k + 1)):
    res = (res + calc_func(n, i)) % mod
print(res)

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

int main() {
  long long N;
  cin >> N;
  
  vector<long long> L(N);
  for (long long i = 0; i < N; i++) {
    cin >> L[i];
  }
  sort(L.begin(), L.end());
  
  long long count = 0;
  for (int i = N-1; i >= 0; i--) {
    for (int j = i-1; j >= 0; j--) {
      auto itr = lower_bound(L.begin(), L.end(), L[i]+L[j]);
      //cerr << L[i] << ' ' << L[j] << ' ' << *itr << endl; 
      long long ng = distance(itr, L.end());
      count += (N-1-i)-ng;
    }
  }
  
  cout << count << endl;  
  return 0;
}

Measured memory_bytes: 384
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if a * 500 + b * 100 + c * 50 == X:
                ans += 1

print(ans)


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

int main() {
  int N;
  cin >> N;
  if(N % 1000 == 0){
    cout << 0 << endl;
  }
  else{
  cout << 1000 - (N % 1000) << endl;
  }
}

Measured memory_bytes: 3676
from copy import copy, deepcopy
from collections import Counter, deque
from math import sqrt, floor, factorial
from itertools import permutations, combinations, combinations_with_replacement
from operator import mul
from functools import reduce
import bisect

MOD = 10**9 + 7
INF = float('inf')


def bfs(graph, visited, cost):
    now = 1
    queue = deque()
    for e in G[now]:
        queue.append((now, e))
    while queue:
        print(queue)
        pre, now = queue.popleft()
        if visited[now] == -1:
            visited[now] = pre
            cost[now] = cost[pre] + 1
            for e in G[now]:
                queue.append((now, e))
        elif cost[now] > cost[pre] + 1:
            visited[now] = pre
            cost[now] = cost[pre] + 1
            for e in G[now]:
                queue.append((now, e))


def bfs2(graph, visited, cost):
    now = 1
    queue = deque()
    for e in G[now]:
        queue.append((now, e))
    while queue:
        pre, now = queue.popleft()
        if cost[now] > cost[pre] + 1:
            visited[now] = pre
            cost[now] = cost[pre] + 1
            for e in G[now]:
                queue.append((now, e))


N, M = list(map(int, input().split()))
G = [[] for i in range(N+1)]
way = [-1 for i in range(N+1)]
cost = [INF for i in range(N+1)]
cost[1] = 0
cost[0] = 0
way[0] = 0

for i in range(M):
    A, B = list(map(int, input().split()))
    G[A].append(B)
    G[B].append(A)

# print(G)

bfs2(G, way, cost)

tmp = way[2:]

if max(cost) == INF:
    print("No")
else:
    print("Yes")
    for i in range(len(tmp)):
        print(tmp[i])


Measured memory_bytes: 53668
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//入力Nを取得
		String inputStrN=sc.nextLine();
		int inputIntN = Integer.parseInt(inputStrN);
		char[] aStrN=new char[inputStrN.length()];
		int sumN = 0;
		//S(N)を計算
		for(int j = 0;j < inputStrN.length();j++){
			aStrN[j]=inputStrN.charAt(j);
			sumN = sumN + Character.getNumericValue(aStrN[j]);
		}
		//判定
		if(inputIntN % sumN == 0){
			// 出力
			System.out.println("Yes");
		}else{
			// 出力
			System.out.println("No");
		}
		

	}
}

Measured memory_bytes: 21844
import sys
def input(): return sys.stdin.readline().rstrip()
import math
def main():
    a,b,h,m=map(int,input().split())
    theta_a=(60*h+m)*2*math.pi/720
    theta_b=m*2*math.pi/60
    print(math.sqrt((a*math.cos(theta_a)-b*math.cos(theta_b))**2+(a*math.sin(theta_a)-b*math.sin(theta_b))**2))

if __name__=='__main__':
    main()

Measured memory_bytes: 62588
#include <bits/stdc++.h>
#define pb push_back
#define optimize ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
using namespace std;
// ifstream fin(FILEIN);
// ofstream fout(FILEOUT);
void citire();
void rez();
void afis();
void solve();
int n, m, q, x;
ll ans, houses;
int house[200005], lentgh, maxim;
int distance1[200005];
int main(int argc, char const *argv[])
{
	 cin >> lentgh >> houses;
	 for(int i =1 ;i <=houses ;i ++)
	 	cin >>house[i];
	 house[houses + 1] = lentgh + house[1];
	distance1[0] = house[1];
	 for(int i = 1 ;i <=houses; i ++)
	 {
	 	distance1[i] = house[i + 1]- house[i];
	 	ans+=distance1[i];
	 	maxim = max(maxim, distance1[i]);
	 }
	 cout << ans - maxim;
}

Measured memory_bytes: 1792
open System.Collections.Generic

let K = stdin.ReadLine() |> int

let queue = new Queue<int64>()

[ 1L..9L ] |> List.iter queue.Enqueue

let mutable n = 0L

for i in [ 0..K - 1 ] do
    n <- queue.Dequeue()
    match n % 10L with
    | 0L ->
        [ n * 10L + n % 10L
          n * 10L + n % 10L + 1L ]
    | 9L ->
        [ n * 10L + n % 10L - 1L
          n * 10L + n % 10L ]
    | _ ->
        [ n * 10L + n % 10L - 1L
          n * 10L + n % 10L
          n * 10L + n % 10L + 1L ]
    |> List.iter queue.Enqueue

n |> printfn "%d"


Measured memory_bytes: 24656
(* O(1) *)
let a, b, c = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let m = max a @@ max b c
let x = m + if m mod 2 = (a + b + c) mod 2 then 0 else 1
let _ = Printf.printf "%d\n" @@ (3 * x - (a + b + c)) / 2

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

int main() {
  int n,ans = 0;
  cin >> n;
  REP(i,n){
    int a;
    cin >> a;
    while(1){
      if(a % 2 != 0) break;
      a /= 2;
      ans++;
    }
  }
  
  cout << ans << endl;
}


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

int main(){
  long long n,k;
  cin >> n >> k;
  long long ans=0;
  if(k==0){
    ans=n*n;
  }else{
    for(int i=k+1;i<=n;i++){
      if(n%i){
        ans+=(long long)((n/i)*(i-k)+((n%i+1>=k)?(n%i+1-k):0));
      }else{
        ans+=(long long)((n/i)*(i-k));
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

typedef long long ll;

const ll mod = 10007;
const int inf = 101234567;

int main() {
    ll X, Y, A, B, C;
    cin >> X >> Y >> A >> B >> C;
    vector<ll>p(A);
    vector<ll>q(B);
    vector<ll>r(C);
    vector<ll>total;
    for (int i = 0; i < A; i++) {
        cin >> p[i];
    }
    for (int i = 0; i < B; i++) {
        cin >> q[i];
    }
    for (int i = 0; i < C; i++) {
        cin >> r[i];
    }
    sort(p.begin(), p.end(), greater<ll>());
    sort(q.begin(), q.end(), greater<ll>());
    sort(r.begin(), r.end(), greater<ll>());
    
    for (int i = 0; i < X; i++) {
        total.push_back(p[i]);
    }
    for (int i = 0; i < Y; i++) {
        total.push_back(q[i]);
    }
    sort(total.begin(), total.end());
    for (int i = 0; i < min(X+Y, C); i++) {
        if (total[i] < r[i]) {
            total[i] = r[i];
        } else {
            break;
        }
    }
    ll ans = 0;
    for (int i = 0; i < X+Y; i++) {
        ans += total[i]; 
    }
    cout << ans << endl;
}


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

int main(){
  int n, m; cin >> n >> m;
  vector<pair<int, int>> req(m);
  
  for(int i = 0; i < m; i++) {
    int a, b; cin >> a >> b;
    req[i] = make_pair(b, a);
  }
  
  sort(req.begin(), req.end());
  
  int ans = 0;
  int prev = -1;
  
  for(int i = 0; i < m; i++){
  
    int a = req[i].second;
    int b = req[i].first;
    
    if(prev == -1) {
      ans++;
      prev = b-1;
      continue;
    }
    
    if(a <= prev && prev < b){
      continue;
    }else {
    ans++;
    prev = b-1;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
inline char nc()
{
	static char buf[100000], *l = buf, *r = buf;
	return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void read(T &x)
{
	x = 0; int f = 1, ch = nc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
	x *= f;
}
const int maxn = 10000 + 5;
int N, M;
int c[3];
int bel[maxn];
int val[maxn];
int head[maxn];
int dis[3][maxn];
int mnv[3][maxn];
struct edge
{
    int to, nex;
    edge(int to=0,int nex=0):to(to),nex(nex){}
};
vector<edge> G;
inline void addedge(int u, int v)
{
    G.push_back(edge(v, head[u])), head[u] = G.size() - 1;
    G.push_back(edge(u, head[v])), head[v] = G.size() - 1;
}
void BFS(int s, int id)
{
    static int q[maxn];
    int hd = 0, tl = 0;
    memset(dis[id], -1, sizeof(dis[id]));
    q[tl++] = s;
    dis[id][s] = 0;
    mnv[id][s] = val[s];
    while(hd < tl)
    {
        int u = q[hd++];
        for(int i = head[u]; ~i; i = G[i].nex)
        {
            int v = G[i].to;
            if(dis[id][v] == -1)
            {
                dis[id][v] = dis[id][u] + 1;
                mnv[id][v] = min(mnv[id][u], val[v]);
                q[tl++] = v;
            }
            else if(dis[id][v] == dis[id][u] + 1)
            {
                mnv[id][v] = min(mnv[id][v], mnv[id][u]);
            }
        }
    }
}
void solve()
{
    for(int i = 0; i < 3; ++i) BFS(N + i + 1, i);
    int an0 = -1, an1 = -1;
    for(int i = 1; i <= N + 3; ++i) if(bel[i] == i)
    {
        int t = dis[0][i] + dis[1][i] + dis[2][i];
        int d = min(mnv[0][i], min(mnv[1][i], mnv[2][i]));
        if(an0 == -1 || t < an0)
        {
            an0 = t;
            an1 = d;
        }
        else if(an0 == t)
        {
            an1 = min(an1, d);
        }
    }
    printf("%d %d\n", an0, an1);
}
int main()
{
//    freopen("in", "r", stdin);
    read(N);
    for(int i = 0; i < 3; ++i) read(c[i]);
    for(int i = 1; i <= N + 3; ++i) val[i] = bel[i] = i;
    for(int i = 0; i < 3; ++i)
    {
        int id = N + i + 1;
        for(int j = 1; j <= c[i]; ++j)
        {
            int x; read(x);
            bel[x] = id;
            val[id] = min(val[id], x);
        }
    }
    memset(head, -1, sizeof(head));
    read(M);
    for(int i = 1; i <= M; ++i)
    {
        int u, v; read(u), read(v);
        addedge(bel[u], bel[v]);
    }
    solve();
    return 0;
}



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

int main() {
    int n,flag=0;
    cin>>n;
    for(int i=1;i<=9;i++){
        if(n%i==0 && n/i<=9) flag=1;
    }
    if(flag) cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}

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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	cin.sync_with_stdio(false); cin.tie(0);
	cin.exceptions(cin.failbit);

	int n; cin >> n;
	vector<int> v(n);
	rep(i, 0, n) cin >> v[i];
	int g = v[0];
	rep(i, 1, n) g = __gcd(g, v[i]);
	cout << g << endl;
}


Measured memory_bytes: 640
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstdlib>
#define ll long long
using namespace std;
int a[15];
int main()
{
    int N;
    scanf("%d",&N);
    for(int i=0;i<N;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a,a+N);
    int sum=a[N-1]/2;
    for(int i=0;i<N-1;i++)
    {
        sum+=a[i];
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
	int A,B;
	char str[30];
	int len;
	
	scanf("%d %d",&A,&B);//getchar();
	scanf("%s",str);
	//gets(str);
	//cout<<str<<endl;
	len=strlen(str);
	if(len==A+B+1)
	{
		if(str[A]=='-')
		{
			for(int i=0;i<len;i++)
			{
				if(i==A) continue;
				if(str[i]>='0' && str[i]<='9')
				{
				
					//i++;
					if(i==len-1)
						printf("Yes\n");
				}
				else
				{
					printf("No\n");
					break;
				}
			}
		}
		else
			printf("No\n");
	}
	else
	{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 256
A = [
    1, 1, 1, 2, 1, 2, 1, 5,
    2, 2, 1, 5, 1, 2, 1, 14,
    1, 5, 1, 5, 2, 2, 1, 15,
    2, 2, 5, 4, 1, 4, 1, 51
]

K = int(input())

print(A[K-1])

Measured memory_bytes: 2940
N = int(input())
a = list(map(int, input().split()))
odd = 0
mul2 = 0
mul4 = 0
for i in a:
    if i % 2 == 1:
       odd += 1
    elif i % 4 == 0:
        mul4 += 1
    else:
        mul2 += 1

if mul2:
    if odd <= mul4:
        print("Yes")
    else:
        print("No")
else:
    if odd <= mul4 + 1:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  // x 匹　y本
  int x, y,t,k, amari;
  cin >> x >> y;
  
  k=(y-2*x)/2;
  t=x-k;
  amari=(y-2*x)%2;
  
  if (amari == 0 && k >= 0 && k <=25 && t>=0 && t<= 50){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  
  
    

}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main(){
    cin>>Q;
    rep(roop,Q){
        cin>>A>>B;
        if(abs(A - B) > 1) {
            ll lb = 1, ub = (2e+9) + 1;
            while (ub - lb > 1) {
                ll cen = (ub + lb) / 2;
                (((cen / 2) * ((cen + 1) / 2) < A * B) ? lb : ub) = cen;
            }
            ll low = lb / 2, high = (lb + 1) / 2;
            cout<<low + high - 2<<endl;
        }else{
            cout<<(min(A, B) * 2 - 2)<<endl;
        }

    }
}

Measured memory_bytes: 256
n,k = map(int,input().split())
s = input()
h = list()
h.append(0)
for i in range(n - 1):
    if(s[i]!=s[i + 1]):
        h.append(i + 1)
m = len(h)
for i in range(2*k + 1):
    h.append(n)
mx = 0
for i in range(m):
    if(s[h[i]]=="0"):
        mx = max(mx,h[i + 2*k] - h[i])
    else:
        mx = max(mx,h[i + 2*k + 1] - h[i])
print(mx)


Measured memory_bytes: 7540
def bubble(A,N):
    flag = 1
    c = 0
    while flag:
        flag = 0
        for j in range(1,N)[::-1]:
            if A[j]<A[j-1]:
                t = A[j]
                A[j]=A[j-1]
                A[j-1]=t
                c+=1
                flag = 1
    
    L = [str(a) for a in A]
    print(" ".join(L))
    print(c)

if __name__=="__main__":
    n=int(input())
    l=[int(x) for x in input().split()]
    bubble(l,n)


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

int main() {
    int n;
    cin >> n;
    vector<int> vec(n);
    for(int i = 0; i < n; i++){
        cin >> vec.at(i);
    }
    int perf = 1;
    int broken = 0;
    for(int i = 0; i < vec.size(); i++){
        if(vec.at(i) != perf){
            broken++;
        } else {
            perf++;
        }
    }
    if(perf == 1){
        cout << -1 << endl;
    } else { 
        cout << broken << endl;
    }
}


Measured memory_bytes: 1024
{-# LANGUAGE BangPatterns #-}

module Main
  ( main
  )
where
 
import           Control.Applicative
import           Control.Monad
import           Data.Bits
import qualified Data.ByteString.Char8         as BS
import           Data.Char
import           Data.List
import           Data.Maybe
import qualified Data.Vector                   as V
 
parse = fst . fromJust
parseInt = parse . BS.readInt
parseInteger = parse . BS.readInteger
readInt = parseInt <$> BS.getLine
readInteger = parseInteger <$> BS.getLine
readIntList = map parseInt . BS.words <$> BS.getLine
 
main = do
  n <- readInt
  print $ 800 * n - 200 * (n `div` 15)


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

int main() {
  int n,k,ans;
  cin >>n>>k;
  ans = 0;
  vector<int> dnum(k);
  vector<vector<int>> Anum(k, vector<int>(n));
  vector<int> cnt(n);
  for(int i = 0; i < k; i++){
    cin >> dnum.at(i);
    for(int j = 0; j < dnum.at(i); j++){
      cin >> Anum.at(i).at(j);
      cnt.at(Anum.at(i).at(j) - 1)++;
    }
  }
  for(int i = 0 ;i < n;i++){
    if(cnt.at(i)==0){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
//constexpr ll MOD = 998244353;
//constexpr ll MOD = ;
constexpr ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
#define FINALANS(A) do {cout << (A) << '\n'; exit(0);} while (false)

class mll
{
public:
  ll x;
  constexpr mll(ll x = 0) : x((x % MOD + MOD) % MOD) {}
  constexpr mll operator-() const
  {
    return mll(-x);
  }
  constexpr mll& operator+=(const mll& a)
  {
    x += a.x;
    if (x >= MOD)
      x -= MOD;
    return *this;
  }
  constexpr mll& operator-=(const mll& a)
  {
    x += MOD - a.x;
    if (x >= MOD)
      x -= MOD;
    return *this;
  }
  constexpr mll& operator*=(const mll& a)
  {
    x *= a.x;
    x %= MOD;
    return *this;
  }
  constexpr mll operator+(const mll& a) const
  {
    mll ret(*this);
    ret += a;
    return ret;
  }
  constexpr mll operator-(const mll& a) const
  {
    mll ret(*this);
    ret -= a;
    return ret;
  }
  constexpr mll operator*(const mll& a) const
  {
    mll ret(*this);
    ret *= a;
    return ret;
  }
  constexpr mll pow(ll t) const
  {
    mll ret = 1;
    mll a = *this;
    while (t > 0)
    {
      if (t % 2 == 1)
        ret *= a;
      
      a *= a;
      t /= 2;
    }
    return ret;
  }
  constexpr mll inv() const
  {
    return pow(MOD - 2);
  }
  constexpr mll& operator/=(const mll& a)
  {
    return (*this) *= a.inv();
  }
  constexpr mll operator/(const mll& a) const
  {
    mll ret(*this);
    ret /= a;
    return ret;
  }
};
ostream& operator<<(ostream& os, const mll& m)
{
  os << m.x;
  return os;
}

int main()
{
  ll H, W;
  cin >> H >> W;
  vector<string> A(H);
  for (ll i = 0; i < H; i++)
  {
    cin >> A.at(i);
  }

  vector<vector<mll>> dp(H, vector<mll>(W));
  dp.at(0).at(0) = 1;
  for (ll i = 0; i < H; i++)
  {
    for (ll j = 0; j < W; j++)
    {
      if (i < H - 1 && A.at(i + 1).at(j) == '.')
        dp.at(i + 1).at(j) += dp.at(i).at(j);
      if (j < W - 1 && A.at(i).at(j + 1) == '.')
        dp.at(i).at(j + 1) += dp.at(i).at(j);
    }
  }
  cout << dp.at(H - 1).at(W - 1) << endl;
}

Measured memory_bytes: 9216
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
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; }

int main(){
	int k,a,b;cin>>k>>a>>b;
	for(int i = a; i <= b; i++) {
		if (i % k == 0){
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
	return 0;
}

Measured memory_bytes: 3596