akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.Scanner;
import java.util.OptionalInt;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] p = new int[N];
            for (int i = 0; i < N; i++) {
                p[i] = in.nextInt();
            }
            int max = Arrays.stream(p).max().getAsInt();
            int sum = Arrays.stream(p).sum();
            out.println(sum - max / 2);
        }

    }
}



Measured memory_bytes: 27732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
int main() {
    string s, t;
    ll ans = 1e5;
    cin >> s >> t;
    rep(i, s.length() - t.length() + 1){
        ll x = 0;
        for (int j = i; j < i + t.length(); j++) {
            if (s[j] != t[j - i]) {
                x++;
            }
        }
        ans = min(ans, x);
    }
    
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3632
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (a, b, c) = scan!(i64, i64, i64);
    if (b - a) == (c - b) {
        println!("YES")
    } else {
        println!("NO")
    }
}


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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;


void Main() {
  ld n, d;
  cin >> n >> d;

  ll ans = ceil(n / (2 * d + 1));

  COUT(ans);
    
}


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

/*

3 2
*/


Measured memory_bytes: 3740
#include <bits/stdc++.h>
#define debug(x) cerr << #x << ": " << x << '\n';
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;

int H, W;
char grid[2000][2000];
P num[2000][2000];

int dfs_y(int y, int x, int cnt){
	if(num[y][x].first > 0) return num[y][x].first;
	if(y+1 < H and grid[y+1][x] == '.'){
		num[y][x].first = dfs_y(y+1, x, cnt+1);
	}else{
		num[y][x].first = cnt;
	}

	return num[y][x].first;
}

int dfs_x(int y, int x, int cnt){
	if(num[y][x].second > 0) return num[y][x].second;
	if(x+1 < W and grid[y][x+1] == '.'){
		num[y][x].second = dfs_x(y, x+1, cnt+1);
	}else{
		num[y][x].second = cnt;
	}

	return num[y][x].second;
}

int main(void){
	cin >> H >> W;
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			cin >> grid[i][j];
		}
	}

	int res = 0;
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			if(grid[i][j] == '#') continue;
			dfs_y(i, j, 1);
			dfs_x(i, j, 1);
			res = max(res, num[i][j].first + num[i][j].second - 1);
		}
	}

	cout << res << '\n';

	return 0;
}

Measured memory_bytes: 35456
#include<iostream>
#include<string>
using namespace std;
int main(){
	string s;
	long long k;
	cin>>s>>k;
	long long sum=0;
	long long i=0;
	for(i=0;i<s.length();i++){
		if(s[i]=='1')sum++;
		else break;
	}
	if(k>sum)printf("%c\n",s[i]);
	else printf("1\n");
}

Measured memory_bytes: 256
#define taskname "test"

#include <bits/stdc++.h>

using namespace std;

#define sz(x) (int)x.size()
#define fi first
#define se second

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

const int maxn = 2e5 + 5;

int n, m;
vector<int> gr[maxn];

bool vis[maxn];

void read_input()
{
    cin >> n >> m;
    for(int i = 1; i <= m; ++i)
    {
        int u, v;
        cin >> u >> v;
        gr[u].push_back(v);
        gr[v].push_back(u);
    }
}

void dfs(int u, int&cnt)
{
    vis[u] = true;
    ++cnt;
    for(auto&v: gr[u])
        if(!vis[v]) dfs(v, cnt);
}

void solve()
{
    int ans = 0;
    for(int i = 1; i <= n; ++i)
    {
        if(vis[i]) continue;
        int cnt = 0;
        dfs(i, cnt);
        ans = max(ans, cnt);
    }
    cout << ans << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    read_input();
    solve();
}



Measured memory_bytes: 24120
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define PI (acos(-1))

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	string s;
	cin>>s;
	vector<char> cnt;
	map<char,int> cnt2;
	for(char x='A';x<='Z';x++) cnt.push_back(x);
	int now=0;
	for(char x='A';x<='Z';x++){
		cnt.push_back(x);
		cnt2[x]=now;
		now++;
	}
	rep(i,s.size()){
		s[i]=cnt[cnt2[s[i]]+n];
	}
	cout<<s<<endl;
}

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


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

    int a[200000];

    bool no_one = true;
    for (int i = 0; i < N; i++) {
    	cin >> a[i];
    	if (a[i] == 1) no_one = false;
    }

    if (no_one) {
    	cout << -1 << endl;
    	return 0;
    }

    int ans = 0;
    int k = 1;
    for (int i = 0; i < N; i++) {
    	if (a[i] == k) {
    		k++;
    	} else {
    		ans++;
    	}
    }

    cout << ans << endl;

    return 0;
}

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

public class Main{
	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static int mod = (int) (1e9+7),n;
	static long cf = 998244353;
    static final int MAX = (int) 1e6;
    public static List<Integer>[] edges;
    public static int[][] parent;
    public static int col = 20;
    public static long[] Bit;
    public static long[] fac,inv;
    public  static int[] prime; 
    public static long[] dp;
	public static FastReader sc = new FastReader();
	public static void main(String[] args) {
	//	Scanner sc = new Scanner(System.in);
 
		String s = sc.next();
		int ans = 7;
		if(s.equals("MON")) ans=6;
		else if(s.equals("TUE")) ans = 5;
		else if(s.equals("WED")) ans = 4;
		else if(s.equals("THU")) ans = 3;
		else if(s.equals("FRI")) ans = 2;
		else if(s.equals("SAT")) ans = 1;
		out.print(ans);
		out.close();
	}
	
	
}

Measured memory_bytes: 21076
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <queue>
#include <deque>

using namespace std;

int main(){
    int n; cin >> n;
    bool ans=false;
    for(int i=1; i<=9; ++i){
        if(n%i==0 && 1<=(n/i) && (n/i)<=9){
            ans=true;
            break;
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int h,w,d;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int col[4001][4001];
int ng[501][501];
int ans[501][501];

int main(void){
	scanf("%d%d%d",&h,&w,&d);
	memset(col,-1,sizeof(col));
	for(int i=0;i<2000;i+=d*2){
		for(int j=0;j<2000;j+=d*2){
			for(int k=0;k<d;k++){
				for(int l=0;l<d;l++){
					col[i+k][j+l]=0;
					col[i+k][j+d+l]=1;
					col[i+d+k][j+d+l]=2;
					col[i+d+k][j+l]=3;
				}
			}
		}
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			ans[i][j]=col[500+i+j][500+i-j];
		}
	}

	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(ans[i][j]==0)printf("R");
			if(ans[i][j]==1)printf("G");
			if(ans[i][j]==2)printf("B");
			if(ans[i][j]==3)printf("Y");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 64000
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;

long long int N, M, K, H, W, L, R;

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

	cin >> N >> M;
	cout << N*N - M << endl;
	return 0;
}


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

using namespace std;

int main()
{
    ios::sync_with_stdio(false);

    int N, M;
    cin >> N >> M;

    int L, R;
    cin >> L >> R;

    int a = L, b = R;

    while (--M)
    {
        cin >> L >> R;

        a = max(a, L);
        b = min(b, R);

        if (b < a)
        {
            cout << 0 << endl;
            return 0;
        }
    }

    cout << b - a + 1 << '\n';

    return 0;
}


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

typedef long long ll;

using namespace std;

const int maxn = 1e5 + 10, mod = 1e9 + 7;
ll dp[maxn][14];
map<int, int> m;

int main()
{
    string s;
    cin >> s;

    for (int i = 0; i < 13; i++)
        for (int j = 0; j < 13; j++)
            if ((j * 10) % 13 == i)
                m[i] = j;

    for (int i = 0; i < s.size(); i++)
        for (int j = 0; j < 13; j++)
            if (!i)
            {
                if (s[i] == '?')
                    dp[i][j] = (j < 10);
                else
                    dp[i][j] = (j == (s[i] - '0'));
            }
            else if (s[i] == '?')
                for (int t = 0; t < 10; t++)
                    dp[i][j] = (dp[i][j] + dp[i - 1][m[(j - t + 13) % 13] % 13]) % mod;
            else
                dp[i][j] = (dp[i - 1][m[(j - (s[i] - '0') + 13) % 13] % 13]);

    cout << dp[s.size() - 1][5];

    return 0;
}

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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair


const int MAXN = 3010;

vl fact(MAXN);
vl rfact(MAXN);

ll mod_pow(ll x, ll p, ll M = MOD) {
	ll a = 1;
	while (p) {
		if (p % 2)
			a = a*x%M;
		x = x*x%M;
		p /= 2;
	}
	return a;
}

ll mod_inverse(ll a, ll M = MOD) {
	return mod_pow(a, M - 2, M);
}

void set_fact(ll n, ll M = MOD) {
	fact[0] = fact[1] = rfact[0] = rfact[1] = 1;
	for (ll i = 2; i <= n; i++) {
		fact[i] = i * fact[i - 1] % M;
		rfact[i] = mod_inverse(fact[i], M);
	}
}

//http://drken1215.hatenablog.com/entry/2018/06/08/210000
//nが大きくfactが計算できないときのほかの計算方法について書いてある
ll nCr(ll n, ll r, ll M = MOD) {
  if (r > n) return 0;
  ll ret = fact[n];
  ret = (ret*rfact[r]) % M;
  ret = (ret*rfact[n - r]) % M;
  return ret;
}


int main() {
  int n, a, b, c, d;
  cin >> n >> a >> b >> c >> d;
  set_fact(n + 5);
  vll dp(b + 1, vl(n + 1));
  dp[a - 1][0] = 1;
  rep (i, b) {
    rep (j, n + 1) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j] %= MOD;
      for (int k = c; k <= d; k++) {
        if (j + (i + 1) * k > n) break;
        dp[i + 1][j + (i + 1)*k] += dp[i][j] * fact[n - j] % MOD * rfact[k] % MOD * rfact[(n - j) - k*(i + 1)] % MOD * mod_inverse(mod_pow(fact[i + 1], k)) % MOD;
        dp[i + 1][j + (i + 1) * k] %= MOD;
      }
    }
  }
  cout << dp[b][n] << endl;
}


Measured memory_bytes: 8192
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    
    for(let i=1; i<10; i++) {
       for(let j=1; j<10; j++) {
            if(i * j === N) {
                console.log("Yes");
                return;
            }
        } 
    }
    
    console.log("No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long m = in.nextLong();
        System.out.println(2*n > m ? m/2 : n+(m-2*n)/4);
	}
	
	
}


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

#define MOD 1000000007
#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()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

struct UnionFind{
  ll N;
  llvec p;
  llvec cnt;
  UnionFind(ll n){
    N = n;
    p=llvec(N);
    cnt=llvec(N, 0);
    rep(i, N){
      p[i] = i;
      cnt[i] = 1;
    }
  }

  void con(ll a, ll b){
    P at = root(a);
    P bt = root(b);
    if(at.second!=bt.second){
      if(at.first>bt.first){
        swap(at, bt);
        swap(a, b);
      }
      p[at.second] = bt.second;
      cnt[bt.second]+=cnt[at.second];
      p[a]=bt.second;
    }
  }

  P root(ll a){
    ll atmp = a;
    ll c=0;
    while(atmp!=p[atmp]){
      atmp = p[atmp];
      c++;
    }
    p[a] = atmp;
    return {c, atmp};
  }

  bool is_con(ll a, ll b){
    P at=root(a);
    P bt=root(b);
    return at.second == bt.second;
  }
  
};

struct dijkstra{
  ll N;
  llvec d;
  vector<vector<edge>> e;
  dijkstra(ll n){
    N = n;
    //d = llvec(N, 1e18);
    e = vector<vector<edge>>(N);
  }

  void add_edge(ll from, ll to, ll cost){
    e[from].push_back({to, cost});
  }

  void run(ll start){
    priority_queue<P, vector<P>, greater<P>> que;
    que.push({0, start});
    d = llvec(N, 1e18);
    d[start]=0;
    while(!que.empty()){
      P q = que.top();que.pop();
      ll dc = q.first;
      ll x = q.second;
      if(dc>d[x]){
        continue;
      }else{
        for(auto ip: e[x]){
          if(d[ip.x]<=d[x]+ip.c){
            continue;
          }else{
            d[ip.x]= d[x]+ip.c;
            que.push({d[ip.x], ip.x});
          }
        }
      }
    }
  }  
};


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll A;
  ld B;
  cin >> A >> B;
  cout << setprecision(18) << floor(A * B);
  return 0;
}


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

using namespace std;

using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;

#ifdef WIN32
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

const int maxn = 5005;
const int MOD = 1000000007;

int cnk[maxn][maxn];
int A, B, C;
int n;

ll get(ll a, ll b)
{
    if (a == 0 && b > 0) return 0;
    if (a == 0 && b == 0) return 1;
    return cnk[a + b - 1][a - 1];
}

ll calc(ll a, ll b, ll c, ll d)
{
//     cout << "calc " << a << ' ' << b << ' ' << c << ' ' << d << ' ' << endl;
    if (d < 0) return 0;
    if (a + b + c + d > n) return 0;
    return (((ll)cnk[a + b][b] * cnk[a + b + c][c]) % MOD * cnk[a + b + c + d][d]) % MOD;
}

int main()
{
    scanf("%d%d%d%d", &n, &A, &B, &C);
    if (B % 2 == 1)
    {
        cout << 0 << endl;
        return 0;
    }
    cnk[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        cnk[i][0] = 1;
        for (int j = 1; j <= i; j++) cnk[i][j] = (cnk[i - 1][j - 1] + cnk[i - 1][j]) % MOD;
    }
    ll answer = 0;
    for (int x = 0; x <= C; x++)
    {
        for (int y = 0; 3 * y + x <= C; y++)
        {
            ll curans = calc(B / 2, y, C - 3 * y - x, A - (C - 3 * y - x));
//             cout << x << ' ' << y << ' ' << curans << endl;
            curans = ((ll)curans * get(B / 2, x)) % MOD;
//             cout << curans << endl;
            answer = (answer + curans) % MOD;
        }
    }
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 67200
#include <stdio.h>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){

	int N,W;
	scanf("%d %d",&N,&W);

	int w[N],v[N];

	int** dp = new int*[W+1];
	for(int i=0; i < W+1; i++){
		dp[i] = new int[N+1];
		for(int k=0; k < N+1; k++)dp[i][k] = 0;
	}

	for(int i=0; i < N; i++){
		scanf("%d %d",&v[i],&w[i]);
	}


	for(int i = N-1; i >= 0; i--){
		for(int k = 1; k <= W; k++){
			if(w[i] <= k){
				dp[k][i] = max(dp[k][i+1],dp[k-w[i]][i+1] + v[i]);
			}else{
				dp[k][i] = dp[k][i+1];
			}
		}
	}

	printf("%d\n",dp[W][0]);

    return 0;
}

Measured memory_bytes: 6872
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define deci fixed<<showpoint<<setprecision //<<deci()<<
#define ll long long
#define mod 1000000007
#define endl "\n"
using namespace std;
double pi = acos(-1);
ll n;
int main() {
	IOS
		cin >> n;
	cout << ((n*(n + 1) / 2) - n);
}

Measured memory_bytes: 256
A,B,C,X,Y = map(int, input().split())
if X >= Y:
  H = A*X + B*Y
  I = A*(X-Y)+C*Y*2
  J = C*X*2
else:
  H = A*X + B*Y
  I = B*(Y-X)+C*X*2
  J = C*Y*2
print(min(H,I,J))

Measured memory_bytes: 3060
N=list(input())
a=[chr(i) for i in range(97, 97+26)]
d={a[i]:0 for i in range(len(a))}

for x in N:
    d[x]+=1
i=0
while i<=len(a)-1:
    if d[a[i]]==0:
        print(a[i])
        break
    i+=1
else:
    print('None')
    





Measured memory_bytes: 3956
n = int(input())
l = [int(a) for a in input().split()]
l.sort()
count=0
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if((l[i]+ l[j] > l[k] )&( l[i] != l[j] != l[k])):
                count += 1
print(count)


Measured memory_bytes: 9168
import scala.io.StdIn.readLine

object Main extends App {
  def read(e:Double,n:Double,angle:Double):(Double,Double) = {
    val l = readLine.split(",").map(_.toDouble);val x=l(0);val y=l(1)
    if(x==0 && y==0) (e,n)
    else read(e+x*Math.cos(Math.toRadians(angle)),n+x*Math.sin(Math.toRadians(angle)),angle-y)
  }
  val (e,n) = read(0,0,90)
  println(e.toInt)
  println(n.toInt)
}

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

int n;
vector<int> G[108000];
int dist[108000], U, V;
bool cor[108000];

void dfs(int v, int p, int d)
{
    dist[v] = d;
    for(int &u : G[v])
        if(u != p)
            dfs(u, v, d + 1);
}

void solve(int v, int p, int d)
{
    cor[v] = true;
    for(int &u : G[v])
        if(u != p and dist[u] > d)
            solve(u, v, d + 1);
}

int32_t main()
{
    cin >> n >> U >> V;
    for(int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        G[u].push_back(v);
        G[v].push_back(u);
    }    
    dfs(V, -1, 0);
    solve(U, -1, 0);
    int ans = 0;
    for(int i = 1; i <= n; i++)
        if(cor[i])
            ans = max(ans, dist[i] - 1);
    cout << ans << '\n';
    
    return 0;
}

Measured memory_bytes: 10496
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<vector<int>> w;
  for (int i = 0; i < n; i++) {
    vector<int> temp;
    for (int j = 0; j < 3; j++) {
      int k;
      cin >> k;
      temp.push_back(k);
    }
    w.push_back(temp);
  }

  vector<vector<int>> dp;
  pair<int, int> temp(0, 0);

  dp.push_back(w[0]);

  for (int i = 1; i < n; i++) {
    vector<int> temp;

    for (int j = 0; j < 3; j++) {
      temp.push_back(w[i][j] + (dp[i - 1][(j + 1) % 3] > dp[i - 1][(j + 2) % 3]
                                    ? dp[i - 1][(j + 1) % 3]
                                    : dp[i - 1][(j + 2) % 3]));
    }

    dp.push_back(temp);
  }

  int ans = dp[n - 1][0];
  for (int i = 1; i < 3; i++) {
    ans = ans > dp[n - 1][i] ? ans : dp[n - 1][i];
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 12208
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<int, int>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int k, q;
    cin, k, q;
    vector<ll> d(k);
    REP(i, 0, k) {
        cin, d[i];
    }
    REP(_, 0, q) {
        ll n, x, m;
        cin, n, x, m;
        x %= m;
        auto cp = d;
        ll zeros = 0;
        ll last = 0;
        REP(i, 0, k) {
            cp[i] %= m;
            zeros += (cp[i] == 0);
            last += cp[i];
        }
        n--;
        last *= n / k;
        last += x;
        zeros *= n / k;
        REP(i, 0, n % k) {
            zeros += (cp[i] == 0);
            last += cp[i];
        }
        cout << n - zeros - last / m << endl;
    }

    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[200005];
bool cmp(int x,int y){
	return x>y;
}
signed main(){
	int n,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n,cmp);
	int tot=n-1;
	for(int i=0;i<n;i++){
		if(tot) ans+=a[i],tot--;
		if(tot&&i) ans+=a[i],tot--;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 5120
/*   _ _ _                     
    | | | | ___  ___           
    | | | || . ||  _|          
    |_____||_  ||_|  _____     
             |_|    |_____|  */
// Time : 19/10/20
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
const int nmax = 300 + 30;
int dis1[nmax][nmax], dis2[nmax][nmax];
int main(){
#ifdef Wqr_
    freopen("in.txt","r",stdin);
#endif
    std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n, m, l;
    cin >> n >> m >> l;
    int a, b, c;
    memset(dis1, inf, sizeof(dis1));
    memset(dis2, inf, sizeof(dis2));
    for(int i = 0; i < m; i++){
        cin >> a >> b >> c;
        --a, --b;
        dis1[a][b] = c;
        dis1[b][a] = c;
    }
    for(int i = 0; i < n; i++){
        dis1[i][i] = dis2[i][i] = 0;
    }
    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                dis1[i][j] = min(dis1[i][j], dis1[i][k] + dis1[k][j]);
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(dis1[i][j] <= l){
                dis2[i][j] = 1;
                dis2[j][i] = 1;
            }
        }
    }
    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                dis2[i][j] = min(dis2[i][j], dis2[i][k] + dis2[k][j]);
            }
        }
    }
    int q;
    cin >> q;
    for(int i = 0; i < q; i++){
        cin >> a >> b;
        --a, --b;
        if(dis2[a][b] == inf) dis2[a][b] = 0;
        cout << (dis2[a][b] - 1) << endl;
    }
    return 0;
}

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

int main() {
  double a, b, c, d, e, f;
  double x, y;
  while (cin >> a >> b >> c >> d >> e >> f) {
    y = (c*d - a*f) / (b*d - a*e);
    x = (c - b*y) / a;
    printf("%.3f %.3f\n", x, y);
  }
  return 0;
}

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

// @@ !! LIM()

struct MyExc : exception {};

int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N, M; cin >> N >> M;
  using StA = pair<ll, ll>;
  vector<vector<StA>> nbr(N+1);
  for (ll i = 0; i < M; i++) {
    ll l, r, d; cin >> l >> r >> d;
    nbr.at(l).emplace_back(r, d);
    nbr.at(r).emplace_back(l, -d);
  }
  vector<bool> seen(N+1);
  vector<ll> pos(N+1);

  auto dfs = [&](const auto& rF, ll i, ll p) -> void {
    if (seen.at(i)) {
      if (pos.at(i) != p) throw MyExc();
      else return;
    }
    seen.at(i) = true;
    pos.at(i) = p;
    for (auto [x, d] : nbr.at(i)) {
      rF(rF, x, p + d);
    }
  };
  try {
    for (ll i = 1; i <= N; i++) {
      if (seen.at(i)) continue;
      dfs(dfs, i, 0);
    }
  }catch(const MyExc& e) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  return 0;
}



Measured memory_bytes: 19424
object Main extends App {
  import scala.io.StdIn._

  val Array(n, h) = readLine.trim.split(' ').map(_.toInt)
  var health = h
  var success = 0
  var fail = 0
  val words = Array.tabulate(n){_ ⇒ readLine.trim.split(' ')}
  for (Array(target, tolerance) ← words if health != 0){
    stage(target, tolerance.toInt) match {
      case Right(f) ⇒
        success += target.length
        fail += f
      case Left(s) ⇒
        health -= 1
        success += s
        fail += tolerance.toInt + 1
    }
  }
  if (health != 0){
    println(s"! Game Clear ${success * 100 / (success + fail)}.${(success * 1000 / (success + fail)) % 10}")
  }else {
    println("! Game Over")
  }


  def stage(target: String, initTolerance: Int): Either[Int, Int] = {
    val state = target.toCharArray
    def sub(position: Int, tolerance: Int): Either[Int, Int] = {
      if (position < state.length){
        println(s"? ${state.mkString}")
        val input = readChar
        if (target(position).toLower == input){
          state(position) = '_'
          sub(position + 1, tolerance)
        }else if (tolerance == 0) Left(position)
        else sub(position, tolerance - 1)
      }else Right(initTolerance - tolerance)
    }
    sub(0, initTolerance)
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def let[A](func: T ⇒ A): A = func(value)
    @inline
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}


Measured memory_bytes: 49208
#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>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
using namespace std;
#define fast_io ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#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()

typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

ll mpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
  else return mpow(a,b-1) * a % MOD;
}
ll lpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = lpow(a,b/2); return memo*memo;}
  else return lpow(a,b-1) * a;
}
ll gcd(ll a, ll b){
  if(b==0) return a;
  else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
  if(kaijo_memo.size() > n) return kaijo_memo[n];
  if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
  while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % MOD);
  return kaijo_memo[n];
}
vector<ll> gyaku_kaijo_memo;
ll gyaku_kaijo(ll n){
  if(gyaku_kaijo_memo.size() > n) return gyaku_kaijo_memo[n];
  if(gyaku_kaijo_memo.size() == 0) gyaku_kaijo_memo.push_back(1);
  while(gyaku_kaijo_memo.size() <= n) gyaku_kaijo_memo.push_back(gyaku_kaijo_memo[gyaku_kaijo_memo.size()-1] * mpow(gyaku_kaijo_memo.size(), MOD-2) % MOD);
  return gyaku_kaijo_memo[n];
}

ll nCr(ll n, ll r){
  if(n == r) return 1;//0個の丸と-1個の棒みたいな時に時に効く？不安.
  if(n < r || r < 0) return 0;
  ll ret = 1;
  if(n <= 1e7){
    ret *= kaijo(n); ret %= MOD;
    ret *= gyaku_kaijo(r); ret %= MOD;
    ret *= gyaku_kaijo(n-r); ret %= MOD;
  }else{
    rep(i,r){
      ret *= n-i; ret %= MOD;
      ret *= mpow(r-i, MOD-2); ret %= MOD;
    }
  }
  return ret;
}


int main(void){
  fast_io
  cout<<fixed<<setprecision(15);

  string s;cin>>s;
  string t = "";
  int q;cin>>q;
  int rev = 0;
  rep(_t,q){
    int mode;
    cin>>mode;
    if(mode==1){
      rev = (rev + 1) % 2;
    }else{
      int f; string c;
      cin>>f>>c;
      f %= 2;
      if(rev + f == 1){
        t += c;
      }else{
        s += c;
      }
    }
  }
  reverse(all(t));
  s = t + s;
  if(rev){
    reverse(all(s));
  }
  rep(i,s.size()){
    cout<<s[i];
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 1196
n = int(input())
x_list = list(map(int, input().split()))

temp_sum = 0
ans = 10 ** 9

for p in range(100):
    for x in x_list:
        temp_sum += (x - p) ** 2
    if temp_sum < ans:
        ans = temp_sum
    temp_sum = 0

print(ans)

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

int dp[2][1 << 20];
char s[21][21];
int main() {
	int m, n; scanf("%d%d", &m, &n);
	int cnt = 1;
	rep(i, m)scanf("%s", s[i]);
	rep(i, m)rep(j, n) {
		if (s[i][j] == '?')cnt = (cnt * 3) % MOD;
	}
	int*now = dp[0], *nxt = dp[1];
	now[0] = 1;
	rep(i, m)rep(j, n) {
		fill(nxt, nxt + (1 << n), 0);
		rep(k, 1 << n) {
			if (now[k] == 0)continue;
			if (s[i][j] != '?') {
				if ((k >> j & 1) && s[i][j] == 'I')continue;
				if (j && (k >> (j - 1) & 1) && s[i][j] == 'O')(nxt[k&~(1 << j)] += now[k]) %= MOD;
				else {
					int a = k&~(1 << (j - 1));
					if (j < n - 1 && s[i][j] == 'J')(nxt[a | 1 << j] += now[k]) %= MOD;
					else(nxt[a&~(1 << j)] += now[k]) %= MOD;
				}
				continue;
			}
			int a = k&~(1 << (j - 1));
			if (j < n - 1)(nxt[a | 1 << j] += now[k]) %= MOD;
			else(nxt[a] += now[k]) %= MOD;
			(nxt[k&~(1 << j)] += now[k]) %= MOD;
			if (!(k >> j & 1))(nxt[a&~(1 << j)] += now[k]) %= MOD;
		}
		swap(now, nxt);
	}
	rep(i, 1 << n)cnt = (cnt + MOD - now[i]) % MOD;
	printf("%d\n", cnt);
}

Measured memory_bytes: 11364
#include<iostream> 
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <vector>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)



int main() {
	long long int h, w,ans,ans2=0;
	cin >> h >> w;
	/*if (h % 2 == 0) {
		ans = h / 2;
		ans2 = ans;
	}
	else {
		ans = h /2 +1;
		ans2 = h - ans;
	}
	if (w % 2 == 0) {
		ans *= w / 2;
		ans2 = ans;
	}
	else {
		ans *= w / 2+1;
		ans2 *= w -( w / 2 + 1);
	}

	cout << ans2+ans << endl;*/
	if (h ==1 || w == 1) {
		cout << 1 << endl;
		return 0;
	}

	if (h * w % 2 != 0) {
		cout << h * w / 2 + 1 << endl;
	}
	else {
		cout << h * w / 2 << endl;
	}
	return 0;
}

Measured memory_bytes: 3564
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<utility>
#include<fstream>
using namespace std;
typedef long long ll;
#define rep(i,k) for(i=0;i<k;i++)
#define P pair<int,int>
ll n, k,a,b,c,i,j,x,y,z;

int main() {
	cin >> a>>b>>c;
	
	z = c - (a - b);
	if (z <= 0)z = 0;
	cout << z;
	return 0;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

	int n; cin >> n;
	vector<int> a(n);

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

	vector<int> l(n+1);

	for (int i = 1; i < n+1; i++) {
		l[i] = max(a[i-1], l[i-1]);
	}

	vector<int> r(n+1);

	for (int i = n-1; i >=1; i--) {
		r[i] = max(a[i], r[i+1]);
	}

	for (int i = 0; i < n; i++) {
		cout << max(l[i], r[i+1]) << endl;
	}

	return 0;
}

Measured memory_bytes: 3968
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 31/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

s, t = is1(), is1()
dp = [[0 for i in range(len(s) + 1)] for j in range(len(t) + 1)]
for i in range(1, len(t) + 1):
    for j in range(1, len(s) + 1):
        if s[j - 1] != t[i - 1]:
            dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
        else:
            dp[i][j] = 1 + dp[i - 1][j - 1]

i, j = len(t), len(s)
res = ""
while i > 0 and j > 0:
    if s[j - 1] == t[i - 1]:
        res += s[j - 1]
        i -= 1
        j -= 1
    else:
        if dp[i - 1][j] > dp[i][j - 1]:
            i -= 1
        else:   
            j -= 1
print(res[::-1])
        
    


Measured memory_bytes: 153400
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main(){
  
  string s;
  int i = 0;
  cin >> s;
  
  if(s == "RRR") cout << 3 << endl;
  else if(s == "SRR" || s == "RRS") cout << 2 << endl;
  else if(s == "SSS") cout << 0 << endl;
  else cout << 1 << endl;
      
  
  
}


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

int main()
{
	string s;
	cin >> s;

	int longest=0;
	int current=0;
	for (int i=0;i<s.size();++i)
	{
		switch (s[i])
		{
		case 'A': case 'T': case 'G': case 'C':
			++current;
			break;
		default:
			longest=max(longest,current);
			current=0;
			break;
		}
	}
	longest=max(longest,current);
	cout << longest << endl;
}







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

int main(){
  int N;
  cin >>N;
  int ans=0;
  vector<int> s(390);
  for(int i=0;i<=25;i++){
    for(int j=0;j<=14;j++){
      if(N==4*i+7*j){
        ans=1;
        break;
      }
    }
  }
  
 
  
  if(ans==1){
    cout << "Yes" <<endl;
  }
  if(ans==0){
    cout << "No" <<endl;
  }
}


Measured memory_bytes: 3616
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		for(int i = 0; i < n; i++){
		    a[i] = sc.nextInt();
		    b[i] = a[i];
		}
		Arrays.sort(b);
		int count = 0;
		for(int i = 0; i < n; i++){
		    if(a[i] != b[i]){
		        count++;
		    }
		    //System.out.println(a[i] + " " + b[i]);
		}
		if(count <= 2){
		    System.out.println("YES");
		}
		else{
		    System.out.println("NO");
		}
	}
}


Measured memory_bytes: 21716
#include<iostream>
#include<string>
#include<map>
using namespace std;
typedef pair<int,int> i_i;
int suit(char c){
  if(c=='#') return -1;
  if(c=='S') return 0;
  if(c=='H') return 1;
  if(c=='D') return 2;
  if(c=='C') return 3;
  return -1;
}
int num(char c){
  if(c=='A') return 14;
  if(c=='2') return 2;
  if(c=='3') return 3;
  if(c=='4') return 4;
  if(c=='5') return 5;
  if(c=='6') return 6;
  if(c=='7') return 7;
  if(c=='8') return 8;
  if(c=='9') return 9;
  if(c=='T') return 10;
  if(c=='J') return 11;
  if(c=='Q') return 12;
  if(c=='K') return 13;
  return -1;
}
int main(){
  char trump;
  int i,j,k;
  cin >> trump;
  int t = suit(trump);
  
  while(t!=-1){
    i_i player[4][13];
    string b;
    for(i=0;i<4;i++){
      for(j=0;j<13;j++){
	cin >> b;
	//cout << b << " ";
	player[i][j].first=num(b[0]);
	player[i][j].second=suit(b[1]);
      }
      //cout << endl;
    }
    /*
    for(i=0;i<4;i++){
      j=5;
	cout << player[i][j].first << ":" << player[i][j].second <<  " ";
      
      cout << endl;
    }
    */
    //cout << t << endl;
    int f1,m1,m2,id,fc;
    int ew=0,ns=0;
    int p;
    for(j=0;j<13;j++){
      f1=0;m1=0;m2=0;id=0;
      fc=player[p%4][j].second;
      //cout << p%4 ;
      for(i=0;i<4;i++){
	if(t==fc){
	  if(player[(i+p)%4][j].second==fc){
	    if(m1<player[(i+p)%4][j].first) {
	      m1=player[(i+p)%4][j].first;
	      id=(i+p)%4;
	    }
	  }
	}else if(player[(i+p)%4][j].second==t){
	  f1=1;
	  if(m2<player[(i+p)%4][j].first) {
	    m2=player[(i+p)%4][j].first;
	    id=(i+p)%4;
	  }
	}else if(f1==0&&player[(i+p)%4][j].second==fc){
	  if(m1<player[(i+p)%4][j].first) {
	    m1=player[(i+p)%4][j].first;
	    id=(i+p)%4;
	  }
	}	
      }
      if(id==0||id==2) ns++;
      else ew++;
      //cout << id ;
      p=id;
    }
    //cout << endl;
    if(ew>ns) cout << "EW " << (ew-6) << endl;
    else cout << "NS " << (ns-6) << endl;
    cin >> trump;
    t=suit(trump);
  }

}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const ll INF = LLONG_MAX/3;

int main(){
    int a,b,q;
    cin >>a >>b >>q;

    vector<ll> s(a),t(b),x(q);
    rep(i,a) cin >>s[i];
    rep(i,b) cin >>t[i];
    rep(i,q) cin >>x[i];

    auto fs = [&](ll p){
        int idx = lower_bound(all(s),p)-s.begin();

        ll ret = INF;
        for(int i=-1; i<=1; ++i){
            int j = idx+i;
            if(0<=j && j<a) ret = min(ret, abs(p-s[j]));
        }
        return ret;
    };

    auto ft = [&](ll p){
        int idx = lower_bound(all(t),p)-t.begin();

        ll ret = INF;
        for(int i=-1; i<=1; ++i){
            int j = idx+i;
            if(0<=j && j<b) ret = min(ret, abs(p-t[j]));
        }
        return ret;
    };

    for(ll z:x){
        ll ans = INF;

        // 先にs
        int idx = lower_bound(all(s),z)-s.begin();
        for(int i=-1; i<=1; ++i){
            int j = idx+i;
            if(0<=j && j<a){
                ans = min(ans, abs(z-s[j])+ft(s[j]));
            }
        }

        // 先にt
        idx = lower_bound(all(t),z)-t.begin();
        for(int i=-1; i<=1; ++i){
            int j = idx+i;
            if(0<=j && j<b){
                ans = min(ans, abs(z-t[j])+fs(t[j]));
            }
        }

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


Measured memory_bytes: 3712