akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define VVVI vector<vector<vector<ll>>>
#define VVVVI vector<vector<vector<vector<ll>>>>
#define REP(i,n) for(ll i=0,_n=(n);(i)<(ll)_n;++i)
#define REPR(i,n) for(ll i=(ll)(n)-1;0<=(i);--i)
#define RANGE(i,a,b) for(ll i=(ll)a,_b=(ll)(b);(i)<_b;++i)
#define RANGER(i,a,b) for(ll i=(ll)(b)-1,_a=(ll)(a);(_a)<=i;--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
#define FI first
#define SE second
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << "\n"; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template<typename T>void maxUpdate(T& a, T b) {a = max(a, b);}
template<typename T>void minUpdate(T& a, T b) {a = min(a, b);}
string YN(bool v) { return v ? "Yes":"No"; }

#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N,M,W,H;
	string s;
	while(cin>>H>>W) {
		vector<string> m(H);
		REP(i, H) cin>>m[i];
		REP(loop, 2) {
			vector<string> r;
			REP(y, m.size()) if(m[y]!=string(m[0].size(), '.')) r.PB(m[y]);
			vector<string> mm(r[0].size(), string(r.size(), ' '));
			REP(y, r.size()) REP(x, r[0].size()) mm[x][y]=r[y][x];
			m=mm;
		}
		
		REP(y, m.size()) cout<<m[y]<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 384
// 1_5_D
#include<stdio.h>

int main(void)
{
	int n, i, x;
	scanf("%d", &n);

	for(i = 1; i <= n; i++){
		if(i%3 == 0){
			printf(" %d", i);
			continue;
		}

		x = i;
		while(x && x%10 != 3){
			x /= 10;
		}
		if(x){
			printf(" %d", i);
		}
	}
	printf("\n");

	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
int main(){
  #define int long long
  int answer = 0;
  string S, FS = "";
  cin >> S;
  for(int i = 0; i < (int) S.size(); i++) {
    if(S.at(i) != 'x'){
      FS += S.at(i);
    }
  }
  for(int i = 0; i < (int) FS.size(); i++) {
    if(FS.at(i) != FS.at((int) FS.size() - i - 1)){
      cout << -1 << endl;
      return 0;
    }
  }
  int s = (int) S.size();
  for(int i = 0; i < (int) S.size(); i++) {
    if(S.at(i) != S.at((int) S.size() - i - 1)) {
      answer++;
      if(S.at(i) == 'x') {
        S.insert((int) S.size() - i, "x");
      }
      else {
        S.insert(i, "x");
      }
    }
  }
  cout << answer << endl;
}

Measured memory_bytes: 3760
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

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

#define MOD 1000000007

void solve(int test_case) {
	string a,b;
	cin>>a>>b;
	if(a[0]==b[2]&&a[1]==b[1]&&a[2]==b[0])cout<<"YES";
	else cout<<"NO";
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; 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 rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

int main() {
  // 貪欲法
  // 最終日から見ていき、
  // 残っている仕事の中で1番割の良い仕事を選ぶｌ
  // priority queue
  int n = in(), m = in();
  vector<vector<int>> jobs(m);
  rep(i,n) {
    int a = in();
    int b = in();
    if (a > m) continue;
    jobs[m-a].pb(b);
  }
  priority_queue<int> q;
  ll ans = 0;
  for (int i = m-1; i >= 0; --i) {
    for (int b : jobs[i]) {
      q.push(b);
    }
    if (!q.empty()) {
      ans += q.top();
      q.pop();
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5632
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

ll lcm(ll x, ll y) {
	return x/__gcd(x,y)*y;
}

ll eval(ll x) {
	ll ret=0;
	while(x%2==0)
		x>>=1, ret++;
	return ret;
}

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int N,M; cin>>N>>M;
	vector<int> a(N);
	set<ll> st;
	for (int i=0; i<N; i++) {
		cin>>a[i], a[i]>>=1;
		st.insert(eval(a[i]));
	}
	if(st.size()>1) {
		cout<<"0\n";
		return 0;
	}

	ll l=1;
	for (int i=0; i<N; i++) {
		l=lcm(l,a[i]);
		if(l>M) {
			cout<<"0\n";
			return 0;
		}
	}
	cout<<(M/l+1)/2<<"\n";
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<int> si;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int INF = 1000000007;
const int MOD = (int)1e9+7;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
int dy[4] = {-2, -1};
int dx[4] = {-1, -2};

int n;
string s;
int cnt[26];
map<string, ll> record;

int main(void) {
	ios_base::sync_with_stdio(false); 
	cin.tie(0); 
	cout.tie(0);
	//freopen("in.txt", "r", stdin);
	cin >> n;
	ll total = 0;

	rep(i,0,n) {
		cin >> s;

		memset(cnt, 0, sizeof(cnt));
		rep(j,0,10) {
			cnt[s[j]-'a']++;
		}

		string key = "";
		rep(j,0,26) {
			if(cnt[j]) {
				string num = string(1, cnt[j]+'0');
				if(cnt[j] == 10) {
					num = "10";
				}
				char c = j+'a';
				string here = string(1, c) + num;
				key += here;
			}
		}

		//cout << key << endl;

		if(record.find(key) != record.end()) {
			total += record[key];
			record[key]++;
		} else {
			record[key] = 1;
		}
	}
	cout << total << endl;
	return 0;
}


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

int main(void){
  int X = 0;
  int Y = 0;
  int i = 0;
  int flag = 0;
  
  cin >> X >> Y;
  
  for(i=0;i<=X;i++){
    if(Y == (i*2 + (X-i)*4))flag = 1;
  }

  if(flag == 1)cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}


Measured memory_bytes: 3624
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


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

	vector<pair<double, double>> p(n);

	double m = 1;
	for (int i = 0; i < n; i++)
	{
		double x, y;
		cin >> x >> y;

		p[i].first = x;
		p[i].second = y;

		m *= (i + 1);
	}

	double sum = 0;

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			if (i != j)
			{
				sum += sqrt((p[i].first - p[j].first) * (p[i].first - p[j].first) + (p[i].second - p[j].second) * (p[i].second - p[j].second));
			}
		}
	}

	printd((sum / m) * (m / n), 10)
}


Measured memory_bytes: 256
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int x, a;
  cin >> x >> a;
  if (x < a) {
    cout << 0 << endl;
  } else {
    cout << 10 << endl;
  }
  return 0;
}


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

int main(){
    int a, b;
    cin >> a >> b;
    int x=a+b;
    int y=a-b;
    int z=a*b;
    if(x>y){
        if(x>=z) cout << x;
        if(x<z) cout << z;
    }
    if(x<=y){
        if(y>=z) cout << y;
        if(y<z) cout << z;
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#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 REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()




int main(void){
    string S;
    ll K;

    cin >> S >> K;

    ll a = 0;
    ll b = 0;
    ll n = S.size();
    ll ans = 0;
    rep(i,n-1){
        if(b == 0){
            if(S[i] == S[i+1] ){
                a++;
                b = 1;
            }else{
                b = 0;
            }
        }else{
            b = 0;
        }
    }

    if(b == 1){
        ans = a*K;
    }else{
        ll aa = 0;
        if(S[0] == S[n-1]){
            aa++;
            b = 1;
        }
        rep(i,n-1){
            if(b == 0){
                if(S[i] == S[i+1] ){
                    aa++;
                    b = 1;
                }else{
                    b = 0;
                }
            }else{
                b = 0;
            }
        }

        if(b == 1){
            if(K%2 == 1){
                ans = a*(K+1)/2 + aa*(K-1)/2;
            }else{
                ans = a*K/2 + aa*K/2;
            }            
        }else{
            ans = a + aa*(K-1);
        }
    }

    cout << ans << endl;

	
    return 0;
}


Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	a := make([]int, N)

	for i := 0; i < N; i++ {
		a[i] = getInt()
	}

	ans := a[0]
	for i := 1; i < N; i++ {
		// out(ans, a[i])
		ans = ans ^ a[i]
	}
	if ans == 0 {
		out("Yes")
	} else {
		out("No")
	}
}


Measured memory_bytes: 2432
import kotlin.math.sqrt

fun main(args: Array<String>) {
    val (n, d) = readLine()!!.split(" ").map(String::toDouble)
    var count = 0

    for (i in 1..n.toInt()) {
        val (x, y) = readLine()!!.split(" ").map(String::toDouble)
        if (sqrt(x * x + y * y) <= d) {
            count++
        }
    }
    println(count)
}

Measured memory_bytes: 59980
import java.util.*;

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

	int week = sc.nextInt();

	double money = 100000;
	for(int i=0; i<week; i++){
	    money = money + money*0.05;
	    if(money%1000!=0){
		money = money + (1000 - (money%1000));
	    }
	}

	System.out.println((int)money);
    }
}

Measured memory_bytes: 0
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<deque>
#include<iomanip>
#include<set>
#include<unordered_set>
#include<tuple>
#include<map>
#include<memory>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<double> VD;
typedef pair<int, int> P1;
typedef long long int ll;

//number
#define INF 1e9
#define NUM 1000000007

//itr
#define all(x) begin(x),end(x)

//repeat
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define RREPS(i,x) for(int i=((int)(x));i>=0;i--)

//max,min
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

//function

/*ll gcd(ll a, ll b) {
	if (b == 0) return a;
	else return gcd(b, a%b);
}*/

/*ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	return a * (b / g);
}*/

int dig(int a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}

//grid template
int x[] = { -1, 0, 1, 0 };
int y[] = { 0,-1,0,1 };
int xx[] = { -1,-1,1,1 };
int yy[] = { 1,-1,1,-1 };

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

	int a, b;
	ll sum = 0;
	rep(i, n) {
		cin >> a >> b;
		sum += (b - a + 1);
	}
	cout << sum << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main() {
	int j[36], m, a, o;
	for (a = 1; a <= 7; a++) {
		scanf("%d %d", &m,&o );
		j[a] = m - o;
	}
	for (a = 1; a <= 7; a++) {
		printf("%d\n", j[a]);
	}
	return 0;
}


Measured memory_bytes: 2708
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llu unsigned long long
#define ld double
#define llu unsigned long long
#define rep(i,x,y)  for(int i=x;i<y;++i)
#define For(i,x,y)  for(int i=x;i<=y;++i)
#define FOr(i,x,y)  for(int i=x;i>=y;--i)
#define pi acos(-1)
#define mk make_pair<ll,ll>
#define pa pair<ll,ll>
#define lf else if
#define max(x,y)    ((x)<(y)?(y):(x))
#define min(x,y)    ((x)<(y)?(x):(y))
#define sqr(x)      ((x)*(x))
#define abs(x)      ((x)>0?(x):-(x))
#define Mul(x,y)    (x=1LL*(x)*(y)%mod)
#define Add(x,y)    (x=(x+(y))%mod)
#define Max(x,y)    ((x)=((x)<(y)?(y):(x)))
#define Min(x,y)    ((x)=((x)>(y)?(y):(x)))
#define E(x)        return writeln(x),0
#define p(x)        printf("~%lld~\n",x)
#define pp(x,y)     printf("~~%lld %lld~~\n",x,y)
#define ppp(x,y,z)  printf("~~~%lld %lld %lld~~~\n",x,y,z)
#define pppp(a,b,c,d)	printf("~~~%d %d %d %d\n",a,b,c,d)
#define f_in(x)     freopen(x".in","r",stdin)
#define f_out(x)    freopen(x".out","w",stdout)
#define open(x)     f_in(x),f_out(x)
#define fi first
#define se second
typedef complex<double> E;
namespace SHENZHEBEI{
#ifdef LOCAL
    struct _{_(){freopen("cf.in","r",stdin);}}_;
#endif
#define NEG 1
    inline char gc(){   return getchar();   }
#if NEG
    inline ll read(){    ll x=0,f=1; char ch=gc();   for (;!isdigit(ch);ch=gc()) if (ch=='-') f=-1;  for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x*f; }
    inline void write(ll x){    if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#else
    inline ll read(){    ll x=0; char ch=gc();   for (;!isdigit(ch);ch=gc());    for (;isdigit(ch);ch=gc())  x=x*10-48+ch;   return x;   }
    inline void write(ll x){    if (x>=10)   write(x/10);    putchar(x%10+'0');  }
#endif
    inline char readchar(){ char ch=gc();   for(;isspace(ch);ch=gc());  return ch;  }
    inline ll readstr(char *s){ char ch=gc();   int cur=0;  for(;isspace(ch);ch=gc());      for(;!isspace(ch);ch=gc())  s[cur++]=ch;    s[cur]='\0';    return cur; }
    inline void writeln(ll x){  write(x);   puts("");   }        
    inline ld getreal(){    static ld lbc;  scanf("%lf",&lbc);  return lbc; }
}using namespace SHENZHEBEI;
ll n,m;
signed main(){
	n=read(); m=read();
	if(n>m)swap(n,m);
	if(n==1){
		cout<<(m==1?1:m-2)<<endl;
	}else{
		cout<<(n-2)*(m-2)<<endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<map>
#include<utility>
#include<string>

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

using namespace std;

#define min_3(a, b, c) min(a, min(b, c))
#define max_3(a, b, c) max(a, max(b, c))
typedef long long ll;

int main()
{
    string s, t;
    cin >> s >> t;
    int ans = 0;
    for(int i = 0; i < 3; i++){
        if(s[i] == t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}


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


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

    long long int n,count=0,a,b,i,j;
    cin >> n;
    n=n%1000;
    if(n==0)
    {
        cout << n << endl;
    }
    else
    {
        cout << 1000-n << endl;
    }
    return 0;

}



Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <complex>

using namespace std;
typedef long long ll;

typedef double R;
typedef complex<R> P;

const R EPS = 1e-10;
const R PI = acos(-1);
int sgn(R a) {
    if (a < -EPS) return -1;
    if (a > EPS) return 1;
    return 0;
}


bool near(P a, P b) {
    return !sgn(abs(a-b));
}

double cross(const P &a, const P &b) { return imag(conj(a)*b); }
double dot(const P &a, const P &b) { return real(conj(a)*b); }

int n;
P p[30];
void solve() {
    R res = 0;
    for (int i = 2; i < n; i++) {
        res += abs(cross(p[i-1]-p[0], p[i]-p[0])) / 2.0;
    }
    printf("%.20f\n", res);
}


int main() {
    n = 0;
    while (true) {
        R x, y;
        if (scanf("%lf,%lf", &x, &y) <= 0) break;
        p[n] = P(x, y); n++;
    }
    solve();
    return 0;
}

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

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;

  // sx < sy かつ sy < ty なので、動き方さえ決めれば経路は一つに定まる
  int dx = abs(tx - sx);
  int dy = abs(ty - sy);

  // 解答
  for (int i = 0; i < dx; i++) cout << 'R';
  for (int i = 0; i < dy; i++) cout << 'U';
  for (int i = 0; i < dx; i++) cout << 'L';
  for (int i = 0; i < dy + 1; i++) cout << 'D';
  for (int i = 0; i < dx + 1; i++) cout << 'R';
  for (int i = 0; i < dy + 1; i++) cout << 'U';
  cout << "LU";
  for (int i = 0; i < dx + 1; i++) cout << 'L';
  for (int i = 0; i < dy + 1; i++) cout << 'D';
  cout << 'R' << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>

const int N=201000;

int a[N],b[N];
int n;

bool judge()
{
	for(int i=1;i<=n;i++)
		if(a[i]!=b[i])return 0;
	return 1;
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d%d",a+i,b+i);
	if(judge()){printf("0\n");return 0;}

	long long ans=0,tmp=2147483647;
	for(int i=1;i<=n;i++)
		if(a[i]>b[i])
		{
			tmp=std::min(tmp,1ll*b[i]);
			ans+=a[i]+b[i];
		}
		else ans+=a[i]+b[i];

	if(tmp<2147483647)
		ans-=tmp*2;

	printf("%lld\n",ans/2);

	return 0;
}



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

using i64 = int64_t;

int main(){
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    if(a > w/2 || b > h/2)cout << "No" << endl;
    else{
        for(int i=0;i<h;++i){
            for(int j=0;j<w;++j){
                if(i < b && j < a || i >= b && j >= a)cout << 0;
                else cout << 1;
            }
            cout << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)

using namespace std;
using ll = long long;

void Main() {
	string S; cin >> S;
	ll K; cin >> K;
    int l = S.length();
    char prev = S[0];
    ll cnt = 0;
    FOR(i, 1, l) {
        if (prev == S[i]) {
			++cnt;
			if (i != l - 1) {
				prev = S[i + 1] - 1;
			} else {
				prev = S[0] - 1;
			}
		} else {
			prev = S[i];
		}
    }
    // cout << "1st cnt " << cnt << endl;
    ll cnt2 = 0;
    FOR(i, 0, l) {
        if (prev == S[i]) {
			++cnt2;
			if (i != l - 1) {
				prev = S[i + 1] - 1;
			} else {
				prev = S[0] - 1;
			}
		} else {
			prev = S[i];
		}
    }
    // cout << "2nd cnt " << cnt2 << endl;
    ll cnt3 = 0;
    FOR(i, 0, l) {
        if (prev == S[i]) {
			++cnt3;
			if (i != l - 1) {
				prev = S[i + 1] - 1;
			} else {
				prev = S[0] - 1;
			}
		} else {
			prev = S[i];
		}
    }
    // cout << "3rd cnt " << cnt3 << endl;
    ll res = 0;
    res += cnt; --K;
    res += (K / 2) * (cnt2 + cnt3);
    if (K % 2 == 1) res += cnt2;
    cout << res << endl;
}

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


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.BitSet;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	
	Scanner sc;

	Main() {
		
		sc = new Scanner(System.in);
	}

	int n, m, k, a, b,
		c[][] = new int[50][50];

	void run() {

		for (;;) {

			n = sc.nextInt();
			m = sc.nextInt();
			k = sc.nextInt();
			a = sc.nextInt();
			b = sc.nextInt();
			if ((n | m | k | a -- | b --) == 0) break;

			for (int i = 0; i < n; i++) Arrays.fill(c[i], 0, n, INF);
			for (int i = 0; i < m; i++) {

				int x = sc.nextInt() - 1,
					y = sc.nextInt() - 1;
				c[x][y] = sc.nextInt();
			}
			
			kd();
			if (kq.isEmpty()) System.out.println("None");
			else {
				
				P p = kq.remove();
				int i;
				for (i = 0; i < p.p.length - 1; i ++) {
					
					System.out.print(p.p[i] + 1 + "-");
				}
				System.out.println(p.p[i] + 1);
			}
		}
	}

	class P implements Comparable<P> {

		int d;
		int[] p;
		BitSet s;
		int x;
		
		P(int a, int[] b) {

			d = a;
			p = b;
		}

		@Override
		public int compareTo(P t) {

			if (t == null) return - 1;
			if (d != t.d) return d - t.d;
			for (int i = 0; i < p.length; i ++) {
				
				if (i >= t.p.length) break;
				if (p[i] != t.p[i]) return p[i] - t.p[i];
			}
			return p.length - t.p.length;
		}
	}

	P z = new P(0, null);
	
	Queue<P> kq = new PriorityQueue<P>(200 * 50);
	
	void kd() {
		
		kq.clear();
		BitSet s = new BitSet(n);
		Arrays.fill(d, 0, n, null);
		d(a, 0, new int[]{a}, s);
		if (d[b] == null) return;
		d[b].s = s;
		d[b].x = 1;
		kq.add(d[b]);
		
		for (int i = 1; i < k; i ++) {
			
			if (kq.isEmpty()) break;
			
			P p = kq.remove();
			
			s = p.s.get(0, n);
			s.set(p.p[p.x]);
			int op[] = Arrays.copyOf(p.p, p.x);
			int od = 0;
			Arrays.fill(d, 0, n, null);
			for (int j = 2; j <= p.x; j ++) {
				
				od += c[p.p[j - 2]][p.p[j - 1]];
				d[p.p[j - 2]] = z;
			}
			
			d(p.p[p.x - 1], od, op, s);
			if (d[b] != null) {
				d[b].s = s;
				d[b].x = p.x;
				kq.add(d[b]);
			}
			
			for (int j = p.x + 1; j < p.p.length; j ++) {
				
				s = new BitSet(n);
				s.set(p.p[j]);
				op = Arrays.copyOf(p.p, j);
				od += c[p.p[j - 2]][p.p[j - 1]];
				Arrays.fill(d, 0, n, null);
				for (int k = 2; k <= j; k ++) d[p.p[k - 2]] = z;
				
				d(p.p[j - 1], od, op, s);
				if (d[b] != null) {
					d[b].s = s;
					d[b].x = j;
					kq.add(d[b]);
				}
			}
		}
	}
	
	int INF = 10000 * 50;
	P d[] = new P[50];
	Queue<P> q = new PriorityQueue<P>(50 * 49);

	void a(P p, int f, int t) {
		
		if (c[f][t] >= INF) return;
		P np = new P(p.d + c[f][t], Arrays.copyOf(p.p, p.p.length + 1));
		np.p[np.p.length - 1] = t;
		if (np.compareTo(d[t]) >= 0) return;
		d[t] = np;
		q.add(d[t]);
	}
	
	void d(int a, int od, int[] op, BitSet s) {

		q.clear();
		d[a] = new P(od, op);
		for (int i = 0; i < n; i++) {

			if (s.get(i)) continue;
			a(d[a], a, i);
		}

		while (!q.isEmpty()) {

			P p = q.remove();
			int v = p.p[p.p.length - 1];
			
			if (v == b) break;
			if (p.compareTo(d[v]) > 0) continue;

			for (int i = 0; i < n; i++) a(p, v, i);
		}
	}

	public static void main(String args[]) {
		
		Main m = new Main();
		m.run();
	}
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String n = sc.next();
				
		if(n.contains("7")) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}


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

using namespace std;

int N,A,B,A_col;
vector<int> B_col;
int term,max_col,s,col_t,col_t2,col_t3;

int main()
{
  s = 0;

  cin>>N;
  cin>>A>>B;
  cin>>A_col;

  for(int q = 0;q < N;++q){
    cin>>term;
    B_col.push_back(term);
  }

  sort(B_col.begin(), B_col.end());
  reverse(B_col.begin(), B_col.end());

  max_col = A_col/A;
  col_t = A_col;

  while(1){
    if(s == N){
      break;
    }

    col_t += B_col[s];
    col_t2 = col_t/(A+B*(s+1));

    if(col_t2 > max_col){
      max_col = col_t2;
    }

    s++;
  }

  cout<<max_col<<endl;

  return 0;
}

Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
// #include <numeric> // gcdとかlcmとか C++17から
#include <time.h> // time_t timer; time(&timer); でtimerに現在時刻が代入される．
#include <unistd.h> // sleep関数．引数は秒単位．
using namespace std;

typedef long long ll;


// sortの仕方
// 	■ string s の場合
// 	昇順: sort(s.begin(), s.end())
// 	降順: sort(s.rbegin(), s.rend())
//
// 	■ ll a[N] の場合
// 	昇順: sort(a, a+N)
// 	降順: 不明

// vector の使い方
// 宣言：
// vector<int> v;
// vector<int> v(N);
// 初期化:
// vector<int> v(10, 5); 要素数10，全ての要素の値5．
// vector<int> v = {1, 2, 3};
// 代入：
// v[0] = 3;
// sort:
// sort(v.begin(), v.end());
//

// int alph2int(char character) {
//     int x = character - 'a';
//     return x;
// }

ll my_gcd(ll a, ll b){
	return (b==0) ? a : my_gcd(b, a%b);
}

ll my_lcm(ll a, ll b){
	return a*b / my_gcd(a,b);
}

ll factorial(ll a){
	ll ans = 1;
	for(ll i=a; i>0; i--){
		ans *= i;
	}
	return ans;
}

int main(int argc, char *argv[]){
    string S;
    cin >> S;

    ll ans = 0;
    ll W_count = 0;
    for (int i=S.length(); i>=0; i--) {
        if (S[i] == 'W') {
            W_count++;
        } else {
            ans += W_count;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
    cin >> first;
    IN(rest...);
    return;
}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))

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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

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

int main() {
    SS(ll,N,K)
    SV(ll,V,N);

    ll res = 0;
    rep(r,min(K, N)+1){
        for (int l = 0; r + l <= min(K, N); ++l) {
            vl v;
            ll cur = 0;
            rep(i,r) v.push_back(V[i]), cur += V[i];  //右から取るか左から取るか
            rep(i,l) v.push_back(V[N-1-i]), cur += V[N-1-i];

            sort(v.begin(), v.end());
            for (int i = 0; i < min(K - r - l, (ll)v.size()); ++i) {
                if (v[i] < 0) cur -= v[i];
            }
            chmax(res,cur);
        }
    }
    p(res);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
static const int NMAX = 100000;
static const int INF = (1<<30)-1;
int N,K,x[NMAX+1];

int main(){
  cin >> N >> K;
  for(int i=0;i<N;i++) cin >> x[i];

  int min_time = INF;
  for(int i=0;i<=N-K;i++){
    int right,left;
    left = min(0,x[i]);
    right = max(0,x[i+K-1]);

    int rf_time,lf_time;
    if(left != 0) rf_time = 2*right - left;
    else rf_time = right;

    if(right != 0) lf_time = (-2)*left + right;
    else lf_time = -left;

    min_time = min(min_time,rf_time);
    min_time = min(min_time,lf_time);
  }
  cout << min_time << endl;
  return 0;
}


Measured memory_bytes: 640
/*
 _     _                             
| |__ | |__   __ _  __ _ _   _  __ _ 
| '_ \| '_ \ / _` |/ _` | | | |/ _` |
| |_) | | | | (_| | (_| | |_| | (_| |
|_.__/|_| |_|\__,_|\__, |\__, |\__,_|
                   |___/ |___/       
*/
#include<bits/stdc++.h>

#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define BigInt      __int128
#define endl        '\n'
#define mii         map<ll int,ll int>
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define sim         template < class c
#define ris         return * this
#define dor         > debug & operator <<
#define eni(x)      sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {

using namespace std;

sim > struct rge {c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cout << *x, 0);
sim > char dud(...);
struct debug 
{
	~debug() 
	{ 
		cout<<endl; 
	}
	eni(!=) cout << boolalpha << i; ris; }
	eni(==) ris << range(begin(i), end(i)); }
	sim, class b dor(pair < b, c > d) 
	{
		ris << "(" << d.first << ", " << d.second << ")";
	}
	sim dor(rge<c> d) 
	{
	  	*this << "[";
	  	for (auto it = d.b; it != d.e; ++it)
	    	*this << ", " + 2 * (it == d.b) << *it;
	  	ris << "]";
	}
};
#define fuck(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define N  100005

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
	// cin>>TESTS;
	while(TESTS--)
	{
		ll int s;
		cin >> s;
		ll int dp[s + 1][s + 1];
		memset(dp, 0, sizeof(dp));
		dp[0][0] = 1;
		ll int pref[s + 1];
		for(ll int i = 1; i <= s; i++)
		{
			pref[0] = dp[i - 1][0];
			for(ll int j = 1; j <= s; j++)
			{
				pref[j] = (pref[j - 1] + dp[i - 1][j]) % hell;
			}
			for(ll int j = 0; j <= s; j++)
			{
				if(j - 3 >= 0) dp[i][j] = pref[j - 3];
			}
		}	
		ll int ans = 0;
		for(ll int i = 1; i <= s; i++)
		{
			ans = (ans + dp[i][s]) % hell;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 34816
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <set>
#include <map>

#define FOR0(var, max) for (ul (var) = 0; (var) < (max); ++(var))
#define FORi(var, min, max) for (ul (var) = (min); (var) < (max); ++(var))
#define FORi_INV(var, min, max) for (ul (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;

using sc = signed char;
using si = signed int;
using sl = signed long long int;

template <class T>
T gcd(T a, T b) {
  while (b) {
    T t = a % b;
    a = b;
    b = t;
  }
  return a;
}

const static ui NMAX = 100000;
const static ui MMAX = 100000;
const static ui AiMAX = 1000000000;

static ul N, M;
static ul Ai[NMAX];

void solve(void) {
  priority_queue<ul> queue;
  FOR0(i, N) {
    queue.push(Ai[i]);
  }

  while (M != 0) {
    auto t = queue.top();
    queue.pop();
    queue.push(t / 2);
    M--;
  }

  ul res = 0;
  while (!queue.empty()) {
    res += queue.top();
    queue.pop();
  }
  cout << res << endl;
}

int main(void) {
  cin >> N >> M;
  FOR0(i, N) {
    cin >> Ai[i];
  }
  solve();
  return 0;
}

Measured memory_bytes: 2168
s = input()
z,o,x_z,y_o = 0,0,0,0
for i,k in enumerate(s):
  if (i+1)%2==0:
    if k =='0':
      z+=1
    else:
      o +=1
  else:
    if k =='0':
      x_z +=1
    else:
      y_o += 1
print(min(z,x_z)+min(o,y_o))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const string YES = "Yes";
const string NO = "No";

int main(){
    ll n;
    cin >> n;
    map<ll, ll> a;
    REP(i, n){
        ll ai;
        cin >> ai;
        a[ai]++;
    }

    if(a.size() >= 3){
        cout << NO << endl;
    }else if(a.size() == 1){
        const ll a1 = a.begin()->first;
        if(a1 == n - 1 || a1 <= n / 2){
            cout << YES << endl;
        }else{
            cout << NO << endl;
        }
    }else{
        const ll a1 = a.begin()->first;
        const ll a2 = next(a.begin())->first;
        if(a1 + 1 != a2){
            cout << NO << endl;
        }else{
            const ll m2 = a[a2];
            const ll b2 = a2 - a[a1];
            if(m2 >= 2 && b2 > 0 && 2 * b2 <= m2){
                cout << YES << endl;
            }else{
                cout << NO << endl;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 9864
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
#include<unordered_map>
#include<sstream>
#include<numeric>
#include<stack>
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 1LL<<60;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------

int main(){
  int m,f,b;
  cin >> m >> f >> b;
  if(m+f < b){
    cout << "NA" << endl;
  }else{
    cout << max(0,b-m) << endl;
  }
  return 0;
}



Measured memory_bytes: 3104
N = int(input())
S = list(input())
pas = []
for i in range(10):
    for j in range(10):
        for k in range(10):
            pas.append(str(i)+str(j)+str(k))
ans = 0
for pw in pas:
    if pw[0] in S:
        ind = S.index(pw[0])
        tmp = S[ind+1:]
    else:
        continue
    if pw[1] in tmp:
        ind = tmp.index(pw[1])
        tmp = tmp[ind+1:]
    else:
        continue
    if pw[2] in tmp:
        ans += 1
print(ans)

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


int main(){
	int n;
	string s,s2;
	cin >> n >> s >> s2;
	
	for(int i=0;i<n;i++){
		cout << s[i] << s2[i];
	}
	cout << endl;
	return 0;
}

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

typedef pair<int, int> P;
int n = 2;
int m = 2;
map<P, vector<int>> e;

void dfs(int l) {
  if (l == 2) {
    e[P(1, 2)].push_back(0);
    e[P(1, 2)].push_back(1);
  } else if (l % 2 == 0) {
    dfs(l / 2);
    for (auto edge: e) {
      P p = edge.first;
      for (int i = 0; i < e[p].size(); i++) {
        e[p][i] *= 2;
      }
    }
    e[P(n, n + 1)].push_back(0);
    e[P(n, n + 1)].push_back(1);
    n += 1;
    m += 2;
  } else {
    dfs(l - 1);
    e[P(1, n)].push_back(l - 1);
    m++;
  }
}

void Main() {
  int l;
  cin >> l;

  dfs(l);

  cout << n << " " << m << endl;
  for (auto edge: e) {
    P p = edge.first;
    for (int i = 0; i < e[p].size(); i++) {
      cout << p.first << " " << p.second << " " << edge.second[i] << endl;
    }
  }
}

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



Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n+m; i++)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main() {
    vector<int> A(3);
    int result = 0;
    REP(i, 3) {
        cin >> A[i];
    }
    sort(ALL(A));
    while (A[0] != A[1] || A[1] != A[2] || A[0] != A[2]) {
        if (A[1] != A[2]) {
            A[0]++;
            A[1]++;
        } else {
            if (A[1] - A[0] == 1) {
                A[1]++;
                A[2]++;
            } else {
                A[0] += 2;
            }
        }
        result++;
    }
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef vector<int>   vi;
typedef vector<long long> vll;
typedef vector<pair<int,int> > vii;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pq priority_queue
#define mii map<int,int>
#define sf1(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
int inf = (1e9) + 7;
int mod = 998244353;





int main(){

    string s;
    cin >> s;



    for (int i = 0; i < s.size()-1; ++i)
    {
        if(s[i] == 'A' and s[i+1] == 'C')
        {
            printf("Yes\n");
            return 0;
        }
    }
    printf("No\n");
}   

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll a1,a2,a3;
	cin>>a1>>a2>>a3;
	if(a1+a2+a3>=22){
		cout <<"bust";
	}
	else{
		cout << "win";
	}
	// your code goes here
	return 0;
}

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


int main(){
  string A,B;
  cin >> A >> B;
  
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  reverse(B.begin(),B.end());
  
  if(A<B)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  
 }



Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

template <class RandomIt>
size_t lcsubsequence(
    RandomIt first1, RandomIt last1, RandomIt first2, RandomIt last2
) {
    vector<vector<size_t>> dp(last1-first1+1, vector<size_t>(last2-first2+1));
    for (RandomIt it=first1; it<last1; ++it)
        for (RandomIt it2=first2; it2<last2; ++it2) {
            if (*it == *it2) {
                dp[it-first1+1][it2-first2+1] = dp[it-first1][it2-first2] + 1;
            } else {
                dp[it-first1+1][it2-first2+1] = max(
                    dp[it-first1][it2-first2+1], dp[it-first1+1][it2-first2]
                );
            }
        }

    return dp[last1-first1][last2-first2];
}

int main() {
    size_t q;
    scanf("%zu", &q);

    for (size_t i=0; i<q; ++i) {
        char buf[1<<10];
        scanf("%s", buf);
        string X(buf);

        scanf("%s", buf);
        string Y(buf);

        printf("%zu\n", lcsubsequence(X.begin(), X.end(), Y.begin(), Y.end()));
    }

    return 0;
}

Measured memory_bytes: 10352
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define All(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()   //reverse
#define strall(v) (v).cbegin(),(v).cend() //const_itterator
#define IN(a, b, x) (a<=x&&x<b)
using namespace std;
using ll = long long;
using Pair = pair<int,int>;
using Graph = vector<vector<ll>>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename t, typename u, typename Comp=less<>>
bool chmax(t& xmax, const u& x, Comp comp={}) { if(comp(xmax, x)) { xmax = x; return true; } return false;}
template<typename t, typename u, typename Comp=less<>>
bool chmin(t& xmin, const u& x, Comp comp={}) { if(comp(x, xmin)) { xmin = x; return true;} return false;}
const int INF = 1e9;
const ll infl = ll(1e18)+5;

/*
*ios::sync_with_stdio(false);
*cin.tie(0);
*/
int main(){
  string s1,s2;
  cin >> s1 >> s2;
  if(s1.size() > s2.size()){
    cout << "GREATER" << endl;
  }else if(s1.size() < s2.size()){
    cout << "LESS" << endl;
  }else{
    for(int i = 0;i<s1.size();i++){
      if(s1[i] > s2[i]){
        cout << "GREATER" << endl;
        return 0;
      }else if(s1[i] < s2[i]){
        cout << "LESS" << endl;
        return 0;
      }
    }
    cout << "EQUAL" << endl;
  }
}

Measured memory_bytes: 256
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

    private static PrintWriter out;

    private static <T> void mprintln(T ... ar){
        for(T i: ar) out.print(i + " ");
        out.println();
    }

    public static void main(String[] args) throws FileNotFoundException{

        // Input from file
        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);
        // Here it ends

        MyScanner sc = new MyScanner();
        // MyScanner sc = new MyScanner(fileReader);

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file

        getAns(sc);

        out.close();
    }

    /*
     *Don't use builtin function (Math.ceil)
     */

    static final long MOD = (long) (1e9 + 7);

    private static void getAns(MyScanner sc){
        int n = sc.ni();
        int[] ar = sc.niArr0(n);
        int mid = Arrays.stream(ar).sum() / n;
        out.println(Math.min(cost(mid, ar), cost(mid + 1, ar)));
    }

    private static int cost(int n, int[] ar) {
        return Arrays.stream(ar).map(in -> (int) Math.pow(in - n, 2)).sum();

    }

    static class MyScanner{
        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader){
            br = new BufferedReader(fileReader);
        }

        MyScanner(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch(IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc(){
            return nn().charAt(0);
        }

        int ni(){
            return Integer.parseInt(nn());
        }

        long nl(){
            return Long.parseLong(nn());
        }

        double nd(){
            return Double.parseDouble(nn());
        }

        int[] niArr0(int n){
            int[] ar = new int[n];
            for(int i = 0; i < n; i++) ar[i] = ni();
            return ar;
        }

        int[] niArr1(int n){
            int[] ar = new int[n + 1];
            for(int i = 1; i <= n; i++) ar[i] = ni();
            return ar;
        }

        long[] nlArr0(int n){
            long[] ar = new long[n];
            for(int i = 0; i < n; i++) ar[i] = nl();
            return ar;
        }

        long[] nlArr1(int n){
            long[] ar = new long[n + 1];
            for(int i = 1; i <= n; i++) ar[i] = nl();
            return ar;
        }
    }
}

Measured memory_bytes: 28756