akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define int 		long long
#define double 		long double
#define pb 			push_back
#define in 			insert
#define mp 			make_pair
#define f 			first
#define s 			second
#define x 			first
#define y 			second
#define all(el) 	el.begin(), el.end()
#define allr(el) 	el.rbegin(), el.rend()
#define sz(el) 		(int)el.size()

template <typename T1, typename T2> inline bool chkmin(T1 &x, const T2 &y) {if (x > y) {x = y; return 1ll;} else {return 0ll;}}
template <typename T1, typename T2> inline bool chkmax(T1 &x, const T2 &y) {if (x < y) {x = y; return 1ll;} else {return 0ll;}}

istream& operator>>(istream &in, vector<int> &a) {
	for (int &now : a) {
		in >> now;
	}
	return in;
}

ostream& operator<<(ostream &out, vector<int> &a) { 
    for (int &now : a) {
    	out << now << ' ';
    }
    out << "\n";
    return out;
}

signed main() {

	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int a, b, c;
	cin >> a >> b >> c;
	// a + 2 * sqrt(ab) + b < c;
	// 2 * sqrt(ab)< c - b - a;
	cout << ((c - b - a) > 0 && 4 * a * b < (c - b - a) * (c - b - a) ? "Yes" : "No");

}

Measured memory_bytes: 256
A, B, C, D = map(int, input().split())
def battle(x_hp, x_atk, y_hp, y_atk):
  turn = 0
  while 1:
    if turn == 0:
      y_hp -= x_atk
      if y_hp < 1:
        return "Yes"
    else:
      x_hp -= y_atk
      if x_hp < 1:
        return "No"
    turn = 1 - turn
print(battle(A, B, C, D))

Measured memory_bytes: 61896
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int num = N*3;
		Long a[] = new Long[num];
		for (int i = 0; i < num; i++) {
			a[i] = Long.parseLong(sc.next());
		}

		long result = 0;
		Arrays.sort(a, Comparator.reverseOrder());
		for (int i = 1; N > 0; i+=2) {
			result += a[i];
			N--;
		}
		System.out.println(result);
	}
}

Measured memory_bytes: 67020
//A / B Problem
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main {

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

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String[] ab = in.readLine().split(" ");
		int a = Integer.parseInt(ab[0]);
		int b = Integer.parseInt(ab[1]);

//		int a= 1000000000;
//		int b =1;

		int d = a/b;
		int r = a%b;
//		double f =((int)(((double)a/(double)b)*10000))/10000;
		double f = (double)a/(double)b;
		
		System.out.print(d+" "+r+" ");
		System.out.printf("%.6f\n",f);


	}
}

Measured memory_bytes: 17108
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string { sc.Scan(); return sc.Text() }
func scanRunes() []rune { return []rune(scanString()) }
func scanInt() int { a,_ := strconv.Atoi(scanString()); return a }
func scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }
func scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }

func scanInts(n int) []int {
	res := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int { if a<0 { return -a }; return a }
func min(a,b int) int { if a<b { return a }; return b }
func max(a,b int) int { if a>b { return a }; return b }

//•*¨*•.¸¸♪Main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	arr := scanInts(5)

	ans := 1 << 31-1
	permutationSearch(5, func(a []int) {
		sum := 0
		for i := 0; i < 4; i++ {
			sum += ((arr[a[i]]+9)/10)*10
		}
		ans = min(ans, sum+arr[a[4]])
	})

	fmt.Fprintln(wr, ans)
}


func permutationSearch(n int, fn func(a []int)) {
	a := make([]int, n)
	for i := 0; i < n; i++ { a[i] = i }
	swap := func(i,j int) { a[i],a[j] = a[j],a[i] }

	fn(a)
	for i := n-2; i >= 0; i-- {
		if a[i] > a[i+1] { continue }
		for j := n-1; j >= 0; j-- {
			if a[i] > a[j] { continue }
			swap(i,j)
			for k := i+1; k < (n+i+1)/2; k++ { swap(k,n-(k-i)) }
			fn(a)
			i = n-1
			break
		}
	}
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<int,P>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
using namespace std;
int mypow(int a,int b){
	if(b==0) return 1;
	if(b%2) return mypow(a,b-1)*a%mod;
	int z=mypow(a,b/2);
	return z*z%mod;
}
signed main(){
	int a=1,b=1,n,c;
	cin>>n;
	f(i,n){
		cin>>c;
		b*=(c-1)%2+1;
		a*=3;
	}
	cout<<a-b<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    int ans=0;
    cin>>a>>b;
    int outlet=1;
    while(outlet<b){
        --outlet;
        outlet+=a;
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

namespace {

using LL = unsigned long long;
constexpr LL P = 2019u;

} // namespace

int main()
{
  LL L, R;
  cin >> L >> R;
  if (R - L > P) {
    cout << 0 << '\n';
    return 0;
  }

  LL min{P};
  for (LL i = L; i <= R; ++i) {
    for (LL j = i + 1; j <= R; ++j) {
      const LL a = i % P;
      const LL b = j % P;
      const LL c = (a * b) % P;
      min = (c < min) ? c : min;
    }
  }
  cout << min << '\n';
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int res = Integer.MAX_VALUE;
		int N = scan.nextInt();
		int as[] = new int[N + 1];
		as[0] = 0;

		for(int i = 1; i <= N; i++) {
			as[i] = as[i - 1] + scan.nextInt();
		}

		for(int i = 1; i < N; i++) {
			res = Math.min(res, Math.abs(2 * as[i] - as[N]));
		}

		System.out.println(res);
	}
}

Measured memory_bytes: 23892
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>

using namespace std;

typedef long long ll;
const ll N = 20, M = 20;
const ll INF = 0x7fffffff;
ll n, m, x;
ll c[N];
ll a[N][M];
ll xx[M];
ll res = INF, sum;

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

	for (ll i = 0; i < n; i++) {
		cin >> c[i];
		for (ll j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}

	for (ll i = 1; i <= (1 << n) - 1; i++) {
		for (ll j = 0; j < m; j++) {
			xx[j] = 0;
		}
		sum = 0;

		for (ll j = 0; j < n; j++) {
			ll t = i & (1 << j);
			if (t != 0) {
				sum += c[j];
				for (ll k = 0; k < m; k++) {
					xx[k] += a[j][k];
				}
			}
		}

		ll j;
		for (j = 0; j < m; j++) {
			if (xx[j] < x) {
				break;
			}
		}
		if (j == m) {
			res = min(res, sum);
		}

	}

	cout << (res == INF ? -1 : res) << endl;

	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using PL = pair<ll, ll>;
// Welcome to my source code!

int main() {
    string s;
    cin >> s;
    int n = s.size();
    bool flag = true;
    for (int i = 0; i < n / 2; i++) {
        if (s[i] != s[n - 1 - i]) flag = false;
    }
    string l = s.substr(0, (n - 1) / 2);
    int m = l.size();
    for (int i = 0; i < m / 2; i++) {
        if (l[i] != l[m - 1 - i]) flag = false;
    }
    string r = s.substr((n + 2) / 2, n - (n + 2) / 2);
    int w = r.size();
    for (int i = 0; i < w / 2; i++) {
        if (r[i] != r[w - 1 - i]) flag = false;
    }
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend()
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   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; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

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

int main(){
  ll x, y, z;
  cin >> x >> y >> z;
  cout << (x * y / 2) << endl;
  
}


Measured memory_bytes: 256
// ~maqsat~

// #pragma GCC target ("avx2")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define in insert
#define pb push_back
#define eb emplace_back
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define count1 __builtin_popcountl
#define debug(x) cerr << (#x) << " = " << (x) << "\n"
#define ACCELERATE ios_base::sync_with_stdio(false),cin.tie(nullptr)
#define fre(f) if(fopen(f".in", "r")) freopen(f".in", "r", stdin),freopen(f".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
using db = double;
using ld = long double;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<ii> vii;
typedef vector<pll> vll;
typedef vector<int> vi;
typedef vector<ll> vl;

template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> inline void cmin(T &a, T b) { a = min(a, b); }
template <class T> inline void cmax(T &a, T b) { a = max(a, b); }

const int oo = 0x3f3f3f3f;
const ll N = 1e5 + 345;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 9;
const db EPS = 1e-9;
const db PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

int main() {
	fre("");
	ACCELERATE;

	int n;
	cin >> n;
	int a[55];
	for(int i = 0; i < n; i++) {
	    cin >> a[i];
	}
	
	ll ans = 0;
	for(int i = 0; i < n; i++) {
	    for(int j = i + 1; j < n; j++) {
	        ans += (a[i] * a[j]);
	    }
	}
    cout << ans;
	return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define irep(i, n) for(int i=n-1;i>=0;i--)
#define sort(x) sort(x.begin(), x.end())
typedef long long ll;
typedef vector<long long> llv;
typedef vector<vector<long long> > llvv;


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

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main(){
    ll k;
    scanf("%lld",&k);
    ll a[50];
    REP(i,50)
        a[i] = i + k / 50;
    REP(i,k % 50){
        REP(j,50)
            if(i == j)
                a[i] += 50;
            else
                a[j]--;
    }
    printf("50\n");
    REP(i,50)
        printf("%lld ",a[i]);
    printf("\n");
    return 0;
}



Measured memory_bytes: 256
/*
Hey there stalker....

█▀▀▄░░░░░░░░░░░▄▀▀█
░█░░░▀▄░▄▄▄▄▄░▄▀░░░█
░░▀▄░░░▀░░░░░▀░░░▄▀
░░░░▌░▄▄░░░▄▄░▐▀▀
░░░▐░░█▄░░░▄█░░▌▄▄▀▀▀▀█
░░░▌▄▄▀▀░▄░▀▀▄▄▐░░░░░░█
▄▀▀▐▀▀░▄▄▄▄▄░▀▀▌▄▄▄░░░█
█░░░▀▄░█░░░█░▄▀░░░░█▀▀▀
░▀▄░░▀░░▀▀▀░░▀░░░▄█▀
░░░█░░░░░░░░░░░▄▀▄░▀▄
░░░█░░░░░░░░░▄▀█░░█░░█
░░░█░░░░░░░░░░░█▄█░░▄▀
░░░█░░░░░░░░░░░████▀
░░░▀▄▄▀▀▄▄▀▀▄▄▄█▀

Like what you see?
*/
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pii         pair<ll ,ll>
#define vi          vector<ll>
#define present(container, element) (container.find(element) != container.end()) /* For set n maps */
#define cpresent(container, element) (find(all(container),element) != container.end()) /* For vectors */
#define all(a)      (a).begin(),(a).end()
#define invect(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.pb(tmp);commands}
#define inset(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.I(tmp);commands}
#define F           first
#define S           second
#define I           insert
#define sz(x)       (ll)x.size()
#define rep(i,a,b)    for(ll  i=a;i<b;i++)
#define repr(i,a,b) for(ll  i=a;i>b;i--)
#define trav(a, x) 	for(auto& a : x)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define lcase(a) (char)tolower(a)
#define ll long long int
#define lld long double
#define endl "\n"
#define PI 3.14159265358979323844
#define MOD 1000000007
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define mod 1e9 + 7
/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_is(x)  cerr << #x << " is " << x << endl;

int main()
{
   IOS

    int TESTS=1;
    //cin >> TESTS;
    while (TESTS--)
    {
        ll n;
        cin>> n;
        vi v(n);
        ll xori=0,ans;
        rep(i,0,n)
        {
            cin>> v[i];
            xori^=v[i];
        }
        rep(i,0,n)
        {
            ans=xori^v[i];
            cout<< ans << " ";

        }

    }
    return 0;
}



Measured memory_bytes: 4760
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a1.reverse()
a2.reverse()
ans = 0
for i in range(n):
    c = sum(a1[i:])+sum(a2[:i+1])
    ans = max(ans,c)
print(ans)

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

bool erato[100010];
int dp[100010];

void Eratosthenes() {
	erato[0] = erato[1] = true;
	for (int i = 2; i < 100010; i++) {
		if (erato[i]) continue;
		for (int j = i * 2; j < 100010; j += i) {
			erato[j] = true;
		}
	}
}

void solv() {
	dp[1] = 0;
	for (int i = 3; i < 100010; i+=2) {
		if (erato[i] == false && erato[(i + 1) / 2] == false) {
			dp[i] = dp[i - 2] + 1;
		}
		else {
			dp[i] = dp[i - 2];
		}
	}
}

int main() {
	Eratosthenes();
	solv();
	int Q, l, r;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		cin >> l >> r;
		l = max(l - 2, 1);//左端を含む
		cout << dp[r] - dp[l] << endl;
	}

	return 0;
}


Measured memory_bytes: 1152
import java.util.*;

class Main{
    
   public static void main(String a[]) throws java.io.IOException{
       Scanner scan =new Scanner (System.in);
       int total=0;
       for(int i=0;i<4;i++){
           total+=scan.nextInt();
       }
       System.out.println(total/60);
       System.out.println(total%60);
   }
}

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

#define infile "../test/sample-1.in"
#define int long long
// #define INF 2147483647
#define INF 1000000000000000000LL
#define MOD 1000000007LL

// {{{ define basic macro
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) repi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)(b-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)

#define foreach(x,a) for(auto& (x) : (a) )
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

#define all(x) (x).begin(),(x).end()
#define sum(v) accumulate(all(v), 0)
#define sz(x) ((int)(x).size())
template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
#define fill(x,y) memset(x,y,sizeof(x))
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ten(n) ((int)1e##n)

template <class T = int>
T in() {T x; cin>>x; return (x);}

struct Fast {
  Fast(){
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
// }}}
//{{{ dump macro
#ifdef PCM
  #include "dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}
//{{{ others
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;
template<typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;

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

string s;
int n;

bool check(int k){
  int tmp = s[n-k];
  rep(i, n-k, k){
    if (tmp!=s[i]){
      return true;
    }
  }
  return false;
}

int solve(){
  cin>>s;
  n = sz(s);

  int left = n/2;
  int right = n+1;
  while (right-left>1){
    int mid = (right+left)/2;
    if (check(mid)) { right = mid;}
    else{ left = mid; }
  }

  cout << right-1 << endl;

  return 0;
}

int test(){ //{{{
  return 0;
}
//}}}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
#ifdef PCM
  test();
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 512
# ALDS1_4_D: Allocation

MAX_N_LOADS = 100000
MAX_WEIGHT  = 10000

def loadable_num(n_trucks, load_weights, capacity)
  w_loaded = 0
  n_trucks_loaded = 0
  load_weights.each_with_index do |weight, i|
    return i if capacity < weight
    w_loaded += weight
    if capacity < w_loaded
      w_loaded = weight
      n_trucks_loaded += 1
      return i if n_trucks == n_trucks_loaded
    end
  end
  load_weights.size
end

def find_min_capacity(n_trucks, load_weights)
  left    = 0
  right   = MAX_N_LOADS * MAX_WEIGHT
  n_loads = load_weights.size
  while left < right
    mid = (left + right) / 2
    n_loadables = loadable_num(n_trucks, load_weights, mid)
    if n_loadables < n_loads
      left = mid + 1
    else
      right = mid
    end
  end
  right
end

n_loads, n_trucks = gets.split.map &:to_i
load_weights = n_loads.times.map do
  gets.chomp.to_i
end

puts find_min_capacity(n_trucks, load_weights)

Measured memory_bytes: 9780
W, H, N = map(int, input().split())
m = [[0] * W for _ in range(H)]
for _ in range(N):
  x, y, a = map(int, input().split())
  if a == 1: 
    for w in range(x):
      for h in range(H):
        m[h][w] = 1
  elif a == 2:
    for w in range(x , W):
      for h in range(H):
        m[h][w] = 1
  elif a == 3:
    for w in range(W):
      for h in range(y):
        m[h][w] = 1
  else:
    for w in range(W):
      for h in range(y, H):
        m[h][w] = 1
print(sum(m, []).count(0))

Measured memory_bytes: 9356
#include <stdio.h>

int main() {
    char s[15], a[15];
    int l = 0;
    scanf("%s", s);
    for (int i = 0; s[i] != '\0'; i++) {
        if (s[i] != 'B') {
            a[l] = s[i];
            l++;
        } else {
            if (l != 0) {
                l--;
            }
        }
    }
    for (int i = 0; i < l; i++) {
        printf("%c", a[i]);
    }
    puts("\n");
}

Measured memory_bytes: 128
N, M, K = map(int, input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])

ans, j = 0, M
for i in range(N+1):
    if a[i] > K:
        break
    while b[j] > K-a[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)


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

using namespace std;

const int MOD = 1000000007;

int main(){
    int N, M;
    while(cin >> N >> M){
        using vl = vector<long long>;
        using vvl = vector<vl>;
        vector<vvl> dp(N+1, vvl(N+1, vl(N+1, 0)));
        dp[0][0][0] = 1;
        vector<vector<pair<int, int>>> cond(N+1);
        for(int i=0;i<M;i++){
            int l, r, x; cin >> l >> r >> x;
            cond[r].emplace_back(l, x);
        }
        auto getKind = [&](int l, int a, int b, int c){
            int res = 0;
            if(l <= a) ++res;
            if(l <= b) ++res;
            if(l <= c) ++res;
            return res;
        };
        auto isValidPair = [&](int r, int a, int b, int c){
            for(const auto& p : cond[r]){
                if(getKind(p.first, a, b, c) != p.second) return false;
            }
            return true;
        };
        long long res = 0;
        for(int i=0;i<=N;i++){
            for(int j=0;j<=N;j++){
                for(int k=0;k<=N;k++){
                    if(!dp[i][j][k]) continue;
                    int last = max(i, max(j, k));
                    bool valid = isValidPair(last, i, j, k);
                    if(last == N){
                        if(valid) res = (res + dp[i][j][k]) % MOD;
                        continue;
                    }
                    if(!valid) continue;
                    dp[last+1][j][k] = (dp[last+1][j][k] + dp[i][j][k]) % MOD;
                    dp[i][last+1][k] = (dp[i][last+1][k] + dp[i][j][k]) % MOD;
                    dp[i][j][last+1] = (dp[i][j][last+1] + dp[i][j][k]) % MOD;
                }
            }
        }
        cout << res << endl;
    }
}


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

int main() {
  int n, red = 0, blue = 0;
  string s;

  cin >> n;
  cin >> s;

  for (int i = 0; i < n; i++) {
    if (s[i] == 'R') red++;
    else blue++;
  }

  if (red > blue) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF (1 << 29)
#define LLINF (1LL << 60)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

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

string to_string(string s) { return s; }

template <class S, class T>
string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + "," + to_string(p.second) + "}";
}

template <class S>
string to_string(unordered_set<S> s) {
  string ret = "{";
  for (S x : s) ret += to_string(x) + ",";
  return ret + "}";
}

template <class S, class T>
string to_string(map<S, T> m) {
  string ret = "{";
  for (pair<S, T> x : m) ret += to_string(x) + ",";
  return ret + "}";
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < (int)v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() { cerr << endl; }

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() { cout << endl; }

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

int main() {
  cin.tie(0);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 1;
  FOR(i, N - 1) {
    if (S[i] != S[i + 1]) ans++;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 512
#[allow(dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n:usize,
        xx: [(isize, isize); n],
    }
    // (start, end)
    let mut xx = xx.into_iter().map(|(x, l)| (x - (l - 1), x + (l + 1))).collect::<Vec<(isize, isize)>>();
    xx.sort_by(|&(_, lend), &(_, rend)| lend.cmp(&rend));

    let mut last = -1_000_000_001;
    let mut cnt = 0;
    for (s, e) in xx {
        if last <= s {
            cnt += 1;
            last = e;
        }
    }

    println!("{}", cnt);
}


Measured memory_bytes: 8444
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>

#define div 1000000000+7

typedef long long ll;

using namespace std;

void solve(){
    int n, x = 0, max = 0;
    string s;

    cin >> n >> s;
    for(int i = 0; i < n; i++){
        if(s[i] == 'I'){
            x++;
        }else{
            x--;
        }
        if(x > max){
            max = x;
        }
    }
    cout << max << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;

  cin >> N;

  vector<int> a(3*N);

  long st=0;

  for(int i=0;i<3*N;i++){
    cin >> a.at(i);
  }

  sort(a.begin(),a.end());

  reverse(a.begin(),a.end());
  
  for(int i=0;i<N;i++){ 
    st+= a.at(1+2*i);
  }
 
  cout << st << endl;
 
  return 0;
}

Measured memory_bytes: 1408
#include <cstring>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <numeric>
#include <stack>

using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<ll, ll> mpll;
typedef unordered_map<char, ll> mpcl;
typedef unordered_map<string, ll> mpsl;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

ll inl() {
    ll x;
    cin >> x;
    return (x);
}

string ins() {
    string x;
    cin >> x;
    return (x);
}

ll factorial(ll n) {
    ll ans = 1;
    while (n > 1) {
        ans *= n;
        ans %= mod;
        n--;
    }
    return ans;
}

int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
    while (true) {
#pragma clang diagnostic pop
#endif
        ll n = inl(), m = inl();
        if (abs(n - m) > 1) cout << 0 << endl;
        else {
            ll ans;
            if (n == m) {
                ans = factorial(n) * factorial(m) % mod;
                ans *= 2;
                ans %= mod;
            } else {
                ans = factorial(max(m, n)) * factorial(min(m, n)) % mod;
            }
            cout << ans << endl;
        }

#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan =new Scanner(System.in);
		int K=scan.nextInt();
		String S=scan.next();
		if(S.length()<=K) {
			System.out.print(S);
		}
		else {
			for(int i=0;i<K;i++)
				System.out.print(S.charAt(i));
			System.out.print("...");
		}
	}

}


Measured memory_bytes: 35668
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
using namespace std;
const int N=1000005,P=1e9+7;
int n,H,D,f[N],fac[N],sum[N];
int fpow(int k1,int k2){int k3=1;for(;k2;k2>>=1,k1=1LL*k1*k1%P)if(k2&1)k3=1LL*k3*k1%P;return k3;}
int main(){
	fac[0]=1;rep(i,1,N-1)fac[i]=1LL*fac[i-1]*i%P;
	scanf("%d%d%d",&n,&H,&D);
	f[0]=1,sum[0]=1;
	int c=0;
	rep(i,1,n)(c+=fac[i])%=P;
	rep(i,1,H){
		int num=sum[i-1];
		if(i-D>0)(num-=sum[i-D-1])%=P;
		f[i]=1LL*num*c%P;
		sum[i]=(sum[i-1]+f[i])%P;
	}
	f[H]=1LL*f[H]*fac[n]%P*fpow(c,P-2)%P;
	printf("%d\n",(f[H]+P)%P);
	return 0;
}

Measured memory_bytes: 11904
//
//  main.cpp
//  ARC 084 A Snuke
//
//  Created by Shuangyi Zhang on 11/4/17.
//  Copyright © 2017 Shuangyi Zhang. All rights reserved.
//

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll n,a[100005],b[100005],c[100005],d[100005];
ll ans;
int main() {
    cin>>n;
    for (ll i=0;i<n;i++){
        cin>>a[i];
        //a[i]=-a[i];
    }
    for (ll i=0;i<n;i++){
        cin>>b[i];
        //b[i]=-b[i];
    }
    for (ll i=0;i<n;i++){
        cin>>c[i];
        //c[i]=-c[i];
    }
    sort(a,a+n);
    sort(b,b+n);
    sort(c,c+n);
   /* for (ll i=0;i<n;i++){
        cout<<a[i]<<" ";
    }
    cout<<endl;
    for (ll i=0;i<n;i++){
        cout<<b[i]<<" ";
    }
    cout<<endl;
    for (ll i=0;i<n;i++){
        cout<<c[i]<<" ";
    }
    cout<<endl;
  */
    for (ll i=0;i<n;i++){
        ll head=0;
        ll tail=n-1;
        while (head<=tail){
            ll mid=(head+tail)/2;
            //if (i==2) cout<<mid<<" ";
            if (c[mid]<=b[i]){
                head=mid+1;
            }else{
                tail=mid-1;
            }
        }
        d[i]=n-head;
    }
    for (ll i=n-2;i>=0;i--){
        d[i]+=d[i+1];
    }
    
    ans=0;
    for (ll i=0;i<n;i++){
        ll head=0;
        ll tail=n-1;
        while (head<=tail){
            ll mid=(head+tail)/2;
            if (b[mid]<=a[i]){
                head=mid+1;
            }else{
                tail=mid-1;
            }
        }
        if (head==n) break;
        //for (ll j=head;j<n;j++){
            ans+=d[head];
        
        //cout<<head<<" ";
        
    }
    cout<<ans;
    return 0;
}


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

int main() {
    int n, m;
    int flag = 0;
    cin >> n >> m;
    vector<int> a(m);
    for(int i = 0; i < m; i++){cin >> a[i];}
    for(int i = 0; i < m; i++)
    {
        n = n - a[i];
        if(n < 0)
        {
            flag = 1;
            break;
        }
    }
    if(flag == 1){cout << -1 << endl;}
    else{cout << n << endl;}
    
    return 0;
}

Measured memory_bytes: 3648
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;

const int MAX = 1000;

int main(){
    int N;
    int A[MAX][MAX];
    int cnt[MAX] = {0};
    int ans = 0;
    bool loop = true;

    cin >> N;
    for(int i = 0;i < N;i++){
        for(int j = 0;j < N - 1;j++){
            cin >> A[i][j];
            A[i][j]--;
        }
    }

    while(loop){
        int ng = true;
        bool check[MAX] = {false};

        for(int i = 0;i < N;i++){
            int j = A[i][cnt[i]];

            if(check[i] || check[j])continue;
            if(A[i][cnt[i]] != j || A[j][cnt[j]] != i)continue;

            check[i] = true;
            check[j] = true;
            cnt[i]++;
            cnt[j]++;
            ng = false;
        }

        for(int i = 0;i < N;i++){
            if(cnt[i] < N - 1)break;
            if(i == N - 1)loop = false;
        }
        ans ++;
        
        if(ng){
            ans = -1;
            loop = false;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4096
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

vector<vector<int>> a(0);
int g;
vector<int> s(0),t(0);
int cnt=1;

int dfs(int x){
    s[x]=cnt;
    cnt ++;
    for(auto y:a[x]){
        if(s[y]==-1){
            dfs(y);
        }
    }
    t[x]=cnt;
    cnt ++;
}

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    cin>>g;
    a=vector<vector<int>>(g,vector<int>(0));
    int k,x;
    rep(i,g){
        cin>>k;
        cin>>k;
        rep(j,k){
            cin>>x;
            a[i].emplace_back(x-1);
        }
    }
    s.resize(g,-1);t.resize(g,-1);
    rep(i,g){
        if(s[i]==-1) dfs(i);
    }
    rep(i,g) cout<<i+1<<" "<<s[i]<<" "<<t[i]<<'\n';
}


Measured memory_bytes: 3220
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int main() {
    fastio();

    int n;
    cin >> n;
    n %= 10;
    if (n == 3) {
        cout << "bon" << endl;
    } else if (n == 0 || n == 1 || n == 6 || n == 8) {
        cout << "pon" << endl;
    } else {
        cout << "hon" << endl;
    }

    return 0;
}

Measured memory_bytes: 3636
#include<cstdio>
#include<queue>
#include<iostream>
using namespace std;
int n, visited[101], d[101];
int adj[101][101];
queue<int> q;
void bfs(int u)
{
  if(visited[u]) return;
  q.push(u);
  visited[u] = 1;
  while(!q.empty())
  {
    int v = q.front();
    for(int i=1; i<=n; i++)
    {
      if(adj[v][i] && visited[i]==0)
      {
        q.push(i);
        visited[i] = 1;
        d[i] = d[v] + 1;
      }
    }
    q.pop();
  }
}
int main()
{
  scanf("%d", &n);
  for(int i=0; i<=n; i++)
  {
    for(int j=0; j<=n; j++)
      adj[i][j] = 0;
    visited[i] = 0;
    d[i] = -1;
  }
  d[1] = 0;
  int u, k, v;
  for(int i=0; i<n; i++)
  {
    scanf("%d%d", &u, &k);
    for(int j=0; j<k; j++)
    {
      scanf("%d", &v);
      adj[u][v] = 1;
    }
  }
//  for(int i=1; i<=n; i++)
//  {
//    if(visited[i] == 0)
//      bfs(i);
//  }
  bfs(1);
  for(int i=1; i<=n; i++)
  {
    printf("%d %d\n", i, d[i]);
  }


  return 0;
}



Measured memory_bytes: 3232
#include <iostream>
using namespace std;
typedef long long ll;
const ll N = 1e5 + 10;
ll nums[N];
ll n, m;

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

ll get_lcm(ll arr[])
{
    ll res = 1;
    for(int i = 1; i <= n; i ++)
    {
        res = (res * arr[i])/gcd(res, arr[i]);
    }
    return res;
}

int main()
{
    cin >> n >> m;
    nums[0] = 1;
    for(int i = 1; i <= n; i ++)
    {
        cin >> nums[i];
        nums[i] /= 2;
    }
    ll lcm = get_lcm(nums);
    for(int i = 1; i <= n; i ++)
    {
        if(((lcm / nums[i]) & 1) == 0) 
        {
            cout << 0 << endl;
            return 0;
        }
    } 
    if(lcm > m) 
    {
        cout << 0 << endl;
        return 0;
    }
    else {
        cout << (m + lcm) / (2 * lcm) << endl;
        return 0;
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod=1000000007;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll h,w,k,m;
    cin>>h>>w>>k;
    ll dp[h+1][w];
    memset(dp,0,sizeof(dp));
    dp[0][0]=1;
    w--;
    bool maki[w];
    for(int i=1;i<=h;i++){
        for(int bit=0;bit<(1<<w);bit++){
            m=-2;
            for(int j=0;j<w;j++){
                maki[j]=false;
                if(bit&(1<<j)){
                    if(j-m==1){
                        m=-1;
                        break;
                    }else{
                        maki[j]=true;
                        m=j;
                    }
                }
            }
            if(m==-1)continue;
            for(int j=0;j<=w;j++){
                if(j&&maki[j-1]){
                    dp[i][j-1]+=dp[i-1][j];
                    dp[i][j-1]%=mod;
                    dp[i][j]+=dp[i-1][j-1];
                    dp[i][j]%=mod;
                }
                if((j==0||maki[j-1]==0)&&(j==w||maki[j]==0)){
                    dp[i][j]+=dp[i-1][j];
                    dp[i][j]%=mod;
                }
            }
        }
    }
    cout << dp[h][k-1]<<endl;
    return 0;
}

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

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

    int a;
    bool isEven = true;
    for (int i = 0; i < N; i++)
    {
        cin >> a;
        if (a % 2 != 0)
        {
            cout << "first" << endl;
            return 0;
        }
    }
    cout << "second" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
int main(){
	char a[2000];
	scanf("%[^\n]",a);
	for(int i = 4; i < strlen(a); i++){
        if(a[i-4] == 'a' && a[i-3] == 'p' && a[i-2] == 'p' && a[i-1] == 'l' && a[i] == 'e'){
            strncpy(a+i-4,"peach",5);
        }
        else if(a[i-4] == 'p' && a[i-3] == 'e' && a[i-2] == 'a' && a[i-1] == 'c' && a[i] == 'h'){
            strncpy(a+i-4,"apple",5);
        }
	}
    printf("%s\n",a);

    return 0;
}

Measured memory_bytes: 1108
#include <stdio.h>
#define ll long long int

int main(void) {
    ll s;
    scanf("%lld", &s);
    int v = 1000000000;
    
    ll x = (v - s%v) % v;
    ll y = (s + x) / v;
    
    printf("0 0 1000000000 1 %lld %lld\n", x, y);
    return 0;
}


Measured memory_bytes: 128
#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef tuple<ll,ll,ll> tl3;
// https://atcoder.jp/contests/abc176/tasks/abc176_a
int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);

    ll n,x,t;
    cin >> n >> x >> t;
    ll a = ceil((ld)n/x);
    printf("%lld",a*t);

    return 0;
}



Measured memory_bytes: 3756
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath> 
#include <cstdlib> // abs(int)
#include <numeric>
#include <iomanip>
#include <map>
#include <set>

using namespace std;

#define roundup(n,d) ( ((n) + ((d)-1)) / (d) )
#define assign_max(into, compared) (into = max((into), (compared)))
#define assign_min(into, compared) (into = min((into), (compared)))
#define rep(i,n) for(long long i = 0;i < n;++i)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(nullptr);
#define fix(n) fixed << setprecision(n)
#define ALL(v) v.begin(),v.end()

#define PI 3.14159265358979323846;

using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;


int main(void){
    FAST_IO
    string s,t;
    cin >> s >> t;
    cout << t << s << endl;
}


Measured memory_bytes: 3040
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#define INF 100000
#define rep(i,n) for(int i =0;i<n;i++)
using namespace std;
typedef long long int ll;


int main(){
    int h,w;
    cin >> h >> w;
    char ma[h][w];
    for (int i=0; i<h; i++) {
        for (int j=0; j<w; j++) {
            cin >> ma[i][j];
        }
    }
    for (int i=0; i<h; i++) {
        int flag=1000;
        for (int j=0; j<w; j++) {
            if (ma[i][j]=='c') {
                flag = j;
            }
            if (j-flag>=0) {
                cout << j-flag;
            }else{
                cout << -1;
            }
            if (j!=w-1) {
                cout << " ";
            }else{
                cout << endl;
            }
        }
    }
}

Measured memory_bytes: 1168
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class BCountBalls {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            long n = s.nextLong(), a = s.nextLong(), b = s.nextLong(), m = n % (a + b);
            long tot = n / (a + b);
            w.print(tot * a + Math.min(m, a));
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public long nextLong() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }

            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 22100
#include<bits/stdc++.h>
#define mem(x,y) memset(x,y,sizeof(x))
#define bug printf("!!!!!\n");
#define lowbit(x) (x)&(-x)
#define ull unsigned long long
#define ll long long
#define PI acos(-1.0)
#define pb push_back
#define st(x) x.begin()
#define ed(x) x.end()
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define lll rt<<1
#define rrr rt<<1|1
#define gcd __gcd
#define se second
#define fi first
#define eps  1e-2
using namespace std;

const int maxn = 1e5+7;
const ll  INF  = 1<<30;
const int mod  = 1e9+7;

void solve()
{
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    if(k%2==0){
        cout<<a-b<<endl;
    }else{
        cout<<b-a<<endl;
    }
    return ;
}

int main()
{
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    ios::sync_with_stdio(false);
    int cas=1,t=1;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ",cas++);
        solve();
    }
    return 0;
}


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

int main(){
  ll n,m,j=0,sum=0,a,b;
  cin >> n>>m;
  vector<pair<ll,ll>> p(n);
  r(i,n){
    cin >> a >> b;
    p.at(i)=make_pair(a,b);
  }
  sort(p.begin(),p.end());
  while(m){
    if(p.at(j).second<m){
      m-=p.at(j).second;
      sum+=p.at(j).first*p.at(j).second;
    }
    else {
      sum+=p.at(j).first*m; m=0;
    }
      j++;
  }
  cout << sum << endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll unsigned long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
const int mod = 1e9 + 7;
int main()
{
	SPEED
	int a, b;
	cin >> a >> b;
	

	for (int x = min(a, b); x <= 1250; ++x)
	{
		if (floor(0.08*x)==a && floor(0.1*x)==b)
		{
			cout << x;
			return 0;
		}
	}

	cout << -1;
	return 0;
}

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


int main(void){
    int seconds[100]={};
    int a, b, c, d;
    int i;
    int ans;
    ans = 0;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    for (i = a; i < b; i++){
        seconds[i] += 1;
    }
    for (i = c; i < d; i++){
        seconds[i] += 1;
    }

    for (i = 0; i < 100; i++){
        if (seconds[i] == 2){
            ans++;
        }
    }

    printf("%d\n", ans);

    return 0;
}

Measured memory_bytes: 128
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val in = new Scanner(System.in)
    val s = in.next().toCharArray

    var a = 0
    var b = 0
    var c = 0
    s.foreach(x => if (x == 'a') {
      a += 1
    } else if (x == 'b') {
      b += 1
    } else {
      c += 1
    })

    val min = math.min(a, math.min(b, c))
    a -= min
    b -= min
    c -= min
    if (math.max(a, math.max(b, c)) > 1) {
      println("NO")
    } else {
      println("YES")
    }
  }
}


Measured memory_bytes: 31160