akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
int N;
int X[1010],Y[1010];
ll x[1010] = {1},y[1010] = {1};

char mode(int n,int m){
	if(n && m) return 'R';
	if(!n && !m) return 'L';
	if(!n && m) return 'D';
	if(n && !m) return 'U';
}

int main(){
	cin >> N;
	int sum = 0;
	bool judge = true;
	for(int i=0;i<N;i++){
		cin >> X[i] >> Y[i];
		if(i==0) sum = abs(X[i])+abs(Y[i]);
		else if(sum%2!=(abs(X[i])+abs(Y[i]))%2) judge = false;
	}
	if(!judge){
		cout << -1 << endl;
		return 0;
	}
	int count = 1;
	for(int i=1;i<=32;i++){
		x[i] = 2*x[i-1];
		count++;
	}
	vector<int> d;
	if(sum%2==0) d.push_back(1);
	for(int i=0;i<=30;i++){
		d.push_back(x[i]);
	}
	cout << d.size() << endl;
	for(int i=0;i<d.size();i++){
		cout << d[i] << (i!=d.size()-1? " ":"\n");
	}
	for(int i=0;i<N;i++){
		int u = X[i]+Y[i],v = X[i]-Y[i],x = 0,y = 0,a = d.size()-1;
		string S = "";
		while(a>=0){
			int x1 = 0,y1 = 0;
			x1 = (x<=u? 1:0);
			x = (x<=u? x+d[a]:x-d[a]);
			y1 = (y<=v? 1:0);
			y = (y<=v? y+d[a]:y-d[a]);
			S = mode(x1,y1) + S;
			a--;
		}
		cout << S << endl;
	}	
}

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

int main() {
  int x,y;
  cin>>x>>y;
  string a;
  for(int i=0;i<y+2;i++)
    a+='#';
  cout<<a<<endl;
  string b[x];
  for(int i=0;i<x;i++){
    cin>>b[i];
    string c;
    c='#'+b[i]+'#';
    cout<<c<<endl;
  }
  cout<<a<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ri register int
typedef long long ll;
const int N=8005,M=205,mod=998244353,L=(1<<14)+5;
int f[N][M],p[L],q[L],fac[N],ifac[N];
inline int _add(ri x,ri y){
	return (x+=y)>=mod?x-mod:x;
}
inline int fpow(ri a,ri b){
	ri ans=1;
	for(;b;b>>=1,a=(ll)a*a%mod)
		if(b&1)
			ans=(ll)ans*a%mod;
	return ans;
}
namespace ntt{
	int rt[L],rev[L],inv[L],lim,l;
	
	inline void init(ri n){
	    ri w,i;
		lim = 1; l = 0;
	    while(lim<=n) lim <<= 1, ++l;
	    w = fpow(3,(mod-1)/lim);
	    rt[lim>>1] = 1;
	    for(i=(lim>>1)+1;i!=lim;++i) rt[i] = (ll)rt[i-1]*w%mod;
	    for(i=(lim>>1)-1;i;--i) rt[i] = rt[i<<1];
	    inv[1]=1;
	    for(i=2;i<=lim;++i) inv[i]=(ll)(mod-mod/i)*inv[mod%i]%mod;
	    for(i=1;i^lim;++i) rev[i]=(ntt::rev[i>>1]>>1)|((i&1)<<l-1);
	}
	
	inline void transform(int *f,ri lim,ri type,ri siz){
	    if(type==-1) reverse(f+1,f+lim);
	    static unsigned long long a[L];
	    ri x,shift = siz-__builtin_ctz(lim),i,mid,j,k;
	    for(i=0;i^lim;++i) a[rev[i]>>shift] = f[i];
	    for(mid=1;mid^lim;mid<<=1)
	        for(j=0;j^lim;j+=mid<<1)
	            for(k=0;k^mid;++k)
	                x = a[j|k|mid]*rt[mid+k]%mod,
	                a[j|k|mid] = a[j|k]-x+mod,
	                a[j|k] += x;
	    for(i=0;i^lim;++i) f[i] = a[i]%mod;
	    if(type==1) return;
	    x = inv[lim];
	    for(ri i=0;i!=lim;++i) f[i] = (ll)f[i]*x%mod;
	}
}
inline int C(ri n,ri m){
	return m<0||n<m?0:(ll)fac[n]*ifac[m]%mod*ifac[n-m]%mod; 
} 
int main(){
	ri n,m,i,j,ans;
	scanf("%d%d",&n,&m);
	ntt::init(n<<1);
	fac[0]=1;
	for(i=1;i<=n+2;++i) fac[i]=(ll)fac[i-1]*i%mod;
	ifac[n+2]=fpow(fac[n+2],mod-2);
	for(i=n+2;i;--i) ifac[i-1]=(ll)ifac[i]*i%mod;
	f[0][0]=1;
	for(j=1;j<=m;++j){
		f[0][j]=1;
		for(i=1;i<=n;++i)
			f[i][j]=f[i][j-1],
			f[i][j]=(f[i][j]+(ll)f[i][j-1]*i*(i+1)/2)%mod;
		for(i=0;i<=n;++i)
			p[i]=(ll)f[i][j-1]*ifac[i]%mod;
		for(i=1;i<=n;++i)
			q[i]=ifac[i+2];
		ntt::transform(p,ntt::lim,1,ntt::l);
		ntt::transform(q,ntt::lim,1,ntt::l);
		for(i=0;i^ntt::lim;++i) p[i]=(ll)p[i]*q[i]%mod;
		ntt::transform(p,ntt::lim,-1,ntt::l);
		for(i=1;i<=n;++i)
			f[i][j]=(f[i][j]+(ll)p[i]*fac[i+2])%mod;
		for(i=0;i^ntt::lim;++i) p[i]=q[i]=0;
	}
	ans=0;
	for(i=0;i<=n;++i) ans=(ans+(ll)C(n,i)*f[i][m])%mod;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 7168
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin>>s;
    int n=s.length(),MIN=642;
    for(int i=0;i<n-2;i++){
        int ans=100*(s[i]-'0')+10*(s[i+1]-'0')+s[i+2]-'0';
        MIN=min(MIN,abs(ans-753));
    }
    cout<<MIN<<endl;
}


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

using namespace std;

#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);(i)++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;(i)>=(int)(m);(i)--)
#define REP(i,n) rep(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = 998244353;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;


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

struct Edge {
	int to, cap, rev;
	Edge(int _to, int _cap, int _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, int from, int to, int cap, bool revFlag, int revCap) {
	G[from].push_back(Edge(to, cap, G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, G[from].size() - 1));
}

const int n = 2000;
const int m = 5000;
bool ab[10101], ac[10101], bc[10101];

void solve() {
	string a, b, c;
	cin >> a >> b >> c;

	const int A = a.length();
	const int B = b.length();
	const int C = c.length();

	auto check = [](char c1, char c2) {
		return (c1 == '?' || c2 == '?' || c1 == c2);
	};

	REP(i, A) {
		REP(j, B) {
			if (!check(a[i], b[j])) {
				ab[i-j + m] = true;
			}
		}
	}

	REP(i, A) {
		REP(j, C) {
			if (!check(a[i], c[j])) {
				ac[i-j + m] = true;
			}
		}
	}

	REP(i, B) {
		REP(j, C) {
			if (!check(b[i], c[j])) {
				bc[i - j + m] = true;
			}
		}
	}

	int ans = 3 * n;
	for (int i = -2 * n; i <= 2 * n; i++) {
		for (int j = -2 * n; j <= 2 * n; j++) {
			if (!ab[i + m] && !ac[j + m] && !bc[j - i + m]) {
				int l = min(0, min(i,j));
				int r = max(A, max(B+i, C+j));
				chmin(ans, r - l);
			}
		}
	}
	cout << ans << en;
}

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

	solve();
	//int t; cin >> t; REP(i, t) solve();

	return 0;
}


Measured memory_bytes: 256
fn main() {
    let n:i32 = readln();
    let a:Vec<i32> = readln();
    let mut s = HashSet::new();
    let mut free = 0;
    for x in a {
        if x < 3200 {
            let y = x / 400;
            s.insert(y);
        } else {
            free += 1;
        }
    }
    let min_ans = max(1, s.len());
    let max_ans = s.len() + free;
    println!("{} {}", min_ans, max_ans);
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
use std::collections::HashSet;

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

Measured memory_bytes: 4352
# -*- coding: utf-8 -*-
loop = 1
while(loop):
    l = input().strip().split()
    H = int(l[0])
    W = int(l[1])
    if(H == 0 and W == 0):
        break
    else:
        for y in (range(H)):
            for x in (range(W)):
                if((x % 2 == 0) and(y % 2 == 0) or (x % 2 != 0) and(y % 2 != 0)):
                    print("#",end="")
                else:
                    print(".",end="")
            print()
        print()

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

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

using ll = long long;
using namespace std;

int
main ()
{
    ll n, a, b;
    cin >> n >> a >> b;

    auto n_group = n / (a + b);
    auto rem = n % (a + b);
    auto answer = n_group * a + min(rem, a);
    cout << answer << endl;
}


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

using namespace std;

#define MP make_pair
#define PB push_back
#define f first
#define s second

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;

//int dr1[] = {-1, 0, 1, 0};
//int dc1[] = {0, 1, 0, -1};
//int dr3[] = {0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1, -1, 1, 0, 0};
//int dc3[] = {3, 2, 1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 0, 0, -1, 1};
const int MOD = 1000000007;
const int INF = 1000000007;

ll modx(ll a)
{
    return (a%MOD+MOD)%MOD;
}

ll times(ll a, ll b)
{
    return modx(modx(a)*modx(b));
}

ll add(ll a, ll b)
{
    return modx(modx(a)+modx(b));
}

ll sub(ll a, ll b)
{
    return modx(MOD+modx(a)-modx(b));
}

ll fastExp(ll base, ll exp)
{
    if(exp == 0LL)
    {
        return 1LL;
    }

    if(exp%2==0)
    {
        return fastExp(times(base, base), exp/2);
    }
    else
    {
        return times(base, fastExp(times(base, base), exp/2));
    }
}


const int MAXN = (int)1e5+1;
int N, M, dp[(1<<13)], arr[(1<<13)], cost[1000];

int main()
{
    //freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> N >> M;

    for(int i=0; i<=(1<<N); i++)
    {
        dp[i] = INF;
    }

    for(int i=0; i<M; i++)
    {
        int a, b;
        cin >> a >> b;
        int c = 0;
        cost[i] = a;
        for(int j=0; j<b; j++)
        {
            int x;
            cin >> x;
            x--;
            c += (1<<x);
        }
        arr[i] = c;
        dp[c] = a;
    }

    for(int i=1; i<(1<<N); i++)
    {
        for(int j=0; j<M; j++)
        {
            dp[i & arr[j]] = min(dp[i & arr[j]], cost[j]);
        }
    }

    for(int i=1; i<(1<<N); i++)
    {
        for(int j=0; j<M; j++)
        {
            dp[i | arr[j]] = min(dp[i | arr[j]], cost[j] + dp[i]);
        }
    }
//    for(int i=0; i<(1<<N); i++)
//    {
//        cout << dp[i] << "\n";
//    }
    if(dp[(1<<N)-1] == INF)
    {
        cout << -1;
    }
    else
    {
        cout << dp[(1<<N)-1];
    }
    return 0;
}


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

int main()
{
  int k,a,b;
  string ans;
  cin>>k>>a>>b;
  for(int i=a;i<=b;i++)
  {
    if(i%k==0)
    {
      ans="OK";
      break;
    }
  }
  if(ans!="OK")
    ans="NG";
  cout<<ans<<endl;
}

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

int main(){
  string S;
  cin >> S;
  if(S == "SUN") cout << 7 << endl;
  else if(S == "SAT") cout << 1 << endl;
  else if(S == "MON") cout << 6 << endl;
  else if(S == "TUE") cout << 5 << endl;
  else if(S == "WED") cout << 4 << endl;
  else if(S == "THU") cout << 3 << endl;
  else cout << 2 << endl;
} 


 
 
   

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

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).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 (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> a(n); rep (i, n) cin >> a[i];
    sort(all(a), greater<int>());
    ll ans = 0;
    rep (i, n) ans += (i % 2 ? -1 : 1) * (ll)a[i];
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

ll N, A, B;

void solve() {
	cin >> N >> A >> B; A--; B--;
	if((B - A) % 2 == 0) cout << (B - A) / 2 << "\n";
	else {
		cout << min(A + 1 + (B - A - 1) / 2, N - B + (B - A - 1) / 2) << "\n";
	}
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int r, n;
    scanf("%d",&n);
    r=n%10;
    if(n==0)  printf("pon\n");
    else {
     if(r==3) printf("bon\n");
    else if(r==0 || r==1 || r==6 || r==8) printf("pon\n");
    else if(r==2 || r==4 || r==5 || r==7 || r==9 ) printf("hon\n");}

}


Measured memory_bytes: 1664
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
 
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x)     x.begin(),x.end()
#define tc   int tt; scf(tt); while(tt--)
#define inf INT_MAX
#define ninf INT_MIN
#define gcd __gcd
#define bitcount(n) __builtin_popcount(n)
typedef double dd;
using namespace std;
const ll mod =1e9+7;
const int N = 2e5+7;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) 
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

char a[12][12];    
    
int main()
{
    
     
        int h,w,x;
        scf(h),scf(w),scf(x);
        
    
        rep(i,0,h)
       {
           rep(j,0,w)
            cin>>(a[i][j]);
       }
        int ans=0;
        
        rep(i,0,(1<<h))
        {
            rep(j,0,(1<<w))
            {
                int c=0;
                
                rep(l,0,h)
                {
                    
                    rep(m,0,w)
                    {
                        if(i&(1<<l)) continue;
                        if(j&(1<<m)) continue;
                        
                        if(a[l][m]=='#') 
                        c++;
                        
                    }
        
                }
                
                if(c==x)
                ans++;
            
            }
        
        }
        
        prin(ans);
        
        
        
}

Measured memory_bytes: 3768
use proconio::{fastout, input};
use std::io::*;
use std::str::FromStr;

use std::cmp::{max, min};

fn main() {
    input! {
        n: usize,
        a: [i64; n+1],
        b: [i64; n],
    }

    let mut a = a;
    let mut b = b;
    let mut ans = 0;
    for i in (1..n + 1).rev() {
        ans += min(a[i], b[i - 1]);
        b[i - 1] -= min(a[i], b[i - 1]);
        a[i] -= min(a[i], b[i - 1]);
        if b[i - 1] > 0 {
            ans += min(b[i - 1], a[i - 1]);
            b[i - 1] = min(b[i - 1], a[i - 1]);
            a[i - 1] -= min(b[i - 1], a[i - 1]);
        }
        // println!("a:{:?}, b:{:?}", a, b);
    }

    // if b[0] > 0 {
    //     ans += min(b[0], a[0]);
    // }
    println!("{}", ans);
}


Measured memory_bytes: 5476
#include <bits/stdc++.h>
using namespace std;
#define int lint
typedef long long lint;
typedef pair<int ,int> P;
const int    INF = (int)1e9;
const int    MOD = (int)1e9+7;
const double EPS = (double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout << fixed << setprecision(20);
    };
};



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

  int ans=0;
  for(int bit=0;bit<(1<<s.size());bit++){
    int sum=0;
    string temp="";
    for(int t=0;t<s.size();t++){
      temp+=s[t];
      if((bit&(1<<t))&&(bit&(1<<s.size()-1))){
        sum+=stoll(temp);
        temp="";
      }
    }
    ans+=sum;
  }

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


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll;
const int N=2e5+20;
int t[N];
pair<int,int> p[N];
int main()
{
	int n;
	while(cin>>n) 
	{
		int s=0;
		for(int i=1;i<=n;i++)
		{
			cin>>t[i];
			s+=t[i];
		}
		int m;
		cin>>m;
		for(int i=1;i<=m;i++)
		{
			cin>>p[i].first>>p[i].second;
		}
		for(int i=1;i<=m;i++)
		{
			cout<<s-t[p[i].first]+p[i].second<<endl;
		}
		
	}
	return 0;	
} 

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

int main() {
    int x, y, z, r = 0;
    cin >> x >> y >> z;
    for (x; x < y + 1; x++) {
        if (z % x == 0) {
            r++;
        }
    }
    cout << r << endl;
    return 0;
}


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

int main() {
  bool so[10001] ={};
  so[0] = so[1] = 1;
  for(int i=2;i<=10000;i++) {
    if(so[i] == 0)
      for(int j=2;j<=10000/i;j++) so[j*i] = 1;
  }
  
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;

    for(int i=n;i>=3;i--) {
      if(so[i] == 0 && so[i-2] == 0) {
	cout << i-2 <<" "<< i << endl;
	break;
      }
    }

  }

  return 0;

}

Measured memory_bytes: 1180
#include <stdio.h>
int main(){
  int n,i;
  scanf("%d",&n);
  int a[n];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=n-1;i>=0;i--){
    printf("%d",a[i]);
    if(i!=0)printf(" ");
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 2032
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.List
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as VM

infixl 7 <.>

newtype Perm = Perm (V.Vector Int) deriving Eq

permFromIntList :: Int -> [Int] -> Perm
permFromIntList n xs = Perm $ V.fromListN n $ map (subtract 1) xs

identPerm :: Int -> Perm
identPerm n = Perm $ V.fromListN n [0..n-1]

compPerm :: Perm -> Perm -> Perm
compPerm (Perm f) (Perm g)
  = let n = V.length f -- = V.length g
    in Perm $ V.generate n $ \i -> f V.! (g V.! i)

(<.>) :: Perm -> Perm -> Perm
(<.>) = compPerm

invPerm :: Perm -> Perm
invPerm (Perm p) = Perm $ V.create $ do
  let n = V.length p
  q <- VM.new n
  forM_ [0..n-1] $ \i -> do
    VM.write q (p V.! i) i
  return q

powPerm :: Int -> Perm -> Int -> Perm
powPerm n _ 0 = identPerm n
powPerm _ p i = loop (i-1) p p
  where loop 0 !p !acc = acc
        loop 1 p acc = p `compPerm` acc
        loop i p acc = case quotRem i 2 of
                         (j,0) -> loop j (p `compPerm` p) acc
                         (j,_) -> loop j (p `compPerm` p) (acc `compPerm` p)

showPerm :: Perm -> String
showPerm (Perm p) = intercalate " " $ map (show . (+ 1)) $ V.toList p

parseInts :: String -> [Int]
parseInts s = case reads s of
                [(x,t)] -> x : parseInts t
                _ -> []

main = do
  [n,k] <- parseInts <$> getLine
  ps <- parseInts <$> getLine
  qs <- parseInts <$> getLine
  let p = permFromIntList n ps
      q = permFromIntList n qs
      f p q = q `compPerm` invPerm p

  {-
  let as = p : q : zipWith f as (tail as)
      a_k = as !! (k - 1)
  putStrLn $ showPerm a_k
  -}
  {-
  let loop i p q | i == 0 = p
                 | otherwise = loop (i - 1) q (f p q)
  putStrLn $ showPerm $ loop (k - 1) p q
  -}

  let m = (k + 1) `quot` 2
      r = (q <.> invPerm p) <.> (invPerm q <.> p)
      b = case m `quotRem` 3 of
            (l,0) -> powPerm n r (l-1) <.> q <.> invPerm p
            (l,1) -> powPerm n r l
            (l,_) -> powPerm n r l <.> q
      c = case k `rem` 6 of
            0 -> invPerm q <.> p
            1 -> p
            2 -> q
            3 -> invPerm p <.> q
            4 -> invPerm p
            _ -> invPerm q
      a_k' = b <.> c <.> invPerm b
  putStrLn $ showPerm a_k'


Measured memory_bytes: 45820
import java.util.Scanner;
                     
                    public class Main {
                      public static void main(String args[]){
                     
                        Scanner scan = new Scanner(System.in);
                        int val = scan.nextInt();
                        if(val>99){
                          int a[] = new int[3];
                        for(int i=2;i>=0;i--){
                    		int x=val%10;
                            
                    		a[i]=x;
                    		val=val/10;
                        }
                              if(a[2]==2 ||a[2]==4 || a[2]==5 || a[2]==7 || a[2]==9){
                    			System.out.println("hon");
                              }else if(a[2]==0 ||a[2]==1 || a[2]==6 ||a[2]==8){
                    			System.out.println("pon");
                              }else{
                                System.out.println("bon");
                              }
                        }else if(val>9){
                             int a[] = new int[2];
                           for(int i=1;i>=0;i--){
                    		int x=val%10;
                         
                    		a[i]=x;
                    		val=val/10;
                        }
                              if(a[1]==2 ||a[1]==4 || a[1]==5 || a[1]==7 || a[1]==9){
                    			System.out.println("hon");
                              }else if(a[1]==0 ||a[1]==1 || a[1]==6 ||a[1]==8){
                    			System.out.println("pon");
                              }else{
                                System.out.println("bon");
                              }
                        }else{
                          if(val==2 ||val==4 || val==5 || val==7 || val==9){
                    			System.out.println("hon");
                              }else if(val==0 ||val==1 || val==6 || val==8){
                    			System.out.println("pon");
                              }else{
                                System.out.println("bon");
                              }
                        }
                      }
                    }

Measured memory_bytes: 35632
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, x, b = M()
if x == '+':
    print(int(a)+int(b))
else:
    print(int(a)-int(b))

Measured memory_bytes: 74552
n = int(input())
d = list(map(int, input().split()))
d = sorted(d)
tar = int(n/2) - 1


left = d[tar]
right = d[tar + 1]
#print(left, right)
diff = right - left
if (diff == 0):
    ans = 0
else:
    ans = diff

print(ans)


Measured memory_bytes: 14428
#include<cstdio>
#include<vector>
#include<cmath>
#include<string>
#include<map>
#include<string.h>
#include<iostream>
#include<algorithm>
#define PI acos(-1.0)
#define pb push_back
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N=3e5+5;
const int MOD=1e9+7;
template <class T>
bool sf(T &ret){ //Faster Input
    char c; int sgn; T bit=0.1;
    if(c=getchar(),c==EOF) return 0;
    while(c!='-'&&c!='.'&&(c<'0'||c>'9')) c=getchar();
    sgn=(c=='-')?-1:1;
    ret=(c=='-')?0:(c-'0');
    while(c=getchar(),c>='0'&&c<='9') ret=ret*10+(c-'0');
    if(c==' '||c=='\n'){ ret*=sgn; return 1; }
    while(c=getchar(),c>='0'&&c<='9') ret+=(c-'0')*bit,bit/=10;
    ret*=sgn;
    return 1;
}
int sign(int x){
    return abs(x)<1e-7?0:x<0?-1:1;
}
char mp[200][200];
map<int,int> t,y;
int main(void){
    ll n,m;
    cin >>n>>m;
    for(int i=1;i<=n;i++)    cin >> mp[i]+1;
    for(int i=1;i<=n;i++){
        int cnt=0;
        for(int j=1;j<=m;j++){
            if(mp[i][j]=='.')   cnt++;
        }
        if(cnt==m)  t[i]=1;
    }
    for(int i=1;i<=m;i++){
        int cnt=0;
        for(int j=1;j<=n;j++){
            if(mp[j][i]=='.')   cnt++;
        }
        if(cnt==n)  y[i]=1;
    }
//    cout <<"~"<<mp[4]<<endl;
    for(int i=1;i<=n;i++){
        int cnt=0;
        for(int j=1;j<=m;j++){
            if(t[i]||y[j])    continue;
            printf("%c",mp[i][j]);
            cnt++;
        }
        if(!cnt)    continue;
        printf("\n");
    }

    return 0;

}


Measured memory_bytes: 256
#include<set>
#include<cstdio>

inline void read(int&r)
{
	register char c;r=0;
	do c=getchar();while(c<'0'||c>'9');
	do r=r*10+c-'0',c=getchar();while(c>='0'&&c<='9');
}

std::multiset<int>s;

int a[300001];
long long f[300001],sum,ans;

int main()
{
	int i,n;read(n);
	for(i=1;i<=n*3;i++)
	{
		read(a[i]),sum+=a[i];
		s.insert(a[i]);
		if(s.size()>n)
		{
			sum-=*s.begin();
			s.erase(s.begin());
		}
		f[i]=sum;
	}
	s.clear(),sum=0,ans=-1e18;
	for(i=n*3;i>n*2;i--)s.insert(a[i]),sum-=a[i];
	for(;f[i]+sum>ans&&(ans=f[i]+sum),i>n;i--)
	{
		s.insert(a[i]),sum-=a[i];
		if(s.size()>n)
		{
			sum+=*--s.end();
			s.erase(--s.end());
		}
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 8448
from collections import deque, Counter

N = int(input())

A = [
  int(j) - i  for i, j in enumerate(input().split())
]
cnt_A = Counter(A)

ans = 0
d = deque(A)
for i in range(N):
  a = d.popleft()
  #c = d.count(-a - 2 * i)
  c = cnt_A[-a - 2 * i]
  ans += c
print(ans)

Measured memory_bytes: 36748
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>


#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long
//#define lint long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
priority_queue<double, vector<double> > q;
signed main(){
  int n,m;
  cin >> n >> m;
  REP(i,n){
    double a1;
    cin >> a1;
    q.push(a1);
  }
  REP(i,m){
    double b2 = q.top();
    q.pop();
    q.push(b2/2.0);
  }
  int ans = 0;
  REP(i,n){
    double t2 = q.top();
    q.pop();
    int c2 = (int)t2;
    ans += t2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1400
#include <iostream>
#include <cassert>
#include <vector>
#include <set>
#include <map>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <math.h>
#define MODD 1000000007
#define MAXN 120000
#define ll long long
using namespace std;


vector<pair<int,int>> edges[MAXN+2];


ll dp[2][MAXN+2];
ll mindist[2][MAXN+2];

ll Solve(int u, int dest, bool which) {
    
    
    if (u == dest)
        return dp[which][u]=1;
    
    if (dp[which][u]!=-1)
        return dp[which][u];
    
    ll ans = 0;
    
    for(pair<int,int> vd : edges[u]) {
        int v = vd.first;
        int d = vd.second;
        
        
        if (mindist[which][v]+d == mindist[which][u]) {
            ans += Solve(v,dest,which);
            if (ans >= MODD)
                ans -= MODD;
        }
    }
    dp[which][u]=ans;
    return ans;
    
}


int N,M;

void DoDjikstra(int S, int T, bool which) {
    set<pair<ll,int>> dists;
    dists.insert({0,S});
    
    for(int i=1;i<=N;i++) {
        mindist[which][i]=-1;
        dp[which][i]=-1;
    }
    
    while(!dists.empty()) {
        
        set<pair<ll,int>>::iterator it = dists.begin();
        pair<ll,int> dist_u = *it;
        ll currd = dist_u.first;
        int u = dist_u.second;
        dists.erase(it);
        
        if (mindist[which][u]!=-1)
            continue;
        mindist[which][u]=currd;
        
        for(pair<int,int> vd : edges[u]) {
            int v = vd.first;
            int d = vd.second;
            
            if (mindist[which][v] != -1)
                continue;
            
            dists.insert({currd+d,v});
            
        }
    }
    ll numways = Solve(T,S,which);

    
    
}



int main() {
    cin>>N>>M;
    int S,T;
    cin>>S>>T;
    for(int i=1;i<=M;i++) {
        int U,V,D;
        cin>>U>>V>>D;
        edges[U].push_back({V,D});
        edges[V].push_back({U,D});
    }
    

    
    DoDjikstra(S, T, 0);

    DoDjikstra(T, S, 1);


    

    
    ll numways = dp[0][T]*dp[0][T]%MODD;
    
    // cannot use a vertex u if:
    // mindist[u]*2=mindist[T]
    
    // cannot use an edge (u,v) if:
    // 2*mindist[u] < mindist[T] < 2*(mindist[u]+d(u,v))

    
    for(int u=1;u<=N;u++) {
        if (mindist[0][u]*2==mindist[0][T]) {
            ll curr = dp[0][u]*dp[1][u]%MODD;
            numways -= curr*curr%MODD;
            if (numways < 0)
                numways += MODD;
        }
    }
    
    
    for(int u=1;u<=N;u++) {
        for(pair<int,int> vd : edges[u]) {
            int v = vd.first;
            ll d = vd.second;
            

            
            if (mindist[0][u]+d+mindist[1][v]==mindist[0][T] && 2*mindist[0][u] < mindist[0][T] && 2*mindist[0][u]+2*d > mindist[0][T]) {
                if (dp[0][u]==-1 || dp[1][v]==-1)
                    exit(-1);
                ll curr = dp[0][u]*dp[1][v]%MODD;
                numways -= curr*curr%MODD;
                if (numways < 0)
                    numways += MODD;
            }
            
        }
    }
    
    numways %= MODD;
    
    
    cout << numways << endl;
    
}


Measured memory_bytes: 21120
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

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

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

      return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int ab = sc.nextInt();
    int bc = sc.nextInt();
    int ca = sc.nextInt();
    System.out.println(ab * bc / 2);
  }
}

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

int main(){

  int first,second,third;
  int point,n,i,out;
  char str[16];

    scanf("%d",&n);
    for(i=0;i<n;i++)
      {
	first=0;
	second=0;
	third=0;
	point=0;
	out=0;
    while(out < 3)
      {
	scanf("%s",str);
	if(strcmp(str,"HOMERUN")==0)
	  {
	    if(first==1)
	      {
		point=point+2;
		first = 0;
	      }
	    else if(second==1)
	      {
		point=point+3;
		second = 0;
	      }
	    else if(third==1)
	      {
		point=point+4;
		third = 0;
	      }
	    else
	      point++;
	  }
	else if(strcmp(str,"OUT") == 0)
	  {
	    out++;
	  }
	else if(strcmp(str,"HIT")==0)
	  {
	    if(first == 1)
	      {
		second = 1;
		first = 0;
	      }
	    else if(second == 1)
	      {
		third = 1;
		second = 0;
	      }
	    else if(third == 1)
	      {
		point ++;
	      }
	    else
	      first = 1;
	  }
      }
    printf("%d\n",point);
      }
    return 0;
}

Measured memory_bytes: 596
public partial class IntroductionToProgramming{
	public static void Main(){
		string[] line = System.Console.ReadLine().Split(' ');
		int a = int.Parse(line[0]);
		int b = int.Parse(line[1]);
		
		System.Console.WriteLine(a > b ? "a > b" : a < b ? "a < b" : "a == b");
	}
}

Measured memory_bytes: 5304
#include<iostream>
#include<string.h>
using namespace std;
const int maxn=2e5+20;
int main(void)
{
	int a[maxn];
	int n,x;
	memset(a,0,sizeof(a));
	cin>>n;
	for(int i=1;i<n;i++)
	{
		cin>>x;
		a[x]++;
	}
	for(int i=1;i<=n;i++)
		cout<<a[i]<<endl;
	return 0;
}

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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;

struct union_find {
  vector<int> par;

  union_find() {}
  union_find(int n) :
    par(n+1, -1)
  {}

  int root(int x) {
    if(par[x] < 0) return x;
    return par[x] = root(par[x]);
  }
  int size(int x) {
    return -par[root(x)];
  }
  bool same(int a, int b) {
    return root(a) == root(b);
  }
  bool marge(int a, int b) {
    a = root(a), b = root(b);
    if(a == b) return false;
    if(par[a] > par[b]) swap(a, b);
    par[a] += par[b];
    par[b] = a;
    return true;
  }
};

int main() {
  llong N, M;
  vector<lpair> AB;

  cin >> N >> M;
  AB.resize(M);
  union_find uf(N);
  for (auto in: AB) {
    cin >> in.first >> in.second;
    uf.marge(in.first, in.second);
  }

  llong ans = 0;
  for (int i = 1; i <= N; i++) {
    ans = max(ans, llong(uf.size(i)));
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 7216
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	int n,m;
	cin>>n>>m;
	LL ans=0;
	LL once=m*1900+(n-m)*100;
	LL s=1<<m;
	cout<<once*s<<endl;

    return 0;
}


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

const int nax = 2e5+5;
vector<int> p(nax);
vector<int> r(nax);

int par(int a) {
	return p[a] == a ? a : p[a] = par(p[a]);
}

bool IsSameSet(int a, int b) {
	return par(a) == par(b);
}

void merge(int a, int b) {
	if(!IsSameSet(a, b)) {
		int x = par(a), y = par(b);
		if(r[x] > r[y]) {
			p[y] = x;
		}
		else {
			p[x] = y;
			if(r[x] == r[y]) r[y]++;
		}
	}
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n, q, t, u, v;
	cin >> n >> q;
	for(int i = 0; i < n; i++) p[i] = i, r[i] = 0;
	while(q--) {
		cin >> t >> u >> v;
		if(!t) merge(u, v);
		else cout << IsSameSet(u, v) << endl;
	}
	return 0;
}


Measured memory_bytes: 4668
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(long long i=(long long)(a);i<(long long)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int>> pqli;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi>> pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
int main(void)
{
	int a, b;

	cin>>a>>b;

	if(b%a==0){
		cout<<a+b<<endl;
	} else{
		cout<<b-a<<endl;
	}
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

static const int N = 1000;

int lcs(string X, string Y) {
    int c[N + 1][N + 1];
    int m = X.size();
    int n = Y.size();
    int maxl = 0;
    
    X = ' ' + X;
    Y = ' ' + Y;
    
    for (int i = 0; i <= m; i++) {
        c[i][0] = 0;
    }
    for (int j = 1; j <= n; j++) {
        c[0][j] = 0;
    }
    
    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            if (X[i] == Y[j]) {
                c[i][j] = c[i - 1][j - 1] + 1;
            } else {
                c[i][j] = max(c[i - 1][j], c[i][j - 1]);
            }
            
            maxl = max(maxl, c[i][j]);
        }
    }
    
    return maxl;
}

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



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

int main() {
    pair< int, int > a, b;
    cin >> a.first >> a.second >> b.first >> b.second;
    
    for (int i = 0; i < 2; ++i) {
        int dx = b.first - a.first;
        int dy = b.second - a.second;
        
        a = b;
        b.first = a.first - dy;
        b.second = a.second + dx;

        cout << b.first << " " << b.second << " ";
    }
}

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

int main()
{
    int N;
    cin >> N;
    int p[N];
    int tmp1, tmp2, difcount, tm1, tm2 = 0;
    for (int i = 1; i <= N; i++)
    {
        cin >> p[i];
        if(p[i] != i){
            difcount++;
            if(difcount == 1){
                tmp1 = p[i];
                tm1 = i;
            }
            else if(difcount == 2){
                tmp2 = p[i];
                tm2 = i;
            }
        }
    }
    if(difcount == 0){
        cout << "YES" << endl;
    }
    else if(difcount == 2 && tmp1 == tm2 && tmp2 == tm1){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
 
using namespace std;
typedef long long ll;
 
int main(){
  string s;

  cin >> s;
  if(s[0]<='Z'){
    cout << 'A' << endl;
  }else{
    cout << 'a' << endl;
  }

  return 0;
}


Measured memory_bytes: 3640
import math
from functools import reduce
N, K = map(int, input().split())
A = list(map(int, input().split()))

def gcd_list(numbers):
  return reduce(math.gcd, numbers)

gcd = gcd_list(A)
if (K%gcd==0) and (K<=max(A)):
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')

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

namespace AtcoderTemplateForCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var d1 = new Dictionary<int, int>();
            var d2 = new Dictionary<int, int>();
            var n = int.Parse(Console.ReadLine());

            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

            for (var i = 0; i < n; i++)
            {
                if (i % 2 == 0)
                {
                    if (d1.ContainsKey(input[i]))
                    {
                        d1[input[i]]++;
                    }
                    else
                    {
                        d1[input[i]] = 1;
                    }
                }
                else
                {
                    if (d2.ContainsKey(input[i]))
                    {
                        d2[input[i]]++;
                    }
                    else
                    {
                        d2[input[i]] = 1;
                    }
                }
            }

            var AnswerD1 = d1.OrderByDescending(x => x.Value);
            var AnswerD2 = d2.OrderByDescending(x => x.Value);

            if (AnswerD1.Count() == 1 && AnswerD2.Count() == 1 && AnswerD1.First().Key == AnswerD2.First().Key)
            {
                Console.WriteLine(n / 2);
            }
            else if (AnswerD1.First().Key == AnswerD2.First().Key)
            {
                var tmp1 = n - (AnswerD1.First().Value + AnswerD2.ElementAt(1).Value);
                var tmp2 = n - (AnswerD1.ElementAt(1).Value + AnswerD2.First().Value);
                Console.WriteLine(Math.Min(tmp1, tmp2));
            }
            else
            {
                Console.WriteLine(n - (AnswerD1.First().Value + AnswerD2.First().Value));
            }
        }
    }
}

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

using namespace std;

typedef long long ll;

ll K;
ll a[55];

int main() {

cin.tie(0);
ios::sync_with_stdio(false);

cin>>K;

ll quo=K/50L; ll mod=K%50L;

for(int i=0; i<50; i++){
  a[i]=49L+quo;
}

int j=0;

while(mod){
  if(mod>10){
    a[j]+=10L*50L;
    for(int i=0; i<50; i++){
      if(i==j) continue;
      a[i]-=10L;
    }
    mod-=10L;
    j++;
  }else{
    a[0]+=(mod)*50L;
    for(int i=1; i<50; i++){
      a[i]-=mod;
    }
    break;
  }
}

cout<<50<<endl;

for(int i=0; i<50; i++){
  if(i<49) cout<<a[i]<<" ";
  if(i==49) cout<<a[i];
}

cout<<endl;

}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class Program
    {
    	static void Main(string[] args)
    	{
            string s = Console.ReadLine();
            if (s[0] < s[2]) Console.WriteLine("<");
            else if (s[0] == s[2]) Console.WriteLine("=");
            else Console.WriteLine(">");
        }
    }
    //mcs Main.cs
    //mono Main.exe

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

int main() {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        string ans = "No";

        if (abs(a - c) <= d || abs(a - b) <= d && abs(b - c) <= d)
                ans = "Yes";

        cout << ans << endl;
}

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

int main() {

	const ll mod = 1000000007;
	int n, m; cin >> n >> m;
	vector<int> broken(n + 2, false);
	for (int i = 1; i <= m; i++) {
		int a; cin >> a;
		broken[a] = true;
	}	
	vector<ll> dp(n + 2, 0);
	dp[0] = 1;
	if (!broken[1]) dp[1] = 1;
	for (int i = 2; i <= n; i++) {
		if (!broken[i]) {
			dp[i] += dp[i - 1] + dp[i - 2];
			dp[i] %= mod;
		}
	}
	cout << dp[n] << endl;
	return 0;
}

Measured memory_bytes: 4552
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ZYCSwing
 */
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);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int m = in.nextInt();
            out.println(48 - m);
        }

    }
}



Measured memory_bytes: 21844