akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;

#define FILEIO(name) freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);

using namespace std;

char a[4][5] = {"abcc", "abdd", "eefg", "hhfg"};
char b[5][6] = {"abbcc", "add.e", "f..ge", "f..gh", "iijjh"};
char c[6][7] = {"aabbcc", "d.e.f.", "d.e.f.", ".g.h.i", ".g.h.i", "jjkkll"};
char d[7][8] = {"a..bbcc", "adde...", "f..e..g", "f...hhg", ".hhi..j", "k..i..j", "kll.mm."};
char s[1005][1005];

void Push(int x, int y, int op) {
  if (op == 0) {
    for (RI i = 0; i < 4; ++i)
      for (RI j = 0; j < 4; ++j)
        s[i + x][j + y] = a[i][j];
  }
  if (op == 1) {
    for (RI i = 0; i < 5; ++i)
      for (RI j = 0; j < 5; ++j)
        s[i + x][j + y] = b[i][j];
  }
  if (op == 2) {
    for (RI i = 0; i < 6; ++i)
      for (RI j = 0; j < 6; ++j)
        s[i + x][j + y] = c[i][j];
  }
  if (op == 3) {
    for (RI i = 0; i < 7; ++i)
      for (RI j = 0; j < 7; ++j)
        s[i + x][j + y] = d[i][j];
  }
}

int main() {
  
#ifdef LOCAL
  FILEIO("a");
#endif

  int n; cin >> n;
  int tttttt = n;
  if (n <= 2) return puts("-1"), 0;
  if (n == 3) {
    puts("a..");
    puts("a..");
    puts(".bb");
    return 0;
  }
  for (RI i = 0; i < n; ++i)
    for (RI j = 0; j < n; ++j)
      s[i][j] = '.';
  Push(0, 0, n % 4);
  int cnt = 4 + n % 4;
  n -= 4 + n % 4;
  while (n) Push(cnt, cnt, 0), cnt += 4, n -= 4;
  for (RI i = 0; i < tttttt; ++i)
    puts(s[i]);
  return 0;
}

// created by Daniel yuan

Measured memory_bytes: 2176
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);

		String amj=sc.next();
		long s1=0;
		long mojisu=sc.nextLong();
		long mj=0;
		for(int i=0; i<amj.length(); i++) {
			if(amj.charAt(i)!='1') {
				if(s1>0) {
					mj=Long.parseLong(amj.charAt(Math.min(((int)s1) ,amj.length()-1))+"");
				}
				else {
					mj=Long.parseLong(amj.charAt(0)+"");
				}
				break;
			}
			else {
				s1++;
			}
		}

		if(mojisu>s1) {
			System.out.println(mj);
		}
		else {
			System.out.println(1);
		}
	}
}

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

int main() {
  double N;
  cin >> N;
  string X=":(";
  for(int i = 1; i < 50000; i++){
    int tmp = i*1.08;
    if(N==tmp) X = to_string(i);
  }
  cout << X << endl;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
bool us[1000010]={false};
int p[1000010] = {0};
int main(){
	/*Eratosthenes*/
	p[0] = 2;
	for(int i = 0; i <= 1000010; i+=2){
		us[i] = true;
	}
	
	int cnt = 1;
	for(int i = 3; i <= 1000010; i+=2){
		int q = 0;
		if(us[i] == true)continue;
		else if(us[i] == false){
			p[cnt] = i;
			cnt++;
			us[i] = true;
			q = i;
			for(int j = q+q; j <= 1000010; j += q){
				us[j] = true;
			}
		}
	}
	
	int n;
	while(~scanf("%d",&n)){
		int x = 0;
		while(1){
			if(p[x] > n)break;
			x++;
		}
		printf("%d\n",x);
	}
	return 0;
}

Measured memory_bytes: 4168
# C - GeT AC
# https://abc122.contest.atcoder.jp/tasks/abc122_c

"""
累積和を用いて実装しないと時間が足りない
"""

import sys
n, q = list(map(int, sys.stdin.readline().split()))
s = list(sys.stdin.readline())

cnt = [0] * (len(s)+1)

"""
ACを数えるために受けた文字列ｓを展開して数えていく
"""

for i in range(1, len(s)):
    """
    s = ACACTACG
    cnt = [0,0,1,1,2,2,2,3,3]
    i == 1, 2, 3……len(s)
    
    i == 1
    s[i] == C s[i-1] == A
    ここで代入されるべきなのはcntのindex2番である　
        なぜならば、cntは最初に0を代入するので、s[i]の位置に当たるのはcnt[i]+1であるため
    """

    if s[i] == "C" and s[i-1] == "A":
        cnt[i+1] = cnt[i] + 1
    else:
        cnt[i+1] = cnt[i]


r_and_l = [list(map(int, sys.stdin.readline().split())) for _ in range(q)]

for e in r_and_l:
    num = e[0]
    print(cnt[e[1]] - cnt[num] )


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

using namespace std;

typedef long long ll;

int digit(int n){
    vector<int>d(5,0);
    if(n>=10000){
        d[0]=n/10000;
        n%=10000;
    }
    if(n>=1000){
        d[1]=n/1000;
        n%=1000;
    }
    if(n>=100){
        d[2]=n/100;
        n%=100;
    }
    if(n>=10){
        d[3]=n/10;
        n%=10;
    }
    if(n>=0){
        d[4]=n;
    }
    int sum=0;
    for(int i=0;i<5;i++){
        sum += d[i];
    }
    return sum;
}

int main() {
    int N,A,B;cin >> N >> A >> B;
    int sum=0;
    for(int i=1;i<=N;i++){
        if(digit(i)>=A && digit(i)<=B){
            sum += i;
        }
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
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;}
const ll INF = 1LL << 60;
const double pi = acos(-1.0);

template<class Abel> struct UnionFind {
    vector<int> par;
    vector<int> rank;
    vector<Abel> diff_weight;

    UnionFind(int n = 1, Abel SUM_UNITY = 0) {
        init(n, SUM_UNITY);
    }

    void init(int n = 1, Abel SUM_UNITY = 0) {
        par.resize(n); rank.resize(n); diff_weight.resize(n);
        rep(i, n) par[i] = i, rank[i] = 0, diff_weight[i] = SUM_UNITY;
    }

    int root(int x) {
        if (par[x] == x) return x;
        int r = root(par[x]);
        diff_weight[x] += diff_weight[par[x]];
        return par[x] = r;
    }

    Abel weight(int x) {
        root(x);
        return diff_weight[x];
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y, Abel w) {
        w += weight(x); w -= weight(y);
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y), w = -w;
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        diff_weight[y] = w;
        return true;
    }

    Abel diff(int x, int y) {
        return weight(y) - weight(x);
    }
};


int main() {
    ll n, m; cin >> n >> m;
    UnionFind<int> uf(n);
    rep(i, m) {
        ll l, r, d; cin >> l >> r >> d; l--; r--;
        if(uf.issame(l, r) && d != uf.diff(l, r)) {
            cout << "No" << endl;
            return 0;
        }
        uf.merge(l, r, d);
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 4584
#include <bits/stdc++.h>
using namespace std;
void debug() {cout<<endl;}
template<typename T,typename... Args>
void debug(T x,Args... args) {cout<<x<<" ";debug(args...);}
#define forn(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define F first
#define S second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;


struct BIT {
  int n;
  vector<ll> bit;
  BIT(int _n){ 
    n = _n+1;
    bit.assign(n, 0);
  }

  void set(int k, ll val){
    for(; k <=n; k += k&-k) bit[k] = max(bit[k], val);
  }

  ll rmq(int k){
    ll mx = 0;
    for(; k > 0; k -= k&-k) mx = max(mx, bit[k]);
    return mx;
  }
};

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

  int n;
  cin >> n;
  vector<int> h(n), a(n);
  int mx = 0;
  forn(i, 0, n){
    cin >> h[i];
    mx = max(mx, h[i]);
  }
  forn(i, 0, n)cin >> a[i];

  BIT bit(mx+1);

  ll ans = 0;
  forn(i, 0, n){
    ll x = 0;
    if(h[i] > 1)x = bit.rmq(h[i]-1);
    ll y = bit.rmq(h[i]);
    if(y < x+a[i]){
      bit.set(h[i], x+a[i]);
      ans = max(ans, x+a[i]);
    }
  }

  cout << ans << endl;



}





Measured memory_bytes: 6372
#include<bits/stdc++.h>
using namespace std;
int main() {
	int N; cin >> N;
	int P[N];
	for(int i = 0; i < N; i++) cin >> P[i];
	int min = 1e9, res = 0;
	for (int i = 0; i < N; i++)
	{
		if(min >= P[i]) {
			min = P[i];
			res++;
		}
	}

	cout << res << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <deque>
#include <string>
#include <stack>
#include <unordered_set>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <map>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 90001

using namespace std;

int main(void)
{
	cin.tie(NULL); ios_base::sync_with_stdio(false);
	string str1, str2, str3; cin >> str1 >> str2 >> str3;
	cout << str1[0] << str2[1] << str3[2];

	return 0;
}

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

#define NIL NULL/*??????????????§???????????§NULL????????¨?????¨??????*/
struct node{
  int key;
  struct node *parent;
  struct node *left;
  struct node *right;
};

typedef struct node * Node;/*?§???????node?????????????????¨????????£?¨?*/


void insert(Node,int);

void PrintInorder(Node );
void PrintPreorder(Node );
Node root,newnode;
main()
{
  int number,k,i;
  char str[20];
  
  scanf("%d",&number);
  root = malloc(sizeof(struct node));
  for(i=0;i<number;i++)
    {
      scanf("%s",str);
      if(str[0]=='i')
	{
	  scanf("%d",&k);
	  if(i !=0) {
	    
	    insert(root,k);}/*??????Tree????????£????????????????????¢??°????????????*/	
	  else root->key = k;
	 
	  
	}
      else{
      PrintInorder(root);
      printf("\n");
      PrintPreorder(root);
      printf("\n"); 
    }	
    }
return 0;
}

void insert(Node t,int k)
{
  Node y,x,z;
  /*??????????????§????????????????????§malloc?????????????????£??\??§?????????*/
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = z->right = NIL;
 
  

  y = NIL;/*????????§????????????????????? y???x??????????????????*/
  x = t;/*T=root*/ 
  
  while(1)
    {
      y = x;/*??????????????????*/
      
      if(z->key < x->key) x = x->left;
      else x = x->right;
      
      if(x == NIL)break;
    }

   z->parent = y;
   if(y == NIL)t = z;/*??????????¨???????????????¨??§??????root?????£??\??§?????????*/

   else if(z->key < y->key) y->left = z;
   else y->right = z;


}

void makenode(int k,Node z)
{
 
  
}

void PrintInorder(Node T)
{
  if(T != NIL){
     PrintInorder(T->left);
  
  
  printf(" %d",T->key);
 
 
   PrintInorder(T->right);
  }
  else return;
  
}

void PrintPreorder(Node T)
{
  if(T != NIL){
    printf(" %d",T->key);

    PrintPreorder(T->left);
    PrintPreorder(T->right);

  }
  else return ;
 
}

Measured memory_bytes: 24040
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    char cs[] = "ACGT";
    int n;
    cin >> n;
    if (n == 3) {
        cout << 61 << endl;
        return;
    }
    LL dp[100][4][4][4][4] = {};
    REP(i,0,4) REP(j,0,4) REP(k,0,4) REP(l,0,4) dp[3][i][j][k][l] = 1;
    REP(i,0,4) {
        dp[3][0][2][1][i] = 0;
        dp[3][0][1][2][i] = 0;
        dp[3][2][0][1][i] = 0;

        dp[3][i][0][2][1] = 0;
        dp[3][i][0][1][2] = 0;
        dp[3][i][2][0][1] = 0;

        dp[3][0][i][2][1] = 0;

        dp[3][0][2][i][1] = 0;
    }

    REP(i,4,n) {
        REP(j,0,4) REP(k,0,4) REP(l,0,4) REP(m,0,4) {
            bool b = false;
            if (j == 0 && k == 2 && l == 1) b = true;
            if (j == 0 && k == 1 && l == 2) b = true;
            if (j == 2 && k == 0 && l == 1) b = true;

            if (j == 0 && k == 2 && m == 1) b = true;

            if (j == 0 && l == 2 && m == 1) b = true;

            if (k == 0 && l == 2 && m == 1) b = true;
            if (k == 0 && l == 1 && m == 2) b = true;
            if (k == 2 && l == 0 && m == 1) b = true;

            if (b) {
                dp[i][j][k][l][m] = 0;
                continue;
            }
            REP(o,0,4) modAdd(dp[i][j][k][l][m], dp[i-1][o][j][k][l]);
        }
    }
    LL ans = 0;
    REP(i,0,4) REP(j,0,4) REP(k,0,4) REP(l,0,4) ans = (ans + dp[n-1][i][j][k][l]) % MOD;
    cout << ans << endl;
}

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

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;

using namespace std;

int main(){
    int n,k,a[110];
    cin>>n>>k;
    lol(i,n)cin>>a[i];
    sort(a,a+n);
    int ans=0;
    lol(i,n){
	if(k<a[i])break;
	k-=a[i];
	ans++;
    }
    if(ans==n)if(k>0)ans--;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
m = [[0]*(w+2)]
for _ in range(h):
    m.append([0]+[0 if s == '.' else s for s in input()]+[0])
m.append([0]*(w+2))
around = [(i, j)for i in range(-1, 2) for j in range(-1, 2)]
for i in range(1, h+1):
    for j in range(1, w+1):
        if m[i][j] == '#':
            for x, y in around:
                if m[i+x][j+y] != '#':
                    m[i+x][j+y] += 1

for i in range(1, h+1):
    print(''.join(map(str, m[i]))[1:-1])


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

struct UnionFind {
    vector<int> d;
    UnionFind(int n=0) : d(n,-1) {}
    int find(int x) {
        if (d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if (x == y) return false;
        if (d[x] > d[y]) swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y) { return find(x) == find(y);}
    int size(int x) { return -d[find(x)];}
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    vi p(n);
    rep(i, n) cin >> p[i];
    UnionFind uf(n);
    rep(i, m) {
        int x, y;
        cin >> x >> y;
        x--; y--;
        uf.unite(x, y);
    }
    int ans = 0;
    rep(i, n) {
        // p[i] == i+1にしたい
        if (uf.same(p[i]-1, i)) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        int sum = 0;
        for (int i = 0; i < n; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
            sum += tmp;
        }
        Collections.sort(a);
        int xx = x;
        for (int i = 0; i < n; i++) {
            int tmp = a.get(i);
            if(tmp > xx) {
                System.out.println(i);
                return;
            } else {
                xx -= tmp;
            }
        }
        if(sum < x) {
            n--;
        }
        System.out.println(n);
    }
}

Measured memory_bytes: 35892
#include "bits/stdc++.h"

using namespace std;
using VI = vector<int>;

#define FOR(n) for(int i=0;i<n;i++)
#define IN(n,a) for(int i=0;i<n;i++) cin>>a[i]

int main()
{
	int n;
	cin >> n;
	vector<double> a(n);
	IN(n, a);

	double ans = 0;
	FOR(n)
	{
		ans += (1 / a[i]);
	}

	cout << 1 / ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	
	
	public static int findK(int x)
	{
		int k= x/2;
		System.out.println(k);
		return k;
	}
	
	public static void main(String[] args)
	{
		Scanner scann = new Scanner(System.in); 
		int a=scann.nextInt();
		int b=scann.nextInt();
		
		
		int x= a+b;
		if(a==b)
			System.out.println("IMPOSSIBLE");
		else if(x%2==1)
			System.out.println("IMPOSSIBLE");
		else
			 findK(x);
			;
			
			

}
}


Measured memory_bytes: 22100
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll h;
    cin>>h;
    ll power=log2(h);
    ll ans=pow(2,power+1)-1;
    cout<<ans;
    return 0;
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MN = 1e5 + 5;
int N, M;

bool works(ll x) {
    ll sum = x * N;
    return sum <= M && (M - sum) % x == 0; 
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> N >> M;
    int ans = 1;
    for (int i = 1; i <= sqrt(M); i++) {
        if (M % i == 0) {
            int j = M / i;
            if (works(i)) ans = max(ans, i);
            if (works(j)) ans = max(ans, j);
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

var sx, sy, tx, ty int
var mod int = pow(10, 9) + 7

func main() {
	fmt.Scan(&sx, &sy, &tx, &ty)
	ans := make([]string, 1000000)

	var i, k int
	for i = k; i < k+(ty-sy); i++ {
		ans[i] = "U"
	}
	k = i + 1
	for i = k; i < k+(tx-sx); i++ {
		ans[i] = "R"
	}
	k = i + 1
	for i = k; i < k+(ty-sy); i++ {
		ans[i] = "D"
	}
	k = i + 1
	for i = k; i < k+(tx-sx); i++ {
		ans[i] = "L"
	}
	k = i + 1

	/* --------------- 2回目 --------------- */

	ans[k] = "L"
	k = k + 1

	for i = k; i <= k+(ty-sy); i++ {
		ans[i] = "U"
	}
	k = i + 1
	for i = k; i <= k+(tx-sx); i++ {
		ans[i] = "R"
	}
	k = i + 1

	ans[k] = "D"
	k = k + 1
	ans[k] = "R"
	k = k + 1

	for i = k; i <= k+(ty-sy); i++ {
		ans[i] = "D"
	}
	k = i + 1
	for i = k; i <= k+(tx-sx); i++ {
		ans[i] = "L"
	}
	k = i + 1

	ans[k] = "U"

	for i = 0; i <= k; i++ {
		fmt.Printf("%s", ans[i])
	}
}

/*  ----------------------------------------  */
func lcm(x, y uint64) uint64 {
	return (x / gcd(x, y)) * y
}

func gcd(x, y uint64) uint64 {
	if x%y == 0 {
		return y
	} else {
		r := x % y
		return gcd(y, r)
	}
}

func combination(x, y int) int {
	return permutation(x, y) / permutation(y, y)
}

func permutation(x, y int) int {
	var ans int = 1
	for i := x - y; 0 < i; i-- {
		ans *= i
	}
	return ans
}

func max(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Max(float64(x[i]), float64(res)))
	}
	return res
}

func min(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Min(float64(x[i]), float64(res)))
	}
	return res
}
func pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }
func abs(x int) int    { return int(math.Abs(float64(x))) }
func floor(x int) int  { return int(math.Floor(float64(x))) }

type XY struct {
	x int
	y int
}

type SortBy [][]int

func (a SortBy) Len() int      { return len(a) }
func (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a SortBy) Less(i, j int) bool {
	return a[i][1] < a[j][1]
}


Measured memory_bytes: 3328
package main

import "fmt"

func PrimeFactors(n int)(pfs[]int) {
	for n % 2 == 0 {
		pfs = append(pfs,2)
		n = n / 2
	}

	for i := 3; i * i <= n; i += 2 {
		for n % i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}
func main() {
	var N int
	fmt.Scan(&N)
	ans := 1
	var pfs_number [1000]int
	for i := 2; i <= N; i++ {
		pfs := PrimeFactors(i)
		for _,v := range pfs {
			pfs_number[v - 1] += 1
		}
	}
	for _,v := range pfs_number {
		ans = ans * (v + 1) % 1000000007
	}
	fmt.Println(ans)
}

Measured memory_bytes: 640
// Multiple Clocks
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    int N;
    cin >>N;

    long long ans = 1;
    for(int i=0; i<N; i++){
        long long T;
        cin >> T;
        //最大公約数を求める
        long long a = max(ans,T);
        long long b = min(ans,T);
        long long mod = a % b;
        while(mod!=0){
            a = b;
            b = mod;
            mod = a % b;
        }
        //最大公倍数を求める
        ans = ans/b*T;

    }
    cout << ans << "\n";
    return 0;
}

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

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

// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) \
  cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3)                                               \
  cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << endl
#define debug_4(x1, x2, x3, x4)                                           \
  cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5)                                       \
  cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                      \
  CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
  (__VA_ARGS__)
#else
#define debug(...)
#endif

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

void Main() {
  string s;
  cin >> s;
  rep(i, s.size()) cout << 'x';
  cout << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


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

using namespace std;

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

    vector<long long> a(N, 0);
    vector<long long> b(N, 0);

    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }

    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            b[0] += a[i];
        } else {
            b[0] -= a[i];
        }
    }

    for (int i = 1; i < N; i++) {
        b[i] = 2 * a[i - 1] - b[i - 1];
    }

    for (int i = 0; i < N; i++) {
        cout << b[i] << " ";
    }

    cout << endl;

    return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;



int main(){
    double a,b,c,d,e,f;
    while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
        double x=(c*e-b*f)/(a*e-b*d);
        double y=(c-a*x)/b;
        
        if(abs(x)<1e-10){
            x=0;
        }
        if(abs(y)<1e-10){
            y=0;
        }
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

Measured memory_bytes: 3188
#include<iostream>
#include<cmath>

using namespace std;


unsigned long long lcm(unsigned long long x, unsigned long long y)
{
	unsigned long long a = x * y;

	if (x < y) {
		unsigned long long tmp = x;
		x = y;
		y = tmp;
  }

	unsigned long long r = x % y;
  	while (r!=0) {
		x = y;
		y = r;
		r = x % y;
	}
	return a / y;
}

int main()
{
  unsigned long long A, B, C, D;
  cin >> A >> B >> C >> D;

  unsigned long long all_num = B - A + 1;

  unsigned long long int C_num = (B / C) - ((A-1) / C);
  unsigned long long int D_num = (B / D) - ((A-1) / D);

  unsigned long long cd = lcm(C, D);

  long long int CD_num = (B / cd) - ((A-1) / cd);

  cout << all_num - C_num - D_num + CD_num << endl;

  return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long sum = 0;
            for (int i = 1; i <= n; i++) {
                if (i % 3 == 0 || i % 5 == 0) {
                    continue;
                }
                sum += i;
            }
            out.println(sum);
        }
    }

    private static void sort(double[] arr) {
        Double[] objArr = Arrays.stream(arr).boxed().toArray(Double[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(int[] arr) {
        Integer[] objArr = Arrays.stream(arr).boxed().toArray(Integer[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(long[] arr) {
        Long[] objArr = Arrays.stream(arr).boxed().toArray(Long[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task task = new Task();
        task.solve(1, in, out);
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null, () -> solve(), "1", 1 << 26).start();
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

}

Measured memory_bytes: 34024
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    m = I()
    print(48-m)
    return

#B
def B():
    return

#C
def C():
    n = I()
    a = LIR(n-1)
    for i in range(n):
        t = 0
        x = i
        while x < n-1:
            if t < a[x][1]:
                t = a[x][1]
            t += (a[x][2]-t)%a[x][2]
            t += a[x][0]
            x += 1
        print(t)

#D
def D():
    def check(n):
        if n == 1:
            return False
        i = 2
        while i*i <= n:
            if n%i == 0:
                return False
            i += 1
        return True
    f = [0 for i in range(100001)]
    for i in range(1,100001):
        f[i] += f[i-1]
        if check(i):
            if check((i+1)//2):
                f[i] += 1
    q = I()
    for i in range(q):
        l,r = LI()
        print(f[r]-f[l-1])

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 38768
#include<iostream>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
#define INF 1000000000

int main(){
	int n,m,flg;
	ll a,b,c;
	while(cin >> n >> m && n && m){
		vector<P> node[101];
		for(int k=0;k<m;k++){
			cin >> flg;
			if(flg){
				cin >> a >> b >> c;
				P p; p.first=b; p.second=c;
				node[a].push_back(p);
				p.first = a;
				node[b].push_back(p);
			}
			else {
				bool f = true;
				cin >> a >> b;
				ll used[102];
				used[a] = 0;
				for(int j=1;j<=n;j++) used[j] = INF;
				priority_queue<P, vector<P>, greater<P> > que;
				que.push(P(0,a));
				while(!que.empty()){
					P p = que.top(); que.pop();
					ll cost = p.first;
					ll now = p.second;
					if(now == b) {
						cout << cost << endl;
						f = false;
						break;
					}
					int len = node[now].size();
					for(int i=0;i<len;i++){
						P p = node[now][i];
						ll next = p.first;
						ll nc = p.second;
						if(used[next]==INF || used[next] > cost+nc){
							used[next] = cost+nc;
							que.push(P(cost+nc,next));
						}
					}
				}
				if(f) cout << "-1" << endl;
			}
		}
	}
}

Measured memory_bytes: 1268
#include <iostream>
#include <algorithm>
#include <typeinfo>
#include <numeric>
#include "math.h"
#include <string>
#include <vector>
#include <iomanip>

#define pai 3.14159265358979323846264338327950288
using namespace std;


//Next Prime
/*
int main() 
{



}


//*/





//Greedy Takahashi

//*
int main() 
{
	 long long int  a, b, k;
	 bool flag = false;

	cin >> a >> b >> k;

	
	if (a < k) 
	{
		k -= a;
		a = 0;

	}
	else
	{
		a -= k;
		cout << a << " " << b;
		return 0;
	}

	b -= k;
	if (b<0) 
	{
		b = 0;
	}




	cout << a << " " << b;
	return 0;

}

//*/



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 n, ans = 0, ver = 0;
  cin >> n;
  vector<int> vec(n);
  rep(i, n)
    cin >> vec.at(i);
  sort(vec.begin(), vec.end());
  rep(i, n)
    if (vec.at(i) > ver) {
      ans++;
      ver = vec.at(i);
    }
  cout << ans << endl;
}

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

using namespace std;

#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;

const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;

int X1[105], X2[105], Y1[105], Y2[105];
vi G[105];
bool D[105];
int M[105];

bool Aug(int u){
	if(D[u]) return 0;
	D[u] = 1;
	for(int v : G[u]){
		if(M[v] == -1 || Aug(M[v])){
			M[v] = u;
			return 1;
		}
	}
	return 0;
}

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

	int n;
	cin >> n;
	memset(M, -1, sizeof M);
	for(int i = 0; i < n; i++){
		cin >> X1[i] >> Y1[i];
	}
	for(int i = 0; i < n; i++){
		cin >> X2[i] >> Y2[i];
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(X1[i] < X2[j] && Y1[i] < Y2[j]){
				G[i].push_back(j);
			}
		}
	}
	int res = 0;
	for(int i = 0; i < n; i++){
		res += Aug(i);
		memset(D, 0, sizeof D);
	}
	cout << res;
}

Measured memory_bytes: 256
n,m=[int(i) for i in input().split(" ")]
c=sorted([int(i) for i in input().split(" ")])
c.pop(0)
table=[[0 for j in range(n+1)] for i in range(m)]
for j in range(n+1):
    table[0][j]=j
for i in range(1,m):
    for j in range(n+1):
        if j>=c[i-1]:
            table[i][j]=min(table[i-1][j],table[i-1][j-c[i-1]]+1,table[i][j-c[i-1]]+1)
        else:
            table[i][j]=table[i-1][j]

print(table[-1][-1])



Measured memory_bytes: 43500
# coding: utf-8
N = int(input())
for h in range(1, 3501)[::-1]:
    for n in range(1, 3501)[::-1]:
        if 4*h*n-N*(h+n) == 0:
            continue
        w = (N*(h*n)) / (4*h*n-N*(h+n))
        if w != int(w) or w <= 0:
            continue
        w = int(w)
        if 4/N == (n*w+h*w+h*n)/(h*n*w):# and 1 <= h <= 3500 and 1 <= n <= 3500 and 1 <= w <= 3500:
            print(h, n, w)
            exit()

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

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,n2=1,m,a[200010],b[200010],dat[800100],delta[800100],nxtr[200010],nxtc[200010],mx[200010];

void pushdown(int k)
{
	dat[k*2+1]=min(dat[k*2+1],delta[k]);
	delta[k*2+1]=min(delta[k*2+1],delta[k]);
	dat[k*2+2]=min(dat[k*2+2],delta[k]);
	delta[k*2+2]=min(delta[k*2+2],delta[k]);
	delta[k]=1e9;
}

void upd(int k,int lb,int ub,int tlb,int tub,int val)
{
	if(ub<tlb||tub<lb) return;
	if(tlb<=lb&&ub<=tub)
	{
		dat[k]=min(dat[k],val);
		delta[k]=min(delta[k],val);
		return;
	}
	pushdown(k);
	upd(k*2+1,lb,(lb+ub)/2,tlb,tub,val);
	upd(k*2+2,(lb+ub)/2+1,ub,tlb,tub,val);
	dat[k]=min(dat[k*2+1],dat[k*2+2]);
}

int query(int k,int lb,int ub,int tlb,int tub)
{
	if(ub<tlb||tub<lb) return 1e9;
	if(tlb<=lb&&ub<=tub) return dat[k];
	pushdown(k);
	return min(query(k*2+1,lb,(lb+ub)/2,tlb,tub),query(k*2+2,(lb+ub)/2+1,ub,tlb,tub));
}

int main()
{
	cin>>n>>m;
	rep(i,n)
	{
		scanf("%d%d",&a[i],&b[i]);
		a[i]--;
		b[i]--;
	}
	b[n]=m-1;
	n++;
	while(n2<m) n2*=2;
	rep(i,800005) dat[i]=n-1,delta[i]=1e9;
	for(int i=n-2;i>=0;i--)
	{
		if(b[i]==m-1) nxtr[i]=-1;
		else nxtr[i]=query(0,0,n2-1,b[i]+1,b[i]+1);
		upd(0,0,n2-1,a[i],b[i],i);
	}
	rep(i,m) nxtc[i]=query(0,0,n2-1,i,i);
	n2=1;
	while(n2<n) n2*=2;
	rep(i,800095) dat[i]=delta[i]=1e9;
	rep(i,200005) mx[i]=-1;
	rep(i,m)
	{
		upd(0,0,n2-1,1,nxtc[i],0);
		mx[nxtc[i]]=max(mx[nxtc[i]],i);
	}
	rep(i,n-1)
	{
		if(mx[i]==-1||b[i]==m-1) continue;
		upd(0,0,n2-1,i+1,nxtr[i],b[i]+1-mx[i]);
		mx[nxtr[i]]=max(mx[nxtr[i]],mx[i]);
	}
	repn(i,n-1)
	{
		int ans=query(0,0,n2-1,i,i);
		if(ans>1e8) puts("-1");
		else printf("%d\n",ans+i);
	}
	return 0;
}

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

int main() {
  int H,W;
  cin>>H>>W;
  vector<vector<char>> data(H+2, vector<char>(W+2));


  // 入力 (2重ループを用いる)
  for (int i = 0; i < H+2; i++) {
    for (int j = 0; j < W+2; j++) {
       data.at(i).at(j)='.';
    }
  }
  for (int i = 1; i < H+1; i++) {
    for (int j = 1; j < W+1; j++) {
      cin >> data.at(i).at(j);
    }
  }

  for(int i=1;i<H+1;i++){
    for(int j=1;j<W+1;j++){
      int c=0;
      if(data[i][j]=='#') cout<< '#';
      else {
        if(data[i-1][j-1]=='#') c++;
        if(data[i-1][j]=='#') c++;
        if(data[i-1][j+1]=='#') c++;
        if(data[i][j-1]=='#') c++;
        if(data[i][j+1]=='#') c++;
        if(data[i+1][j-1]=='#') c++;
        if(data[i+1][j]=='#') c++;
        if(data[i+1][j+1]=='#') c++;
        cout<< c;
      }
    }
    cout<<endl;
  }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define era(t) t.erase(unique(be(t)),t.end())
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,ans=-100000000,num=0;
    cin>>n;
    int v[n],c[n];
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    for(int bit=0;bit<(1<<n);bit++){
        for(int i=0;i<n;i++){
            if(bit&(1<<i)){
                num+=v[i];
                num-=c[i];
            }
        }
        ans=max(ans,num);
        num=0;
    }
    cout << ans<<endl;

    return 0;
}


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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    ll h,w,k;
    cin >> h >> w >> k;
    vector<string> c(h);
    for(i = 0;i < h;++i){
        cin >> c.at(i);
    }
    ll bit1,bit2;
    ll ans = 0;
    for(bit1 = 0;bit1 < (1 << h);++bit1){
        for(bit2 = 0;bit2 < (1 << w);++bit2){
            ll tmp = 0;
            for(i = 0;i < h;++i){
                rep(j,w){
                    if(!(bit1 & (1 << i)) && !(bit2 & (1 << j))){
                        if(c.at(i).at(j) == '#') ++tmp;
                    }
                }
            }
            if(tmp == k) ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3596
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var n = input[0];
            var k = input[1];

            var input1 = Console.ReadLine().Split().Select(int.Parse).ToArray();

            var prices = new List<int> { };
            for (int i = 0; i < n; i++)
                prices.Add(input1[i]);

            prices.Sort();

            int res = 0;

            for (int i = 0; i < k; i++)
                res += prices[i];

            Console.WriteLine(res);
        }

    }
}


Measured memory_bytes: 28676
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;
constexpr int64_t MOD = 1e9 + 7;

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

  int N;
  cin >> N;
  int a,b,c;
  a = N % 10;
  b = (N /10) % 10;
  c = (N / 100) % 10;
  if (a == 7 || b == 7 || c == 7) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }


  return 0;
}


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

int main() {
    int N;

    cin >> N;
    if(N >= 1800){
        cout << 1 << endl;
        return 0;
    }else if(N >=1600){
        cout << 2 << endl;
        return 0;
    }else if(N >=1400){
        cout << 3 << endl;
        return 0;
    }else if(N >=1200){
        cout << 4 << endl;
        return 0;
    }else if(N >=1000){
        cout << 5 << endl;
        return 0;
    }else if(N >=800){
        cout << 6 << endl;
        return 0;
    }else if(N >=600){
        cout << 7 << endl;
        return 0;
    }else if(N >=400){
        cout << 8 << endl;
        return 0;
    }

}


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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 1e6 + 5;
const ll inf = 1e18;




ll n, c;
ll h[maxn];
ll dp[maxn];


struct line {
    ll m, b;
    line(ll m, ll b) : m(m), b(b) {}
    ll eval(ll x) {
	return m*x + b;
    }
};

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

    cin>>n>>c;
    for (int i=0; i<n; i++) {
	cin>>h[i];
    }

    vector<line> lines;


    auto rid = [&](line last, line last2, line cur) {
	// last2 and cur intersect after last and cur, so last is useless
	ll num2 = last2.b-cur.b;
	ll den2 = cur.m-last2.m;
	ll num = last.b-cur.b;
	ll den = cur.m-last.m;

	if (num2*den > num*den2) {
	    return true;
	}

	return false;
    };

    auto add_line = [&](ll m, ll b) {
	line cur = {m, b};
	while ((int)lines.size() >= 2 && rid(lines.end()[-1], lines.end()[-2], cur)) {
	    lines.pop_back();
	}
	lines.push_back(cur);
    };


    auto qry_hull = [&](ll x) {
	if (lines.empty()) {
	    return inf;
	}
	int len = lines.size();
	int lo = -1;
	int hi = len-1;

	while (hi-lo>1) {
	    int mid = (hi+lo)/2;
	    assert(mid+1<len);
	    if (lines[mid].eval(x) <= lines[mid+1].eval(x)) {
		hi = mid;
	    } else {
		lo = mid;
	    }
	}
	ll res = inf;
	res = min(res, lines[hi].eval(x));
	if (hi-1>=0) res = min(res, lines[hi-1].eval(x));
	if (hi+1<len) res = min(res, lines[hi+1].eval(x));

	return res;
    };

    for (int i=0; i<n; i++) {
	if (i>0) {
	    dp[i] = h[i]*h[i] + c + qry_hull(h[i]);
	}
	add_line(-2LL*h[i], dp[i]+h[i]*h[i]);
    }

    

    cout<<dp[n-1]<<endl;
    return 0;
}


Measured memory_bytes: 10464
#include<bits/stdc++.h>
#define rep(i, x) for(int i = 0; i < (int)(x); i++)
#define reps(i, x) for(int i = 1; i <= (int)(x); i++)
#define UNIQUE(v) v..erase( unique(v.begin(), v.end()), v.end() );
#define Size(x) ((int)(x).size())
using namespace std;

int main(){
	int n;
	cin >> n;
	if(n % 2 == 0) cout << n << endl;
	else cout << n * 2 << endl;

	return 0;

}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    static class CExceptionHandling
    {
        static void Main(string[] args)
        {            
            var n = int.Parse(Console.ReadLine());
            var aList = new List<int>();
            int max = 0;
            int max2 = 0;
            int maxIndex = 0;
            for (int i = 0; i < n; i++)
            {
                int a = int.Parse(Console.ReadLine());
                aList.Add(a);

                if (max < a)
                {
                    max = a;
                    maxIndex = i;
                    continue;
                }
                if (max2 < a)
                {
                    max2 = a;
                    continue;
                }
            }

            for (int i = 0; i < n; i++)
            {
                Console.WriteLine(i == maxIndex ? max2 : max);
            }
            
            Console.ReadLine();
        }
    }
}

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

int main(){
  int i,j,n,t,in[2],max,min;
  cin >> t;
  for(i=0;i<t;i++){
    cin >> n;
    cin >> in[1];
    max = min = 0;
    for(j=1;j<n;j++){
      in[0] = in[1];
      cin >> in[1];
      if(in[1] > in[0]){
	if(max < in[1] - in[0]) max = in[1] - in[0];
      }
      else if(min == 0 || min < in[0] - in[1]) min = in[0] - in[1];
    }

    cout << max << " " << min << endl;
    
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String str = sc.next();
        int q = sc.nextInt();

        for(int i = 0; i < q; i++){
            String cmd = sc.next();

            if(cmd.equals("replace")){
                int a = sc.nextInt();
                int b = sc.nextInt();
                String p = sc.next();
                String replaced;
                if(a == 0 && b == str.length() - 1)
                   replaced = p;
                else if(a == 0)
                    replaced = p + str.substring(b + 1, str.length());
                else if(b == str.length() - 1)
                    replaced = str.substring(0, a) + p;
                else
                    replaced = str.substring(0, a) + p + str.substring(b + 1);
                str = replaced;
            }
            else if(cmd.equals("reverse")){
                int a = sc.nextInt();
                int b = sc.nextInt();
                char[] reversed = new char[str.length()];
                for(int j = 0; j < a; j++)
                    reversed[j] = str.charAt(j);
                for(int j = a; j <= b; j++)
                    reversed[j] = str.charAt(b - (j - a));
                for(int j = b + 1; j < str.length(); j++)
                    reversed[j] = str.charAt(j);
                str = String.valueOf(reversed);
            }
            else{
                int a = sc.nextInt();
                int b = sc.nextInt();
                System.out.println(str.substring(a, b + 1));
            }
        }
        sc.close();
    }
}



Measured memory_bytes: 29708
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <queue>
#include <cmath>
#include <cfloat>
#include <set>
#include <map>

// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(int, H, W);
	VEC(string, a, H);
	vector< int > h, w;
	REP(hi, H) {
		bool ok = true;
		REP(wi, W) {
			ok &= a[hi][wi] == '.';
		}
		if (ok) h.push_back(hi);
	}
	REP(wi, W) {
		bool ok = true;
		REP(hi, H) {
			ok &= a[hi][wi] == '.';
		}
		if (ok) w.push_back(wi);
	}

	REP(hi, H) {
		bool ng = false;
		REP(hj, h.size()) {
			ng |= (h[hj] == hi); 
		}
		if (ng) continue;
		REP(wi, W) {
			bool nng = false;
			REP(wj, w.size()) {
				nng |= (w[wj] == wi);
			}
			if (nng) continue;
			OUT(a[hi][wi]);
		}
		BR;
	}
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	while(1){
	int a,b,p;
	char op;
	scanf("%d %c %d",&a,&op,&b);
	switch(op){
		case '+':
			p=a+b;
			break;
		case '-':
			p=a-b;
			break;			
		case '*':
			p=a*b;
			break;		
		case '/':
			p=a/b;
			break;			
		case '?':
			return 0;
	}
	
	
	printf("%d\n",p);
	
	}
}

Measured memory_bytes: 600
'use strict'

function main(s) {

  const c = s.split('\n')[0];
  const set = new Set(['a', 'e', 'i', 'o', 'u'])

  const ans = (set.has(c)) ? 'vowel' : 'consonant';

  console.log(ans);
}

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


Measured memory_bytes: 7372
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i + 2 < n; ++i) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG

#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

#include <cmath>

#define int long long

using namespace std;

signed main() {
  int n;
  cin >> n;
  vector<int> h(n);

  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }

  int ans = 0;
  int temp = 0;

  for (int i = 0; i < n - 1; i++) {
    if (h[i] < h[i + 1]) {
      ans = max(ans, temp);
      temp = 0;
    } else {
      temp++;
    }
  }

  ans = max(ans, temp);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
import math
A = math.radians(90)
aD = 90
x = y = 0
while 1:
    user = input().split(",")
    r = int(user[0])
    if r == 0 and int(user[1]) == 0:
        break
    x += r * math.cos(A)
    y += r * math.sin(A)
    aD -= int(user[1])
    A = math.radians(aD)
print(int(x))
print(int(y))

Measured memory_bytes: 7848