akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int n,m;

const long long int mod = 1000000007;

long long int x[100001];
long long int y[100001];

int main(){

    cin >> n >> m;

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

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

    long long int sum_x = 0,sum_y = 0;

    int count = 0;

    long long int coefficient = -1*n;

    coefficient++;
    

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

        sum_x += coefficient * x[i];

        coefficient += 2;

    }

    sum_x %= mod;

    coefficient = -1*m;

    coefficient++;

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

        sum_y += coefficient * y[i];

        coefficient += 2;

    }

    sum_y %= mod;

    cout << (sum_x * sum_y) % mod << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define pb push_back
#define REP(i, n) for (signed long long i = 0; i < (n); i++)
#define MOD 998244353
#define INF 93193111451418101
#define bitcnt(a) (ll) __builtin_popcount((a))
#define lb(a, b) lower_bound((a).begin(), (a).end(), (b))
#define ub(a, b) upper_bound((a).begin(), (a).end(), (b))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a >= c) {
    return !printf("%d\n", 0);
  }
  if (a + b < c) {
    return !printf("NA\n");
  }
  cout << c - a << endl;
}



Measured memory_bytes: 3220
import Control.Monad

solve :: [Int] -> (Int, Int, Int) -> (Int, Int, Int) -> Int
solve [] (a,b,c) (x,y,z)
    | a `min` b `min` c == 0 = 10^9+7
    | otherwise = (abs $ a-x) + (abs $ b-y) + (abs $ c-z) - 30
solve (l:ls) (a,b,c) (x,y,z) = s1 `min` s2 `min` s3 `min` s4
    where
        s1 = (solve ls (a,b,c) (x,y,z))
        s2 = (solve ls (a+l,b,c) (x,y,z)) + 10
        s3 = (solve ls (a,b+l,c) (x,y,z)) + 10
        s4 = (solve ls (a,b,c+l) (x,y,z)) + 10

main = do 
    [n,a,b,c] <- map read . words <$> getLine :: IO [Int]
    xs <- replicateM n readLn :: IO [Int]
    print $ solve xs (0,0,0) (a,b,c)

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

using namespace std;
#define IOS cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

using ll = long long;
using ld = long double;


// dp[i][j] = longest common subsequence in 1...i and 1...j


int dp[3005][3005];

int main(){
    IOS

    string s, t;
    cin>>s>>t;

    int n = s.length(), m = t.length();

    memset(dp, 0 , sizeof dp);

    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            if(s[i-1] == t[j-1]){
                dp[i][j] = dp[i-1][j-1] + 1;
            }else{
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    // for(int i = 0; i <=n; i++){
    //     for(int j = 0; j <= m; j++){
    //         cout<<dp[i][j]<<" ";
    //     }cout<<endl;
    // }


    stack<char> ans;

    
    int i = n, j = m;

    while(i > 0 && j > 0){
        if(s[i-1] == t[j-1]){
            ans.push(s[i-1]);
            i--, j--;
        }else if(dp[i-1][j] > dp[i][j-1])
            i--;
        else
            j--;
    }

    while(!ans.empty()){
        cout<<ans.top();
        ans.pop();
    }

    cout<<endl;

        
    




}


Measured memory_bytes: 35584
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
signed main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    sort(all(a));
    reverse(all(a));
    int x = 0, y = 0;
    rep(i, a.size()) {
        if (i % 2 == 0) {
            x += a[i];
        }
        else {
            y += a[i];
        }
    }
    put(x - y);
    return 0;
}

Measured memory_bytes: 3520
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define int long long int
#define pb push_back
#define fi first
#define se second
#define fr(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define IO ios :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pii pair<int,int>
const int mod = 1e9 + 7;
const int mod1 = 998244353;
typedef long double f80;
#ifndef LOCAL
#define endl '\n'
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
const int N = 55;
int tot[N], pat[N];
int solve(int n, int &k){
    if(tot[n] <= k){
        k -= tot[n];
        return pat[n];
    }
    int ans = 0;
    if(k)
        k--;
    if(k)
        ans += solve(n - 1, k);
    if(k)
        ans++, k--;
    if(k)
        ans += solve(n - 1, k);
    return ans;
}
void solve(){
    int n, k;
    cin >> n >> k;
    tot[0] = 1, pat[0] = 1;
    fr(i, 1, n){
        tot[i] = 2 * tot[i - 1] + 3;
        pat[i] = 2 * pat[i - 1] + 1;
    }
    cout << solve(n, k) << endl;
}
signed main()
{
    IO;
    #ifdef LOCAL
        freopen("inp.txt", "r", stdin);
        // freopen("out.txt", "w", stdout);
    #endif
    clock_t clk = clock();
    int t = 1;
    // cin >> t;
    fr(i, 1, t){
        solve();
    }
    cerr << endl << setprecision(10) << fixed << (double)(clock() - clk) / CLOCKS_PER_SEC;
    return 0;
};

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

int main(){
    string s,ans;
    cin >> s;
    int sss;

    for(int i = 0;i < s.size();i++){
        if(s.at(i) == '0' || s.at(i) == '1')
            ans += s.at(i);
        else{
            if(ans.size() > 0)
                ans.erase(ans.end() -1,ans.end());
        }
             
    }

    cout << ans << endl;

    
}

Measured memory_bytes: 3616
#include <stdio.h>
#include <math.h>

int main(void){
    int N;
    int a[1001];
    double p;
    double q;
    int k;
    int l;
    
    scanf("%d",&N);
    
    for(int i=0;i<N;i++){
        scanf("%d",&a[i]);
    }
    
    for(int j=0;j<N-1;j++){
        for(int i=0;i<N-1;i++){
            if(a[i]>=a[i+1]){
                k=a[i+1];
                l=a[i];
                a[i]=k;
                a[i+1]=l;
            }
        }
    }
    
    double s=a[0];
    double t;
    
    for(int i=1;i<=N-1;i++){
        p=i-1;
        s=s+a[i]*pow(2,p);
    }
    q=N-1;
    t=s/(pow(2,q));
    printf("%lf",t);
}



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

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int h, w;
  cin >> h >> w;
  vector<vector<char> > s(h+2, vector<char>(w+2));  
  rep(i, 0, h+2) {
    rep(j, 0, w+2) {
      if(i==0 or j==0 or i==h+1 or j==w+1)
        s[i][j] = '^';
      else
        cin >> s[i][j];
    }
  }
  
  rep(i, 1, h+1) {
    rep(j, 1, w+1) {
      if(s[i][j] == '.') {
        int cnt = 0;
        
        if(s[i][j+1] == '#') cnt++;
        if(s[i+1][j+1] == '#') cnt++;
        if(s[i-1][j+1] == '#') cnt++;
        if(s[i][j-1] == '#') cnt++;
        if(s[i+1][j-1] == '#') cnt++;
        if(s[i-1][j-1] == '#') cnt++;
        if(s[i+1][j] == '#') cnt++;
        if(s[i-1][j] == '#') cnt++;
        
        s[i][j] = ('0'+cnt); 
      }
    }
  }
  
  rep(i, 1, h+1) {
    rep(j, 1, w+1) {
      cout << s[i][j];
    }
    cout << "\n";
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <stdio.h>
#include <vector>
#include <time.h>
#include <iomanip>
#include <thread>
#include <atomic>
#include <mutex>
#include <future>
#define double long double
#define int long long
#define low lower_bound
#define upp upper_bound
#define mod 1000000007 //10^9+7
#define inf 10000000000000000 //10^16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
#define cend cout<<endl;
using namespace std;

signed main() {
	int n;
	cin >> n;
	int h[22];
	int cnt = 0;
	rep(i, n) cin >> h[i];
	rep(i, n) {
		bool can = true;
		rep(j, i) {
			if (!(h[j] <= h[i])) can = false;
		}
		if (can) cnt++;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
# define pb push_back
# define ll long long
# define fi first
# define se second
# define all(vc) vc.begin(),vc.end()
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
# define DEBUG

using namespace std;

const int N = 1e5 + 7;
const int mod = 1e9 + 7;

int n, a[N];

int main()
{
    speed;
    /// Author: Dilshod--Imomov
    #ifdef DEBUGd
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif // DEBUG
    cin >> n;
    for ( int i = 0; i < n; i++ ) {
        cin >> a[i];
    }
    reverse(a, a + n);
    for ( int i = 1; i < n; i++ ) {
        if ( a[i] <= a[i - 1] ) continue;
        a[i]--;
        if ( a[i] > a[i - 1] ) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}



Measured memory_bytes: 640
#include <stdio.h>

#define N 1001
#define INF 1000
#define BLACK 1
#define WHITE 0
int n, color[N][N];
int d[N], t;
int Q[2*N], head=0, back=0;

void enqueue(int x){
    Q[back++] = x;
}
int dequeue(){
    int x;
    x = Q[head++];
    return x;
}
void dfs(int s){
    int i, u, v;
    enqueue(s);
    for(i = 1; i <= n; i++) d[i] = INF;
    d[s] = 0;
    while(head != back){
        u = dequeue();
        for(v = 1; v <= n; v++){
            if(color[u][v] == 0) continue;
            if(d[v] != INF) continue;
            d[v] = d[u] + 1;
            enqueue(v);
        }
    }
}

int main(){
    int u, k, v, i, j;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        for(j = 1; j <= n; j++){
            color[i][j] = WHITE;
        }
    }
    for(i = 0; i < n; i++){
        scanf("%d %d",&u, &k);
        for(j = 0; j < k; j++){
            scanf("%d",&v);
            color[u][v] = BLACK;
        }
    }
    dfs(1);
    for(i = 1; i <= n; i++){
        if(d[i] == INF) d[i] = -1;
        printf("%d %d\n",i, d[i]);
    }
    return 0;
}

Measured memory_bytes: 992
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto s = readln.chomp;
    size_t i, j = s.length-1;
    int c;
    while (j > i) {
        if (s[i] == s[j]) {
            ++i; --j;
        } else if (s[i] == 'x') {
            ++i; ++c;
        } else if (s[j] == 'x') {
            --j; ++c;
        } else {
            writeln(-1);
            return;
        }
    }
    writeln(c);
}

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

typedef long long ll;
using namespace std;
 
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;
 
 
#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010
 
 
int main(){
  int x, y;
 
  cin >> x >> y;
 
  cout << x + y / 2 << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
const int MAX_N=2e5;
int N;
ll T;
int main(){
	cin>>N>>T;
	ll pret=0,ans=0;
	REP(i,N){
		ll t;
		cin>>t;
		if (t<pret){
			ans+=t+T-pret;
		}else{
			ans+=T;
		}
		pret=t+T;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int w;
	while (cin >> w) {
		for (int i = 0; w != 0; i++) {
			if (w % 2 == 1) {
				cout << pow(2, i);
				w /= 2;
				if (w != 0)
					cout << ' ';
			}
			else
				w /= 2;
		}
		cout << endl;
	}
}


Measured memory_bytes: 3288
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

struct F {
  ll X, a, b, c;
  ll upper() { return a + (c - b); }
  F down(ll t) {
    ll rem = a;
    ll over = max(0ll, t - rem);
    ll na = max(0ll, a - t);
    ll nb = min(c, b + over);
    ll nc = c;
    return {X, na, nb, nc};
  }
  F up(ll t) {
    ll rem = X - upper();
    ll over = max(0ll, t - rem);
    ll na = min(X, a + t);
    ll nb = b;
    ll nc = max(b, c - over);
    return {X, na, nb, nc};
  }
  ll at(ll x) {
    if (x <= b) {
      return a;
    }
    if (x <= c) {
      return a + (x - b);
    }
    return upper();
  }
};

int main() {
  ll X;
  int K;
  while (cin >> X >> K) {
    ++K;
    vector<ll> r(K, 0ll);
    for (int i = 1; i < K; i++) {
      cin >> r[i];
    }
    vector<F> fs(K);
    fs[0] = {X, 0ll, 0ll, X};
    for (int i = 1; i < K; i++) {
      ll dr = r[i] - r[i - 1];
      if (i % 2 == 1) {
        fs[i] = fs[i - 1].down(dr);
      } else {
        fs[i] = fs[i - 1].up(dr);
      }
    }
    int Q;
    cin >> Q;
    int k = 0;
    for (int q = 0, k = 0; q < Q; q++) {
      ll t, a;
      cin >> t >> a;
      while (k + 1 < K && r[k + 1] <= t) {
        ++k;
      }
      ll p = fs[k].at(a);
      ll dt = t - r[k];
      ll ans;
      if (k % 2 == 0) {
        ans = max(0ll, p - dt);
      } else {
        ans = min(X, p + dt);
      }
      cout << ans << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 5120
#include<stdio.h>
#define N 10000

int check(int a[],int x,int n){
	for(int i=0;i<n;i++){
		if(a[i]==x)return 1;
	}
	return 0;
}

int main(){
	int n,i,q,x;
	int a[N];
	int cnt=0;
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	
	scanf("%d",&q);
	
	for(i=0;i<q;i++){
		scanf("%d",&x);
		cnt+=check(a,x,n);
	}
	
	printf("%d\n",cnt);
	
	return 0;
	
}


Measured memory_bytes: 2144
#include <iostream>
using namespace std;
int main(){
	int a;
    cin >> a;
    int b;
    cin >> b;  
    int min;
    int max;
    min = a;
    max = b;
  if( min > b ) {
    min = b;
  }
  if(max < a) {
    max = a;
  }
  for (int i = 0; i < max; i++) {
    cout << min;
}
	return 0;
}


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

class Dice{
    public:
    int face[6];
    Dice(int *x){
    for(int i=0;i<6;i++){
        face[i]=x[i];
    }
    }
void roll_N(){
    int a=face[0],b=face[1],c=face[5],d=face[4];
    face[0]=b;face[1]=c;face[5]=d;face[4]=a;
}
void roll_W(){
    int a=face[0],b=face[2],c=face[5],d=face[3];
    face[0]=b;face[2]=c;face[5]=d;face[3]=a;
}
void roll_S(){
    int a=face[0],b=face[4],c=face[5],d=face[1];
    face[0]=b;face[4]=c;face[5]=d;face[1]=a;
}
void roll_E(){
    int a=face[0],b=face[3],c=face[5],d=face[2];
    face[0]=b;face[3]=c;face[5]=d;face[2]=a;
}
void roll_(){
    int a=face[1],b=face[2],c=face[4],d=face[3];
    face[1]=d;face[2]=a;face[4]=b;face[3]=c;
}
int answer(){
    return face[0];
}
};

int main(){
    int x[6],q;
    for(int i=0;i<6;i++)cin>>x[i];
    cin>>q;
    Dice d(x);
    int x1,x2;
    for(int i=0;i<q;i++){
        cin>>x1>>x2;
        int j=0;
        while(d.face[0]!=x1 && j<4){d.roll_N();j++;}
        if(d.face[0]!=x1){while(d.face[0]!=x1){d.roll_W();}}
        while(d.face[1]!=x2){d.roll_();}
        cout<<d.face[2]<<endl;
        }
    return 0;
}


Measured memory_bytes: 3004
N, M = map(int, input().split())
a_b_l = []
for _ in range(M):
    a_b_l.append(list(map(int, input().split())))

a_b_l = sorted(a_b_l, key=lambda x: x[1])
ans = 0
prev_removed_bridge = 0
for a, b in a_b_l:
    if a <= prev_removed_bridge:
        continue
    prev_removed_bridge = b - 1
    ans += 1
print(ans)


Measured memory_bytes: 29456
#include <iostream>
using namespace std;
int n,a[100],b[100],dp[100][100];
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
    }
    for(int i=0;i<100;i++){
        for(int j=0;j<100;j++){
            if(i!=j)dp[i][j]=1e9;
        }
    }
    for(int j=1;j<n;j++){
        for(int i=0;i+j<n;i++){
            for(int k=i;k<i+j;k++){
                dp[i][i+j]=min(dp[i][i+j],dp[i][k]+dp[k+1][i+j]+a[i]*b[i+j]*b[k]);
            }
        }
    }
    cout<<dp[0][n-1]<<endl;
}



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

int main(void) {
  int cnt[100] = {}, num[100] = {}, pos = -1;
  long long k;
  string s;
  cin >> s >> k;
  k--;
  
  for (int i = 0; i < s.size(); i++) {
    if (s[i] - '0' > 1) {
      pos = i;
      break;
    }
  }
  
  if (pos != -1) {
    if (k < pos)
      cout << 1 << endl;
    else
      cout << s[pos] << endl;
  }
  else
    cout << 1 << endl;
}


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

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

//dp[i][j] i:前3つのstring, j:n桁目,dp[i][j]個数
map<string,map<lli,lli>> dp;

bool isjudge(string last4){
	REP(i,0,4){
		string t = last4;
		if(i!=0)swap(t[i-1],t[i]);
		if(t.find("AGC") != string::npos){
			return false;
		}
	}
	return true;
}

signed main(){

	dp["TTT"][0]=1;

	string d[4]={"A","G","C","T"};

	lli n;
	cin>>n;

	REP(i,0,n){
	REP(j,0,4)REP(k,0,4)REP(l,0,4){
		string last3 = d[j]+d[k]+d[l];
		REP(m,0,4){
			string next4 = last3+d[m];
			if(!isjudge(next4))continue;
			dp[next4.substr(1)][i+1] += dp[last3][i];
			dp[next4.substr(1)][i+1] %= MOD;
		}
	}
	}
	lli ans = 0;
	REP(j,0,4)REP(k,0,4)REP(l,0,4){
		string last3 = d[j]+d[k]+d[l];
		ans += dp[last3][n];
		ans %= MOD;
	}
	cout<<ans%MOD<<endl;
	return 0;
}

Measured memory_bytes: 768
import math


N = int(input())
p=list(map(int, input().split()))
q=list(map(int, input().split()))

L = []
for i in range(N):
    L.append(math.factorial(N - i -1))



def return_num(numList):

    Flag = []
    for j in range(N):
        Flag.append(1)

    M = 0
    for k in range(N):
        # Flagの1を消去
        Flag[numList[k] - 1] = 0
        M += sum(Flag[:numList[k]-1]) * L[k]


    return M+1



print(abs(return_num(p)-return_num(q)))


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

const int MAX_N = 1000;
vector<vector<int> > G(MAX_N*(MAX_N-1)/2 + 1);
vector<int> dis(MAX_N*(MAX_N-1)/2 + 1, -1);
vector<bool> start(MAX_N*(MAX_N-1)/2 + 1, false);
vector<bool> done(MAX_N*(MAX_N-1)/2 + 1, false);

int dfs(int obj) {
    if (start[obj]) {
        if (!done[obj]) return -1;
        return dis[obj];
    } else {
        start[obj] = true;
        int k = 0;
        for (int x : G[obj]) {
            int l = dfs(x);
            if (l == -1) return -1;
            else k = max(k, l);
        }
        done[obj] = true;
        dis[obj] = k + 1;
        return dis[obj];
    }
}

int main() {
    int N; cin >> N;
    for (int i = 1; i <= N; i++) {
        int a; cin >> a;
        int k = (max(a, i)-1)*(max(a, i)-2)/2 + min(a, i);
        for (int j = 0; j < N-2; j++) {
            int a; cin >> a;
            int l = (max(a, i)-1)*(max(a, i)-2)/2 + min(a, i);
            G[k].push_back(l);
            k = l;
        }
    }
    int k = 0;
    for (int i = 1; i <= N*(N-1)/2; i++) {
        if (dfs(i) == -1) {
            k = -1;
            break;
        } else {
            k = max(k, dfs(i));
        }
    }
    cout << k << endl;
}


Measured memory_bytes: 29824
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<math.h>
#define rad(i) (i/180)*M_PI
typedef struct {
	double x;
	double y;
}koch;

int KochCurve(int, koch, koch);

int main() {
	int n;
	koch p1, p2;
	p1.x = p1.y = p2.y = 0.0;
	p2.x = 100.0;
	scanf("%d", &n);
	printf("%lf %lf\n", p1.x, p1.y);
	KochCurve(n,p1,p2);
	printf("%lf %lf\n", p2.x, p2.y);
	return 0;
}

int KochCurve(int n, koch p1, koch p2) {
	double d;
	koch s, u, t;
	d = p2.x - p1.x;
	if (n == 0) return 0;
	s.x = (2.0*p1.x + p2.x) / 3.0;
	s.y = (2.0*p1.y + p2.y) / 3.0;
	t.x = (p1.x + 2.0* p2.x) / 3.0;
	t.y = (p1.y + 2.0* p2.y) / 3.0;
	u.x = (t.x - s.x)*cos(M_PI / 3.0) - (t.y - s.y)*sin(M_PI / 3.0) + s.x;
	u.y = (t.x - s.x)*sin(M_PI / 3.0) + (t.y - s.y)*cos(M_PI / 3.0) + s.y;
	KochCurve(n-1, p1, s);
	printf("%lf %lf\n", s.x, s.y);
	KochCurve(n - 1, s, u);
	printf("%lf %lf\n", u.x, u.y);
	KochCurve(n - 1, u, t);
	printf("%lf %lf\n", t.x, t.y);
	KochCurve(n - 1, t, p2);
}

Measured memory_bytes: 636
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long
using namespace std;
int main(){ 
  int k,n;
  cin >>k>>n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    int a;
    cin >>a;
    vec[i]=a;
  }
  vector<int> length(n);
  for(int i=0;i<n-1;i++){
    length[i]=vec[i+1]-vec[i];
  }
  length[n-1]=k+vec[0]-vec[n-1];
  sort (length.begin(),length.end());
    cout <<k-length[n-1]<<endl;
}
    

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int main(){
	int n,x,y;
	cin>>n>>x>>y;
	int count[n+1];
	memset(count,0,sizeof(count));
	for(int i=1;i<=n;i++){
	for(int j=i;j<=n;j++){
		count[min({abs(j-i),abs(abs(i-x)+1+abs(j-y)),abs(abs(j-x)+1+abs(i-y))})]++;
		}	
		}
		for(int i=1;i<n;i++){
			cout<<count[i]<<"\n";
			}
	return 0;
	}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,k,i;
    bool ans=false;
    cin>>a>>b>>c>>k;
    for(i=0; i<k; i++)
    {
        if(b<=a)
            b*=2;
        else if(c<=b&&b>a)
            c*=2;
    }
    if(a<b&&b<c)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}



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

int main()
{
  double x,y,x1,y1;
  cin>>x>>y>>x1>>y1;
  printf("%.8f\n",sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y)));
  return 0;
}

Measured memory_bytes: 1236
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n,m,x,y;
  cin>>n>>m>>x>>y;
  int ma=-100;
  int mi=100;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    ma=max(ma,a);
  }
  for(int i=0;i<m;i++){
    int a;
    cin>>a;
    mi=min(mi,a);
  }
  bool flag=0;
  //if(x>=y) flag=1;
  if(ma>=mi) flag=1;

  if(ma>x&&mi<=y);
  else flag=1;

  if(flag) cout<<"War"<<endl;
  else cout<<"No War"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

int n,kk;
int v[51];

long long solve(int r,int l,int back){
	if(r+l > n) return -1;
	if(r+l < back) return -1;
	if(r+l+back > kk) return -1;
	int tmp[55];
	int cnt = 0;
	for(int i=0;i<r;i++) tmp[cnt++] = v[i];
	for(int i=0;i<l;i++) tmp[cnt++] = v[n-i-1];
	sort(tmp,tmp+cnt);
	long long ret =0;
	for(int i=back;i<cnt;i++) ret += (long long)tmp[i];
	return ret;
}

int main(){
	cin>>n>>kk;
	for(int i=0;i<n;i++)cin>>v[i];

	long long ans =0;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			for(int k=0;k<=n;k++){
				ans = max(ans,solve(i,j,k));
			}
		}
	}
	cout<<ans<<endl;
	return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;

int main(){
	fast_io();
	int n,k;
	cin >> n;
	vector<int> v(n);
	cu(i,0,n)cin >> v[i];
	vector<int> in(n);	
	cu(i,0,n)in[i] = v[i] - (i + 1);
	sort(all(in));
	int start = in[n/2];
	ll ans = 0;
	cu(i,0,n)ans += abs(v[i] - (start + i + 1));
	cout << ans << endl;
}



Measured memory_bytes: 1792
#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);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  int c = 0;
  for(int i = 1;i < n;++i) {
    if(vec.at(i - 1) > vec.at(i)) {
      ++c;
    }
  }
  cout << c+1 << endl;
}


Measured memory_bytes: 3616
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		List<Long> list = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			list.add(sc.nextLong());
		}

		long prevH = list.get(n-1);
		boolean isSuccess = true;
		for (int i = n-1; i > 0; i--) {
			long currentH = list.get(i-1);
			// System.out.println("currentH " + currentH);
			// System.out.println("prevH " + prevH);

			if(currentH -  prevH > 1){
				isSuccess = false;
				break;
			}

			if(currentH -  prevH ==1){
				currentH--;
			}
			prevH = currentH;
		}

		System.out.print(isSuccess?"Yes":"No");
			
	}

}


Measured memory_bytes: 60316
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

N = I()
xyh = []
for i in range(N):
    x, y, h = LI()
    xyh.append([x,y,h])


for i in range(100+1):
    for j in range(100+1):
        cx, cy = i, j
        H = []
        for item in xyh:
            #  print(item)
            if item[2] == 0:
                continue

            new_H = max(item[2] + abs(item[0] - cx) + abs(item[1] - cy), 0)
            H.append(new_H)
        else:
            if len(set(H)) == 1:
                center_H = H[0]
                H = []
                for item in xyh:
                    if item[2] == 0:
                        # 0の場合にも正しいか判定する
                        # 中央の高さ
                        if center_H - abs(item[0] - cx) - abs(item[1] - cy) > 0:
                        #  if ch < center_H:
                            break
                else:
                    print(i, j, center_H)
                    exit()


Measured memory_bytes: 68968
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int n, m, ans = inf;
string s[51];

int main() {

	cin >> n >> m;
	rep(i, n) cin >> s[i];

	rep(i, n - 2) {
		int cnt = 0;
		int tmp = 0;
		while (tmp <= i) {
			rep(j, m) {
				if (s[tmp][j] != 'W')cnt++;
			}
			tmp++;
		}
		REP(j, i + 1, n - 1) {
			int cnt2 = cnt;
			tmp = i + 1;
			while (tmp <= j) {
				rep(k, m) {
					if (s[tmp][k] != 'B')cnt2++;
				}
				tmp++;
			}
			while (tmp < n) {
				rep(l, m) {
					if (s[tmp][l] != 'R')cnt2++;
				}
				tmp++;
			}
			ans = min(ans, cnt2);
		}
	}

	cout << ans << endl;

	return 0;
}


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

bool field[1000][1000];
bool res[500][500];
int c, n;

void change(int y, int x) {
  field[y][x] = !field[y][x];
}

pair<int, int> init(int y, int x) {
  int t = n - 1;
  if (y >= n / 2 && x >= n / 2) {
    return make_pair(t - y, t - x);
  }
  if (y >= n / 2) {
    return make_pair(t - y, x);
  }
  if (x >= n / 2) {
    return make_pair(y, t - x);
  }
  return make_pair(y, x);
}

bool same(int yy, int xx) {
  int y, x;
  tie(y, x) = init(yy, xx);
  int res = 0;
  int t = n - 1;
  res += field[y][x];
  res += field[t - y][x];
  res += field[y][t - x];
  res += field[t - y][t - x];
  return res == 4 || res == 0;
}

int main() {
  int cnt = 0;
  cin >> c >> n;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%1d", &field[i][j]);
    }
  }

  for (int i = 0; i < n / 2; ++i) {
    for (int j = 0; j < n / 2; ++j) {
      res[i][j] = same(i, j);
      cnt += res[i][j];
    }
  }

  int ans = 0;
  if (cnt == (n / 2) * (n / 2)) ans++;
  for (int i = 0; i < c - 1; ++i) {
    int q, y[100], x[100];
    cin >> q;
    for (int j = 0; j < q; ++j) {
      cin >> y[j] >> x[j];
      y[j]--; x[j]--;
      change(y[j], x[j]);
    }
    for (int j = 0; j < q; ++j) {
      bool ret = same(y[j], x[j]);
      tie(y[j], x[j]) = init(y[j], x[j]);
      if (ret && !res[y[j]][x[j]]) {
        cnt++;
        res[y[j]][x[j]] = ret;
      } else if (!ret && res[y[j]][x[j]]) {
        cnt--;
        res[y[j]][x[j]] = ret;
      }
    }
    if (cnt == (n / 2) * (n / 2)) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4376
#include <bits/stdc++.h>
#define fio ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
using namespace std;
const int N = 1007;
const int inf = 1e9 + 7;
bool a[N][N];
int dp[N][N];
int w, h;

int dio(){
    dp[h - 1][w - 1] = 1;
    for (int i = h - 1; i >= 0; i--){
        for (int j = w - 1; j >= 0; j--){
            if (!a[i][j]){
                dp[i][j] = 0;
            }else{
                if ((i != h - 1) || (j != w - 1)){
                    dp[i][j] = ((dp[i + 1][j] % inf) + (dp[i][j + 1] % inf)) % inf;
                }
            }
        }
    }
    return dp[0][0];
}

int main(){
    ///preprocessing
    #ifndef ONLINE_JUDGE
    freopen("test.inp", "r", stdin);
    #endif // ONLINE_JUDGE
    fio;
    ///code below
    cin >> h >> w;
    for (int i = 0; i < h; i++){
        for (int j = 0; j < w; j++){
            char t;
            cin >> t;
            if (t == '.'){
                a[i][j] = true;
            }else{
                a[i][j] = false;
            }
        }
    }
    cout << dio();
}


Measured memory_bytes: 8472
#include <bits/stdc++.h>
using namespace std;
#define MAX 100000
#define NIL -1

int n;
vector<int> G[MAX];
int color[MAX];

void dfs(int r, int c) {
  stack<int> S;
  S.push(r);
  color[r] = c;
  while (!S.empty()) {
    int u = S.top(); S.pop();
    for (int i =0;i<G[u].size(); i++) {
      int v = G[u][i];
      if ( color[v] == NIL) {
        color[v] = c;
        S.push(v);
      }
    }
  }
}

void assignColor() {
  int id = 1;
  for ( int i =0; i < n; i++) color[i] = NIL;
  for ( int u = 0; u < n; u ++) {
    if (color[u] == NIL) dfs(u,id++);
  }
}


int main(){
	int s, t, m, q;

  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }
  assignColor();

  cin >> q;

  for(int i=0;i<q;i++) {
    cin >> s >> t;
    if( color[s] == color[t]){
      cout << "yes" << endl;
    } else {
      cout << "no" << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 8916
n = int(input())
s = [input() for c in range(n)]

m = s.count('AC')

print(f"AC x {m}")

m = s.count('WA')

print(f"WA x {m}")

m = s.count('TLE')

print(f"TLE x {m}")

m = s.count('RE')

print(f"RE x {m}")


Measured memory_bytes: 16288
#include<bits/stdc++.h>
using Int = uint64_t;
using namespace std;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
string ans;
int main(){
  //  cout << alpha.size() << endl;
    Int N; cin >> N;
    while(N){
        --N; ans.push_back(alpha[N % 26]);
        N /= 26;
    }
    reverse(ans.begin(),ans.end());
    cout << ans << endl;
}



Measured memory_bytes: 3636
#include <stdio.h>
#include <string.h>

int main(void)
{
    int target[101][3];
    int N;
    int X, Y, Z;
    int a;
    int i;
    int count;
    
    scanf("%d", &N);
    
    memset(target, 0, sizeof(target));
    scanf("%d", &X);
    for (i = 0; i < X; i++){
        scanf("%d", &a);
        target[a][0] = 1;
    }
    scanf("%d", &Y);
    for (i = 0; i < Y; i++){
        scanf("%d", &a);
        target[a][1] = 1;
    }
    scanf("%d", &Z);
    for (i = 0; i < Z; i++){
        scanf("%d", &a);
        target[a][2] = 1;
    }
    
    count = 0;
    for (i = 1; i <= N; i++){
        if (target[i][0] == 0 && target[i][2] == 1 ||
            target[i][1] == 1 && target[i][2] == 1){
            
            count++;
        }
    }
    
    printf("%d\n", count);
    
    return (0);
}



Measured memory_bytes: 2100
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner inputscan = new Scanner(System.in);

		int W = inputscan.nextInt();
		int H = inputscan.nextInt();
		int x = inputscan.nextInt();
		int y = inputscan.nextInt();
		int r = inputscan.nextInt();

		int Horizontal1 = x - r;
		int Horizontal2 = x + r;
		int Vertical1 = y - r;
		int Vertical2 = y + r;

		if(Horizontal1 >=0 && Horizontal2 <= W
				&& Vertical1 >=0 && Vertical2 <=H){
			//System.out.println("??????");
			System.out.println("Yes");
		}else{
			//System.out.println("?????????");
			System.out.println("No");
		}
	}

}

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


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i=0;i<n;i++)cout<<"ACL";
  cout<<endl;  
  return 0;
}


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

using namespace std;

const int maxn=1e3+100;
char ans[maxn][maxn];
char a3[10][10]={"a..","a..",".aa"},a4[10][10]={"abcc","abdd","eegh","ffgh"};
char a5[10][10]={"abbcc","a..de","ff.de","g.iij","ghh.j"};
char a7[10][10]={"a..a..a","a..a..a",".aa.aab","a..a..b","a..a..c",".aa.aac","ddeeff."};
int num[maxn][3];
int n;
void solve()
{
    if(n==3){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                ans[i][j]=a3[i][j];
            }
        }
    }
    else if(n==4){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                ans[i][j]=a4[i][j];
            }
        }
    }
    else if(n==5){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                ans[i][j]=a5[i][j];
            }
        }
    }
    else if(n==7){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                ans[i][j]=a7[i][j];
            }
        }
    }
    else {
        if(n%3==0){
            for(int nowp=0;nowp<n;nowp+=3){
                for(int i=0;i<3;i++){
                    for(int j=0;j<3;j++){
                        ans[nowp+i][nowp+j]=a3[i][j];
                    }
                }
            }
        }
        else {
            int nowp=0;
            for(int k=0;k<num[n][0];k+=1){
                for(int i=0;i<4;i++){
                    for(int j=0;j<4;j++){
                        ans[nowp+i][nowp+j]=a4[i][j];
                    }
                }
                nowp+=4;
            }
            for(int k=0;k<num[n][1];k+=1){
                for(int i=0;i<5;i++){
                    for(int j=0;j<5;j++){
                        ans[nowp+i][nowp+j]=a5[i][j];
                    }
                }
                nowp+=5;
            }
            for(int k=0;k<num[n][2];k+=1){
                for(int i=0;i<7;i++){
                    for(int j=0;j<7;j++){
                        ans[nowp+i][nowp+j]=a7[i][j];
                    }
                }
                nowp+=7;
            }
        }
    }
}
int main()
{
    num[4][0]=1;
    num[5][1]=1;
    num[7][2]=1;
    for(int i=8;i<=1000;i++){
        if((i-4)%3!=0){
            num[i][0]=num[i-4][0]+1;
            num[i][1]=num[i-4][1];
            num[i][2]=num[i-4][2];
        }
        else if((i-5)%3!=0){
            num[i][0]=num[i-5][0];
            num[i][1]=num[i-5][1]+1;
            num[i][2]=num[i-5][2];
        }
        else if((i-7)%3!=0){
            num[i][0]=num[i-7][0];
            num[i][1]=num[i-7][1];
            num[i][2]=num[i-7][2]+1;
        }
        else cout<<"???"<<endl;
    }
    cin>>n;
    if(n<=2)cout<<-1<<endl;
    else {
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++)ans[i][j]='.';
        }
        solve();
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++)cout<<ans[i][j];
            cout<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 2432
#include <iostream>

using namespace std;

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

	const auto f = [&](int x, int y) {
		return abs(x - y) <= d;
	};

	bool result = false;
	if(f(a, c) || (f(a, b) && f(b, c))) {
		result = true;
	}

	cout << (result ? "Yes" : "No") << endl;

	return 0;
}


Measured memory_bytes: 256
a, b, k = list(map(int, input().split()))

if a >= k:
  a -= k
  print(str(a) + " " + str(b))
elif a + b >= k:
  b -= (k - a)
  a = 0
  print(str(a) + " " + str(b))
else:
  print("0 0")

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

int main() {
    ll a;
    double b;
    cin >> a >> b;
    string str = to_string(b * 100);
    ll b_b = stoi(str);
    cout << ll((a * b_b) / 100) << endl;
    return 0;
}

Measured memory_bytes: 3824
#include<iostream>
#include<string>
#include<iostream>
#include<vector>
#include<string.h>
#include<stdio.h>
#include<map>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{int n;
 cin>>n;
 cout<<24*2-n;
 system("pause");
 return 0;
}                  

Measured memory_bytes: 504
#include <iostream>
#include <vector>
#include <numeric>

using namespace std; 

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)


int main() {
    
  int N,i;
  int ans;

  cin >> N;

  ans = (N - 2) * 180;

  cout << ans << endl;

  return 0;
}

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

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

char prime[500000];

void make_prime(int n)
{
	int i, j;

	for (i = 2; i < sqrt(n); i++){
		for (j = i + i; j < n; j += i){
			prime[j] = 0;
		}
	}
}

int main(void)
{
	int n;

	memset(prime, 1, sizeof(prime));
	prime[0] = prime[1] = 0;
	make_prime(500000);
	
	while (scanf("%d", &n), n){
		int i, j;
		int c = 0;

		for (i = n + 1; i <= 2 * n; i++){
			c += prime[i];
		}

		printf("%d\n", c);
	}

	return (0);
}

Measured memory_bytes: 1096
fun main(args: Array<String>){
    val odd = listOf('R', 'U', 'D')
    val even = listOf('L', 'U', 'D')
    val x = readLine()!!.withIndex().map {
        if(it.index % 2 == 0 && odd.indexOf(it.value) != -1){
            return@map true
        }
        else return@map it.index % 2 == 1 && even.indexOf(it.value) != -1
    }.indexOf(false)
    println(if (x != -1) "No" else "Yes")
}

Measured memory_bytes: 37720
def gcd(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x

N, X = map(int, input().split())
x = list(map(int, input().split()))

ans = abs(X - x[0])

for i in range(1, N):
  ans = gcd(ans, abs(X - x[i]))
  
print(ans)
  

Measured memory_bytes: 14252
/*
    Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
using namespace std;

#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
#define MSV(A,a) memset(A, a, sizeof(A))
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define finish(x) {cout<<x<<'\n'; return;}
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';

void solve() {
	int n;
	in(n);
	int x;
	int cnt = 0;
	for(int i=0;i<n;i++) {
		in(x);
		if((x & 1) && (i % 2 == 0)) cnt++;
	}
	cout<<cnt<<en;
}

int main() {
	int t = 1;
	
	//~cin>>t;
	while(t--) {
		solve();
	}
    return 0;
}


Measured memory_bytes: 3760
let insertion_sort n v =
  let rec insert v = function
      0 -> v
    | i ->
      let j = i-1 in
      let vi,vj = v.(i),v.(j) in
      if vj <= vi then v
      else (v.(i) <- vj; v.(j) <- vi; insert v j)
  in
  let rec loop v i = if i >= n then v
    else
      let inserted = insert v i in
      Array.iteri
        (fun i d -> Printf.printf (if i=n-1 then "%d\n" else "%d ") d) inserted;
      loop inserted (i+1)
  in loop v 0

let () =
  let n = read_int () in
  let v = read_line () |> Str.split (Str.regexp " ")
          |> List.map int_of_string |> Array.of_list in
  let _ = insertion_sort n v in
  ()

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

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

    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> A(m);
    vector<int> B(n + 1, 0);
    REP(i, m){
        cin >> A[i].first >> A[i].second;
        B[A[i].first]++;
        B[A[i].second]++;
    }

    REP(i, n){
        cout << B[i + 1] << endl;
    }

    return 0;
}

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

#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FILL0(x) memset(x,0,sizeof(x))

using namespace std;

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

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

 
    string S;
    cin >> S;
    if(S=="ARC")
    {
        cout << "ABC" << endl;
    }
    else
    {
        cout << "ARC" << endl;
    }
    
 

 

    return 0;
}



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

int main(){
  int n,k,ans=0,i,ii;
  long long sum=0,f,b;
  cin>>n>>k;
  vector<long long> a(n,0),m(n,0),msum(n+1,0);
  REP(j,n){
    cin>>a.at(j);
    sum+=a.at(j);
  }  
  for(i=1;i*i<=sum;i++){
    if(sum%i) continue;
    REP(l,2){
      if(l) ii=sum/i;
      else ii=i;
      REP(j,n) m.at(j)=a.at(j)%ii;
      sort(m.begin(),m.end());
      REP(j,n) msum.at(j+1)=msum.at(j)+m.at(j);
      REP(j,n){
        f=msum.at(j+1)-msum.at(0),b=msum.at(n)-msum.at(j+1);
        if(f==(n-j-1)*ii-b && f<=k) ans=max(ans,ii);
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;

int N;
char Buf[1000];

int Check(int s, int t, char v)
{
	for (int i = s; i <= t; i ++)
		if (Buf[i] == v)
			return 1;
	return 0;
}

void Work()
{
	scanf("%s", Buf);
	N = strlen(Buf);
	int Ans = -1;
	for (int l = 1; l <= N; l ++)
	{
		for (char v = 'a'; v <= 'z'; v ++)
		{
			int ok = 1;
			for (int i = 0; ; i ++)
			{
				int j = i + l - 1;
				if (j >= N)
					break;
				if (! Check(i, j, v))
				{
					ok = 0;
					break;
				}
			}
			if (ok)
			{
				printf("%d\n", l - 1);
				return;
			}
		}
	}
}

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

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#define MOD 1000000007
#define mkp make_pair
typedef long long ll;
using namespace std;

int N;
ll X;
vector<ll> B,L,R;

vector<pair<ll,int>> uv;
vector<pair<ll,int>> lv;
vector<pair<ll,int>> bv;

vector<pair<pair<ll,ll>,int>> vv;

bool judge(ll lim){
  vector<int> used(N,0);


  ll aoki=0;
  ll taka=0;
  for(int i=0;i<N;i++){
    aoki+=L[i]*B[i];
  }

  ll opnum=lim;
  int uvnum=0;

  for(int i=0;i<N;i++){
      //int now=uv[i].second;
      int now=vv[i].second;
      if(opnum>=X){
          used[now]=1;
          taka+=R[now]*X;
          aoki-=L[now]*B[now];
          aoki+=R[now]*B[now];
          opnum-=X;
      }else{
          uvnum=i;
          break;
      }
  }

  for(int i=0;i<N;i++){
      ll t=taka,a=aoki;
      if(used[i]){
          t-=R[i]*X;
          a+=L[i]*B[i];
          a-=R[i]*B[i];

          if(opnum<=B[i]){
              t+=opnum*L[i];
          }else{
              t+=R[i]*(opnum-B[i])+L[i]*B[i];
          }

          int now=vv[uvnum].second;
          t+=R[now]*X;
          a-=L[now]*B[now];
          a+=R[now]*B[now];
      }else{
          if(opnum<=B[i]){
              t+=opnum*L[i];
          }else{
              t+=R[i]*(opnum-B[i])+L[i]*B[i];
          }
      }
      if(t>=a) return true;
  }

  if(taka>=aoki) return true;
  else return false;
}

int main(){
  cin>>N>>X;
  B.resize(N);
  L.resize(N);
  R.resize(N);
  for(int i=0;i<N;i++) cin>>B[i]>>L[i]>>R[i];

  for(int i=0;i<N;i++){
    uv.push_back(mkp(R[i]*(X-B[i])+L[i]*B[i],i));
    lv.push_back(mkp(L[i],i));
    bv.push_back(mkp(B[i],i));
    vv.push_back(mkp(mkp(R[i]*(X-B[i])+L[i]*B[i],-L[i]),i));
  }

  sort(uv.begin(),uv.end());
  reverse(uv.begin(),uv.end());
  sort(vv.begin(),vv.end());
  reverse(vv.begin(),vv.end());
  sort(lv.begin(),lv.end());
  reverse(lv.begin(),lv.end());
  sort(bv.begin(),bv.end());

  ll ok=N*X,ng=-1;
  while(ok-ng>1){
    ll mid=(ok+ng)/2;
    if(judge(mid)) ok=mid;
    else ng=mid;
  }

  cout<<ok<<endl;

  return 0;
}


Measured memory_bytes: 10632