akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>
#include<queue>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

const int MAX = 1000;
const int INF = INT_MAX / 3;
int V, E;	

struct edge {
	int to, cost;
	edge(int t, int c) : to(t), cost(c) {}
};

int solve(vector<vector<int>> &dist, vector<int> &deg) {
	vector<int> odds;
	rep(i, deg.size()) {
		if(deg[i] % 2) odds.push_back(i);
	}

	for(int k = 0; k < V; ++k) {
		for(int i = 0; i < V; ++i) {
			for(int j = 0; j < V; ++j) {
				dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j]);
			}
		}
	}

	int n = odds.size();
	vector<int> dp((1<<n), INF);
	
	dp[0] = 0;	
	for(int s = 0; s < (1<<n); ++s) {
		for(int i = 0; i < n; ++i) {
			if(s & (1<<i)) continue;
			for(int j = i+1; j < n; ++j) {
				if(s & (1<<j)) continue;
				int a = odds[i];
				int b = odds[j];
				dp[s|(1<<i)|(1<<j)] = min(dp[s|(1<<i)|(1<<j)], dp[s] + dist[a][b]);
			}
		}
	}

	return dp[(1<<n)-1];
}

int main() {
	cin >> V >> E;
	int s, t, d;
	vector<vector<int>> dist(V, vector<int>(V, INF));
	vector<int> deg(V, 0);
	int total = 0;	
	rep(i, E) {
		cin >> s >> t >> d;
		dist[s][t] = min(d, dist[s][t]);	
		dist[t][s] = min(d, dist[t][s]);	
		++deg[s]; ++deg[t];
		total += d;
	}

	cout << total + solve(dist, deg) << endl;
	return 0;
}

Measured memory_bytes: 1280
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = sum(b)

for i in range(n-1):
  if a[i] + 1 == a[i+1]:
    ans += c[a[i]-1]
print(ans)


Measured memory_bytes: 3060
#include<stdio.h>

int main(){
	double sum;
	double a;
	int i;
	while(~scanf("%lf",&a)){
		sum=0;
		sum+=a;
		for(i=2;i<=10;i++){

			if(i%2==0){
				a=2*a;
			}else{
				a=a/3;
			}
			sum+=a;
		}
		printf("%f\n",sum);
	}
	
	return 0;
}

Measured memory_bytes: 644
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define REPI(i, s, e) for (int i = (s); i <= (e); i++)
#define rep(i, n) REP(i, 0, n)
#define repi(i, n) REPI(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

#define dump(x) (cout << #x << " = " << x << endl)
#define dump2(x, y) (cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl)
#define dump3(x, y, z) (cout << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", "<< z << ")" << endl)

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

#define MAX 61
#define INF (1<<29)
int w, h;
int W, H;

string brd[MAX];

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

int solve()
{
	int dist[MAX][MAX];
	rep(j, MAX) rep(i, MAX)
		dist[j][i] = INF;

	queue<pii> que;
	dist[0][0] = 1;
	que.push(pii(0, 0));
	while (!que.empty()) {
		pii p = que.front(); que.pop();
		int y = p.first, x = p.second;

		rep(i, 4) {
			int ny = y+dy[i]*2, nx = x+dx[i]*2;
			if (!(0 <= ny && ny < H)) continue;
			if (!(0 <= nx && nx < W)) continue;
			if (brd[ny-dy[i]][nx-dx[i]] == '1') continue;
			if (dist[ny][nx] == INF) {
				dist[ny][nx] = dist[y][x] + 1;
				que.push(pii(ny, nx));
			}
		}
	}

	return dist[H-1][W-1]==INF?0:dist[H-1][W-1];
}

int main(void)
{
	while (cin >> w >> h, w|h) {
		cin.ignore();
		H = 2*h-1;
		W = 2*w-1;
		rep(i, H)
			getline(cin, brd[i]);

		cout << solve() << endl;
	}
	return 0;
}

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



Measured memory_bytes: 2032
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var a = cin.nextInt();
            var b = cin.nextInt();
            var c = cin.nextInt();
            var d = cin.nextInt();
            
            Console.WriteLine((a-c) * (b-d));
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N+ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }   

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


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

int N,Q;
string S;
int ans[110000]; // 1文字目からi文字目に現れるACの数

int main(){

    cin >> N >> Q >> S;

    for(int i=0;i<S.size();++i){
        if(S[i]=='A' && S[i+1]=='C'){
            ans[i+1] = ans[i] + 1;
        } else {
            ans[i+1] = ans[i];
        }
    }

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


    
    
    return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>
int main(void)
  
{
  int N, A, B, C;
  scanf ("%d" "%d" "%d", &N, &A, &B);
  if (N==1){
    printf("Hello World\n");
  }
  else if (N==2){
    C = A + B;
    printf("%d\n", C);
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <math.h>
#include <numeric>
#include<string>
#include<map>

using namespace std;

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

	vector<pair<int, int>> ball(N);
	for (int i = 0; i < N; i++) {
		int x, y;
		cin >> x >> y;
		ball[i] = make_pair(x, y);
	}
	sort(ball.begin(), ball.end());

	map<pair<int, int>, int> cnt;
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < N; j++) {
			if (j == i);
			else {
				int x = ball[j].first - ball[i].first;
				int y = ball[j].second - ball[i].second;
				cnt[make_pair(x, y)]++; //一致するkey(make_pair)のvalueを+1
				//cout << cnt[make_pair(x, y)] << endl;
			}
		}
	}
	//cout << "abada" << endl;
	//cout << cnt.size() << endl;
	int ans = 0;
	for (auto it = cnt.begin(); it != cnt.end(); it++) {
		//cout << it->second << endl;
		ans = max(ans, it->second);
	}
	ans = N - ans;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define re(x) cout<<(#x)<<" is "<<(x)<<"\n"; 
#define gif(a,b) ((a)/(b)+((a)%(b)?1:0))
using namespace std;

int32_t main()
{
	IOS
	int T = 1; 
	//cin >> T;  
	for (int t = 0; t < T; ++t)
	{
		int k;
		cin >> k;
		char c[k];
		int ans = 0;
		int r = 0, w = 0;
		for(int i = 0; i < k; ++i)
		{
			cin >> c[i];
			if(c[i] == 'R')
				r++;
			else
				w++;
		}
		for(int i = 0; i < w ; ++i)
		{
			if(c[k - i - 1] == 'R')
				ans++;
		}
		cout << min(ans, min(r, w));

	}
	return 0;
}
//if not working? go ahead.


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

using namespace std;

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

	int N, A;
	cin >> N;
	int64_t r = 0;
	int k = 1;
	for (int i = 0; i < N; i++) {
		cin >> A;
		if (k == 1) {
			r += A - 1;
			k++;
		} else if (A > k) {
			r += (A - 1) / k;
		} else if (A == k) {
			k++;
		}
	}
	cout << r << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
ll bpow(ll,ll,ll);
typedef vector<int> vec;
typedef vector<vec> mat;
mat mul(mat &A,mat &B);
mat pow(mat A,ll n);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};


bool cmp_P(const P &a,const P &b){
  return a.second < b.second;
}
int main()
{
  ll N,a[100001],cnt=0,cn[100001];
  cin >> N;
  REP(i,100001)cn[i] = 0;
  REP(i,N)cin >> a[i];
  REP(i,N)cn[a[i]]++;
  for(int i=1;i<=99999;i++)
    cnt = max(cnt,cn[i]+cn[i-1]+cn[i+1]);
  cout << cnt << endl;
  return 0;
}

int par[MAX_N];
int ranks[MAX_N];

//n要素で初期化
void init(int n){
  REP(i,n){
    par[i] = i;
    ranks[i] = 0;
  }

}

//木の根を求める
int find(int x){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = find(par[x]);
  }
}

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y) return ;
  if(ranks[x] < ranks[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ranks[x] == ranks[y]) ranks[x]++;
  }
}

bool same(int x, int y){
  return find(x) == find(y);
}

ll bpow(ll a, ll n,ll mod){
  int i = 0;
  ll res=1;
  while(n){
    if(n & 1)
      res = (res*a) % mod;
    a = (a*a) % mod;
    n >>= 1;
  }
  return res;
}
const int MOD = 1000000007;
mat mul(mat &A, mat &B){
  mat C(A.size(),vec(B[0].size()));
    REP(i,A.size())REP(k,B.size())REP(j,B[0].size()){
    C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % MOD;
  }
  return C;
}

mat pow(mat A,ll n)
{
  mat B(A.size(),vec(A.size()));
  REP(i,A.size()){
    B[i][i] = 1;
  }
  while(n > 0){
    if ( n & 1) B = mul(B,A);
    A = mul(A,A);
    n >>= 1;
  }
  return B;
}


Measured memory_bytes: 1792
/**
  @file c.cpp
  @title C - City Savers
  @url https://atcoder.jp/contests/abc135/tasks/abc135_c
**/

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)

template <class T>
void show(vector<T>& v) {
  for (uint i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}

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

  vector<int> A(N + 1, 0);
  REP(i, N + 1) {
    cin >> A[i];
  }

  vector<int> B(N, 0);
  REP(i, N) {
    cin >> B[i];
  }

  LL ans = 0;
  REP(i, N) {
    if (A[i] > B[i]) {
      ans += B[i];
      A[i] -= B[i];
      B[i] = 0;
    } else if (A[i] == B[i]) {
      ans += B[i];
      A[i] = 0;
      B[i] = 0;
    } else {
      ans += A[i];
      B[i] -= A[i];
      A[i] = 0;

      ans += min(A[i + 1], B[i]);
      A[i + 1] = max(0, A[i + 1] - B[i]);
      B[i] -= min(A[i + 1], B[i]);
    }

    // cout << "Step: " << i << " ans: " << ans << "\n";
    // cout << "A"
    //      << ": ";
    // show(A);
    // cout << "B"
    //      << ": ";
    // show(B);
  }

  cout << ans << endl;
  return 0;
}


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

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> Pair;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;

ll N, X;
ll ans;

ll gcd(ll a, ll b) {
    if(b == 0) {
        ans -= a;
        return a;
    }
    ans += 2 * floor(a / b) * b;
    return gcd(b, a % b);
}

int main() {
    cin >> N >> X;
    gcd(max(X, N - X), min(X, N - X));
    cout << N + ans << "\n";
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        // int n = Integer.parseInt(bf.readLine());
        StringTokenizer st = new StringTokenizer(bf.readLine());
        // int[] a = new int[n]; for(int i=0; i<n; i++) a[i] = Integer.parseInt(st.nextToken());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        Pair[] a = new Pair[n];
        Map<Pair, Integer> counts = new HashMap<Pair, Integer>();
        TreeSet<Pair> vals = new TreeSet<Pair>();
        for(int i=0; i<n; i++) {
          st = new StringTokenizer(bf.readLine());
          int x = Integer.parseInt(st.nextToken());
          int y = Integer.parseInt(st.nextToken());
          a[i] = new Pair(x, y);
          //Pair rev= new Pair(y, x);

        }
        Arrays.sort(a);
        long ans = 0; int cur = 1;
        for(int i=0; i<n; i++) {
          //out.println(a[i].a + " " + a[i].b);
          if(a[i].a > m) continue;
          while(a[i].a > cur) {
            if(!vals.isEmpty()) {
            Pair pp = vals.last();
          //  out.println(pp.a + " " + pp.b);
            counts.put(pp, counts.get(pp)-1);
            if(counts.get(pp)==0) vals.remove(pp);
            ans += pp.a;
            }

            cur++;

          }

            Pair rr = new Pair(a[i].b, a[i].a);

            if(!counts.containsKey(rr)) counts.put(rr, 0);
            counts.put(rr, counts.get(rr)+1);
            vals.add(rr);



        }
        while((!vals.isEmpty()) && (cur < m+1)) {
        Pair pp = vals.last();
        counts.put(pp, counts.get(pp)-1);
        if(counts.get(pp)==0) vals.remove(pp);
        ans += pp.a;
        cur++;
        //out.println(pp.a + " " + pp.b);
        }
        out.println(ans);
        out.close(); System.exit(0);
    }

}
class Pair implements Comparable<Pair> {
  public int a;
  public int b;
  public Pair(int a, int b) {
    this.a = a;
    this.b = b;
  }
  @Override
  public boolean equals(Object o) {
    Pair p = (Pair)o;
    return (this.compareTo(p) == 0);
  }

  @Override
  public int hashCode() {
    return (int)((1L*a*103948902382L+b) % 1000000007);
  }

  @Override
  public int compareTo(Pair p) {
    if(this.a > p.a) return 1;
    if(this.a < p.a) return -1;
    if(this.b < p.b) return 1;
    if(this.b > p.b) return -1;
    return 0;
  }
}


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

int main(){
  int d[100]={0};
	string s;
	cin >> s;
	rep (i, s.size()){
		char a=s[i];
		d[a-'a']++;
	}
	rep (i, 26){
		if ( d[i]==0 ){
		cout << char (i+'a') << endl;
		return 0;
		}
	}
	cout << "None" << endl;
}


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

int main(){
  int A[3];
  cin >> A[0] >> A[1] >> A[2];
  sort(A, A+3);
  if(A[0] == 5 && A[1] == 5 && A[2] == 7) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,x,y) for(register int i = x;i <= y; ++ i)
#define repd(i,x,y) for(register int i = x;i >= y; -- i)
using namespace std;
typedef long long ll;
template<typename T>inline void read(T&x)
{
	char c;int sign = 1;x = 0;
	do { c = getchar(); if(c == '-') sign = -1; }while(!isdigit(c));
	do { x = x * 10 + c - '0'; c = getchar(); }while(isdigit(c));
	x *= sign;
}
 
const int N = 2e5 + 50;
int head[N],to[N << 1],nxt[N << 1],tot;
inline void add(int x,int y)
{
	to[tot] = y;
	nxt[tot] = head[x];
	head[x] = tot ++;
}
 
char s[N];
int l[N],r[N],mx[N],se[N],sz[N],n;
 
void dfs1(int x,int fa)
{
	for(register int i = head[x];~i;i=nxt[i])
		if(to[i] != fa)
		{
			dfs1(to[i],x);
			sz[x] += sz[to[i]];
			if(mx[x] < mx[to[i]] + 1)	
				se[x] = mx[x],mx[x] = mx[to[i]] + 1;
			else if(se[x] < mx[to[i]] + 1)
				se[x] = mx[to[i]] + 1;
			if(sz[to[i]]) l[x] = min(l[x],mx[to[i]] + 1);
		}
}
 
ll ans;
 
void dfs2(int x,int fa)
{
	r[x] = min(se[x] + 1,mx[x] - 1);
	if(l[x] <= r[x]) ans += r[x] - l[x] + 1;
	for(register int i = head[x];~i;i=nxt[i])
		if(to[i] != fa)
		{
			int k = mx[to[i]]+1==mx[x]?se[x]+1:mx[x]+1;
			if(k > mx[to[i]]) se[to[i]] = mx[to[i]],mx[to[i]] = k;
			else if(k > se[to[i]]) se[to[i]] = k;
			if(sz[1] - sz[to[i]]) l[to[i]] = min(l[to[i]],k);
			dfs2(to[i],x);
		}
}
int main()
{
	memset(head,-1,sizeof head);
	read(n);
	rep(i,2,n)
	{
		int u,v;
		read(u); read(v);
		add(u,v); add(v,u);
	}
	scanf("%s",s + 1);
	rep(i,1,n)
		if(s[i] == '1') l[i] = 0,sz[i] = 1;
		else l[i] = n + 1;
 
	dfs1(1,1); 
	dfs2(1,1);
 
	cout << ans + 1<< endl;
 
	return 0;
}

Measured memory_bytes: 15360
#include <algorithm>
#include <iostream>
#include <vector>
 
int main() {
  int N, X;
  std::cin >> N >> X;
  std::vector<int> A(N);
  for (int i = 0; i < N; i++) std::cin >> A[i];
  std::sort(A.begin(), A.end());
  int i{0};
  int sum{0};
  while (sum <= X && i < N) {
    sum += A[i];
    ++i;
  }
  if(sum==X){
    std::cout << i << std::endl;
  } else{
    std::cout << i - 1 << std::endl;
  }
}

Measured memory_bytes: 256
import java.util.*;

/**
 * Created by Seiya on 2016/10/16.
 */

public class Main {

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

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        System.out.println((a + b) % 24
        );


    } // mainMethod



} // MainClass


Measured memory_bytes: 22356
#include<bits/stdc++.h>
#define hell 1000000007
#define int long long int

using namespace std;

void solve(){
    int n;
    cin>>n;
    string res="";
    while(n>0){
        int r=n%26;
        n/=26;
        if(r!=0)
            res.push_back('a'+r-1);
        else{
            res.push_back('z');
            n--;
        }
    }
    reverse(begin(res),end(res));
    cout<<res;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    //cin>>t;
    t=1;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3648
#include<stdio.h>

int A[1000000], n;

int binarySearch(int key){
   int left = 0;
   int right = n;
   int mid;
   while( left < right){
      mid = (left + right) / 2;
      if( key == A[mid] ) return 1;
      if( key > A[mid] ) left = mid + 1;
      else if( key < A[mid]) right = mid;
   }
   
   return 0;
}

int main(){
   int i, q, k, sum = 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", &k);
      if( binarySearch( k )) sum++;
   }
   printf("%d\n", sum);

   return 0;
} 



Measured memory_bytes: 2128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		
		
		

		Scanner scanner = new Scanner(System.in);
		int x = scanner.nextInt();
		int y = scanner.nextInt();  //ноги
		
		String reString = "Yes";
		
		if (y % 2 != 0) {
			reString = "No";
		}
		
		if(x * 4 < y) {
			reString = "No";
		}
		if(x * 2 > y) {
			reString = "No";
		}
		
		
		System.out.println(reString);

	}}

Measured memory_bytes: 35840
n = int(input())
A = list(map(int,input().split()))
accum = [A[0]]
for i in range(1,n):
    accum += [accum[-1]+A[i]]
ans = float('inf')
for i in range(n-1):
    ans = min(ans,abs(accum[n-1]-2*accum[i]))
print(ans)

Measured memory_bytes: 24812
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long x[] = new long[N];
		long y[] = new long[N];
		long h[] = new long[N];
		for(int i = 0; i < N; i++) {
			x[i] = sc.nextLong();
			y[i] = sc.nextLong();
			h[i] = sc.nextLong();
		}
		
		long ans_x = 0;
		long ans_y = 0;
		long ans_h = 0;
		
		out : for(long c_x = 0; c_x <= 100; c_x++) {
			in : for(long c_y = 0; c_y <= 100; c_y++) {
				for(int i = 0; i < N; i++) {
					if(h[i] != 0) {
						ans_h = h[i] + Math.abs(c_x - x[i]) + Math.abs(c_y - y[i]);
						break;
					}
				}
				for(int i = 0; i < N; i++) {
					if(h[i] != Math.max(ans_h - Math.abs(c_x - x[i]) - Math.abs(c_y - y[i]), 0)) {
						ans_h = 0;
						continue in;
					}
				}
				ans_x = c_x;
				ans_y = c_y;
				break out;
			}
		}
		
		System.out.println(ans_x + " " + ans_y + " " + ans_h);
	}
}


Measured memory_bytes: 24148
#include<bits/stdc++.h>
#include<random>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007LL
#define INF 1000000000ll
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin>>s;
	ll n=(ll)s.size();
	if(s[0]=='0'||s[n-1]=='1') {
		cout<<-1<<endl;
		return 0;
	}
	ll cnt=0;
	REP(i,n/2) {
		if(s[i]!=s[n-2-i]) {
			cout<<-1<<endl;
			return 0;
		}
		if(s[i]=='1') cnt++;
	}
	vector<P> edg;
	REP(i,cnt) {
		edg.pb(P(i+1,i+2));
	}
	ll c=1;
	ll pos=cnt+2;
	ll root=1;
	for(ll i=0; i<n/2; i++) {
		if(s[i]=='1') {
			while(c<i+1) {
				edg.pb(P(pos,root));
				pos++;
				c++;
			}
			root++;
			c++;
		}
	}
	while(pos<=n) {
		edg.pb(P(root,pos));
		pos++;
	}
	REP(i,edg.size()) {
		cout<<edg[i].first<<" "<<edg[i].second<<endl;
	}
	return 0;
}


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

using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;
#define long long int int
#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int inf = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
 
 
template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

const int N =1000000;
int bit[26][N];

void update(int w, int ind, int val) {
  for (; ind < N; ind += (ind & -ind)) {
    bit[w][ind] += val;
  }
}
int query(int w, int ind) {
  int ans = 0;
  for (; ind > 0; ind -= (ind & -ind)) {
    ans += bit[w][ind];
  }
  return ans;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int ghj;
  cin>>ghj;
  string str;
  cin >> str;
  int n = str.size();
  str = '#' + str;
  for (int i = 1; i <= n; i++) {
    update(str[i] - 'a', i, 1);
  }
  int q;
  cin >> q;
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int ind;
      char c;
      cin >> ind >> c;
      int w = c - 'a';
      update(str[ind] - 'a', ind, -1);
      update(w, ind, 1);
      str[ind] = c;
    } else {
      int l, r;
      cin >> l >> r;
      int ans = 0;
      for (int i = 0; i < 26; i++) {
        int c = query(i, r) - query(i, l - 1);
        ans += (c >=1 );
      }
      cout << ans << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 101168
r={'N':(1,5,2,3,0,4),'S':(4,0,2,3,5,1),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3)}

d=input().split()   
for x in input(): 
    d=[d[y]for y in r[x]]   
    
print(d[0])


Measured memory_bytes: 5568
fn solve(s: &[usize]) -> (isize, isize) {
    let n = s.len();
    let mut l = 0;
    let mut r = n;
    let mut res = (0, 0);
    let mut min_diff = usize::max_value();
    while r - l > 1 {
        let idx = (l + r) / 2;
        let a = (s[idx] - s[0]) as isize;
        let b = (s[n-1] - s[idx]) as isize;
        if ((a - b).abs() as usize) < min_diff {
            min_diff = (a - b).abs() as usize;
            res = (a, b);
        }
        if a < b {
            l = idx;
        } else {
            r = idx;
        }
    }
    res
}
fn main() {
    let n: usize = readln();
    let a: Vec<usize> = readln();
    let mut s = Vec::new();
    s.push(0);
    for x in a {
        let next = s[s.len() - 1] + x;
        s.push(next);
    }
    let mut answer = isize::max_value();
    for i in 1..n {
        let (l1, l2) = solve(&s[..(i+1)]);
        let (r1, r2) = solve(&s[i..]);
        //println!("{:?}", &s[..i]);
        //println!("{:?}", &s[i..]);
        //println!("{} {} {} {}", l1, l2, r1, r2);
        let a = min(min(l1, l2), min(r1, r2));
        let b = max(max(l1, l2), max(r1, r2));
        answer = min(answer, b - a);
    }
    println!("{}", answer);
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);


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

int main(){
    char numero[11234];
    scanf("%s", numero);
    int digitos = 0, numeroint = atoi(numero);
    for (int i = 0; i < strlen(numero); i++){
        digitos += numero[i] - '0';
    }
    if (numeroint % digitos == 0)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void){

  int i,N;
  scanf("%d",&N);
  for(i=1;i<10;i++){
    if(N%i==0){
      if(N/i>=1&&N/i<=9){
	printf("Yes\n");
	break;
      }
      
	
    }
  }
  if(i==10){
    printf("No\n");
  }
      
  
  

  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ff                first
#define ss                second
#define pb                push_back
#define int                long long
#define forn(i, n)        for (int i = 0; i < n; i++)
#define Forn(j, a, b)     for (int j = a; j < b; j++)
#define sp                " "
#define br                "\n"
#define mii               map<int ,int>
#define setbits(x)        _builtin_popcountll(x)
#define zrobits(x)        _builtin_ctzll(x)
#define ps(x,y)           fixed<<setprecision(y)<<x
#define w(x)              int x; cin>>x; while(x--)
#define MAXN              10000000
void c_p_c()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("ou.txt", "w", stdout);
#endif
}
//map--------------------------
// auto it=map.begin();
// for(it;it!=map.end();++it)
// {

// }
// int dp[100002][6];
// int fun(int arr[],int i,int k,int z,int n)
// {
//   if(i>=n||k==0||i<0)
//   return 0;
//   if(dp[i][z]!=-1)return dp[i][z];
//   int value=0;
//   if(i<n)
//   value=max(value,arr[i]+fun(arr,i+1,k-1,z,n));
//   if(i>0 and z>0)
//   value=max(value,arr[i]+fun(arr,i-1,k-1,z-1,n));
//   return dp[i][z]=value;
// }


//char num[][10]={"zero","one","two","three","four","five","six","seven","eight","nine"};

int power(int x, unsigned int y)  
{  
    int res = 1;
   
    if (x == 0) return 0;
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x);  
        y = y>>1; 
        x = (x*x);  
    }  
    return res; 
}
void solve()
{
  int n,d;cin>>n>>d;
  int counter=0;
  for(int i=1;i<=n;i++)
  {
  int x,y;cin>>x>>y;
  x=abs(x);
  y=abs(y);
  int zz=(power(x,2))+power(y,2);
  if(zz<=(power(d,2)))counter++;
  }
  cout<<counter;
}
int32_t main()
{
  c_p_c();
  solve();
}   


Measured memory_bytes: 3616
s = input()

lis = ['A','C','G','T']

sub = []
for i in range(len(s)):
  for j in range(i+1,len(s)+1):
    tmp = s[i:j]
    flag = True
    for k in range(len(tmp)):
      if tmp[k] in lis:
        pass
      else:
        flag = False
    if flag: sub.append(tmp)
      
ma = 0
for i in sub:
  l = len(i)
  if l > ma: ma = l
print(ma)

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

int main() {
    int N;
    string S, T;
    cin >> N >> S >> T;
    rep(i, N) {
        cout << S[i] << T[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <stack>

#define mod 1000000007
#define INF2 9999999999
#define INF (1<<30)
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
//#define P pair<int, int>

using namespace std;
using ll = __int64_t;

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

void solve(){
  string s;
  cin >> s;
  int n = 0;
  for(int i = 0; i < 3; i++){
    if(s[i] == 'o') n++;
  }
  cout << 700+100*n << endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  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)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = --end(s); i != begin(s); --i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.size(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr T mins(T& a, Args... args) { return a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr T maxs(T& a, Args... args) { return a = max<T>({ a,args... }); }
template<typename A, size_t N, typename T>
void fillArray(A(&array)[N], const T& val) { std::fill((T*)array, (T*)(array + N), val); }

int n, r;
void solve() {
    cin >> n >> r;

    if (n < 10) cout << r + 100 * (10 - n) << endn;
    else cout << r << endn;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout << flush;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){	

	int N, A, B, P, cnt[3] = {};
	cin >> N >> A >> B;
	for(int i = 0; i < N; i++){
		cin >> P;
		if(P <= A){
			cnt[0]++;
		} else if(A < P && P <= B){
			cnt[1]++;
		} else {
			cnt[2]++;
		}
	}
	sort(cnt, cnt + 3);
	cout << cnt[0] << 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;

int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	if (a+b+1>=c){
		cout<<b+c<<endl;
	}else{
		cout<<a+b+1+b<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lli = int_fast64_t;
using ulli = uint_fast64_t;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl
#define debugst(x) auto xt = x;cerr << #x << " : {";for(int i=0;i<x.size();i++){ cerr << xt.top() << ", ";xt.pop();}cerr << endl
#define debugvp(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x.first << " : " << value_of_x.second << ", ";}cerr << endl

const lli MOD = 1000000007;
const lli LIMIT = 1000000000000000000 * 5;
const int tenfive = 100000;

int main() {
	int N, K;
	cin >> N >> K;
	if (K == 1) {
		cout << 0 << endl;
		return 0;
	}
	cout << N - K << endl;
	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
l_max = 1
r_min = 10 ** 5

for _ in range(m):
    l, r = map(int, input().split())
    if l > l_max:
        l_max = l
    if r < r_min:
        r_min = r

if r_min < l_max:
    ans = 0
else:
    ans = r_min - l_max + 1

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define br cout << endl;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    
    ll n;
    cin >> n;
    
    vector<ll> zero(61);
    vector<ll> one(61);
    rep(i, n){
        ll count = 0;
        ll tmp;
        cin >> tmp;
        for(ll j = 0; j < 61; j++){
            if(tmp & 1){
                one.at(count)++;
            }else{
                zero.at(count)++;
            }
            count++;
            tmp = tmp >> 1;
        }
    }

    ll ans = 0;
    ll twopow = 1;
    rep(i, 61){
        ll tmp;
        tmp = (zero[i] * one[i]) % MOD;
        tmp = (twopow * tmp) % MOD;
        ans = (ans + tmp) % MOD;
        twopow = (twopow * 2) % MOD; 
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int r;
  cin >> r;
  cout << r * r << endl;
  return 0;
}

Measured memory_bytes: 256
N, W = [int(i) for i in input().split()]
weight, value = [0] * (N + 1), [0] * (N + 1)
for i in range(1, N + 1):
    weight[i], value[i] = [int(i) for i in input().split()]
#%%
dp = [[0] * (W + 1) for _ in range(N + 1)]

#%%
for i in range(1, N + 1):
    for j in range(1, W + 1):
        if weight[i] <= j:
            dp[i][j] = max(value[i] + dp[i - 1][j - weight[i]], dp[i - 1][j])
        else:
            dp[i][j] = dp[i - 1][j]
print(int(dp[-1][-1]))


Measured memory_bytes: 120668
p = 10 ** 9 + 7
N = (10 ** 5)*2 +10  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

n,m = map(int,input().split())
if abs(n-m) > 1:
    print(0)
elif n==m:
    m1 = fact[n]
    print(((m1**2)*2)%p)
else:
    m1 = fact[n]
    m2 = fact[m]
    print((m1*m2)%p)

Measured memory_bytes: 27124
#include <cstdio>
#define _(a,b) a^=b^=a^=b
int main () {
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if (a<b) _(a,b);
    if (a<c) _(a,c);
    printf(a==b+c?"Yes":"No");
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define reps(i,n) for (int i=1;i<=(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rreps(i,n) for (int i=(n);i>0;i--)
#define all(v) (v).begin(),(v).end()
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>
template<class T> inline bool chmin(T &a, T b) {if (a>b) {a = b; return 1;} return 0;};
template<class T> inline bool chmax(T &a, T b) {if (a<b) {a = b; return 1;} return 0;};
typedef long long int ll;
const long long INF = 1LL << 60;


int main(){
  int A, B, C; cin >> A >> B >> C;
  int K; cin >> K;

  int cnt = 0;
  while (B<=A) {
    B *= 2;
    cnt++;
  }
  while (C<=B) {
    C*=2;
    cnt++;
  }
  if (cnt<=K) cout << "Yes" << endl;
  else cout << "No" << endl;



  // cout << fixed << setprecision(10);
  
  return 0;
}


Measured memory_bytes: 3496
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<tuple>

#define DIV 1000000007
using namespace std;
using ll = long long;
using ldb = long double;

int main() {
	int N; cin >> N;
	string s0, s1; cin >> s0 >> s1;

	ll ans = 0;
	if (s0[0] == s0[1])ans = 6;
	else ans = 3;
	for (int i = 1; i < N; i++) {
		if (s0[i] == s1[i]) {
			if (s0[i - 1] == s1[i - 1])ans *= 2;
		}
		else if (i + 1 < N && s0[i] == s0[i + 1]) {
			if (s0[i - 1] == s1[i - 1])ans *= 2;
			else ans *= 3;
		}
		ans %= DIV;
		//printf("i=%d ans=%lld\n", i, ans);
	}

	cout << ans << endl;
}


Measured memory_bytes: 3632
import sys


scan = sys.stdin.readline


def main():
  n = int(scan().rstrip())
  d = [int(_) for _ in scan().rstrip().split()]
  
  if n % 2 == 1:
    print(0)
    sys.exit(0)
  
  d.sort()
  
  mid_index = len(d) // 2
  
  mid_small = d[mid_index - 1]
  mid_big = d[mid_index]
  
  print(mid_big - mid_small)


if __name__ == "__main__":
  main()

  

Measured memory_bytes: 14396
N=int(input())
A=list(map(int,input().split()))
count=[0]*(10**5)
total=sum(A)
for a in A:
    count[a-1]+=1
Q=int(input())
for q in range(Q):
    B,C=map(int,input().split())
    total+=count[B-1]*(C-B)
    if count[B-1]!=0:
        count[C-1]+=count[B-1]
        count[B-1]=0
    print(total)

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

typedef long long ll;
const ll INF = 1010000000000000017LL;
const ll MOD = 1000000007LL;

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

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

int main(){
    std::cout<<std::fixed<<std::setprecision(10);

    ll A, V, B, W, T;

    cin >> A >> V >> B >> W >> T;

    if( V <= W ){
        cout << "NO" << endl;
        return 0;
    }

    if( ((V-W)*T) >= abs(A-B) ){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector <int> vi;
#define f first
#define s second
#define FOR(i,s,e) for (ll i = s; i <= (ll)e; i++)
#define DEC(i,s,e) for (ll i = s; i >= e; i--)
#define aFOR(i,s) for (auto i: s)
#define maxn 1001
#define INF 1e9
#define pb push_back
typedef pair <int,int> pi;
typedef pair<pi,int> pii;

char grid[51][51];
bool vis[100][100];

int dx[4] = {0,0,1,-1};
int dy[4] = {-1,1,0,0};
int H,W;
int main(){
	cin>>H>>W;
	int num = 0;
	FOR(i,0,H-1){
		FOR(j,0,W-1){
			 cin>>grid[i][j];
			 if (grid[i][j] == '#') num++;
		 }
	 }
	 
	 queue <pii> q;
	 
	 q.push(pii(pi(0,0),0));
	 
	 int ans = -1;
	 
	 while (!q.empty()){
		 pii cur = q.front(); q.pop();
		 
		 if (vis[cur.f.f][cur.f.s]) continue;
		 vis[cur.f.f][cur.f.s] = 1;
		 
		// cout<<cur.f.f<<' '<<cur.f.s<<'\n';
		 if (cur.f == pi(H-1,W-1)){
			 ans = cur.s;
			 break;
		 }
		 
		 FOR(i,0,3){
			 int nx = cur.f.f + dx[i], ny = cur.f.s + dy[i];
			 
			 if (nx < 0 || ny < 0 || nx >= H || ny >= W) continue;
			 if (grid[nx][ny] != '.') continue;
			 
			 q.push(pii(pi(nx,ny),cur.s+1));
		 }
	 }

	 if (ans == -1) cout<<ans;
	 else{
		 cout<<H * W - num - ans - 1;
	 }
 }


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#define ll long long
#define ALL(a)  (a).begin(),(a).end()

//REPEAT
//------------------------------------------
#define FOR(i,m,n) for(int (i)=(m);(i)<(n); i++)
#define REP(i, n) for(int (i)=0;(i)<(n);(i)++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
	int x,y;cin>>x>>y;
	ll ret=0;
	if(x<y) REP(i,y)ret=ret*10+x;
	else REP(i,x) ret=ret*10+y;
	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 256
//Wrong answer on test inf.
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define inf 1000000001
#define y1 y1___
using namespace std;
char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
	char ch=gc();ll x=0;int op=1;
	for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-1;
	for (;isdigit(ch);ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
	return x*op;
}
int len;
string s,typ,ans;
void ask(string x){
	cout<<"? "+x<<'\n';
	fflush(stdout);
	cin>>typ;
}
void print(string s){
	cout<<"! "+s<<'\n';
	fflush(stdout);
	exit(0);
}
int init(){
	s="10";
	rep (i,1,9){
		ask(s);if (typ=="N") return i;s+='0';
	}
	s="9";
	rep (i,1,9){
		ask(s);if (typ=="Y") return i;s+='9';
	}
	return 10;
}
bool check(int x,int y){
	s=ans+char(x+'0');
	ask(s);
	return typ=="Y";
}
int main(){
	len=init();
	if (len==10) return printf("! 1000000000\n"),0;
	ans="";
	rep (i,1,len-1){
		int l=i==1,r=9,mid,t=0;
		while (l<=r){
			mid=l+r>>1;
			if (check(mid,i)) t=mid,l=mid+1;else r=mid-1;
		}
		ans+=char(t+'0');
	}
	rep (i,(len==1?1:0),9){
		s=ans+(char(i+'0'))+'0';
		ask(s);
		if (typ=="Y") print(ans+char(i+'0'));
	}
	return 0;
}


Measured memory_bytes: 596