akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){

  int n,a,b;
  string str;

  string s,t;
  cin >>s >> t;
  cout << (s==t ? 'H' : 'D' ) fin;
  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



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

int main() {

	int n, q; cin >> n >> q;

	// グラフ入力受取 (ここでは無向グラフを想定)
	Graph G(n);
	for (int i = 0; i < n - 1; ++i) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	vector<int> point(n, 0);
	for (int i = 0; i < q; i++) {
		int p, x; cin >> p >> x;
		point[--p] += x;
	}

	vector<int> dist(n, -1); // 全頂点を「未訪問」に初期化
	queue<int> que;

	// 初期条件 (頂点 0 を初期ノードとする)
	dist[0] = 0;
	que.push(0); // 0 を橙色頂点にする

	// BFS 開始 (キューが空になるまで探索を行う)
	bool first = true;
	while (!que.empty()) {
		int v = que.front(); // キューから先頭頂点を取り出す
		que.pop();

		// v から辿れる頂点をすべて調べる
		for (int new_v : G[v]) {				
			if (dist[new_v] != -1) continue; // すでに発見済みの頂点は探索しない

			// 新たな白色頂点 new_v について距離情報を更新してキューに追加する
			point[new_v] += point[v];
			dist[new_v] = dist[v] + 1;
			que.push(new_v);
		}
	}	
	for (int i = 0; i < n; i++) {
		cout << point[i] << " ";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 17388
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
int ABS(int a) {if(a<0) a = -a; return a;}
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数の個数*/int divisor_number(int n){auto p = prime_factor(n); int res = 1; for(auto x:p)res*=(x.second+1); return res;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int x,a,b; cin >> x >> a >> b;
    x-=a;
    out(max(x%b,0LL));

    return 0;
}

Measured memory_bytes: 256
/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *NOIP 2019 RP++                                           *
 ***********************************************************/
//#pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
	char *pp = (char*)malloc(size) + size;  \
	__asm__("movl %0, %%esp\n" :: "r"(pp))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<fstream>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mn 200020
#define Max(x,y) (((x)>(y))?(x):(y))
#define Min(x,y) (((x)<(y))?(x):(y))
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (1<<30)
#define mod (int)(1e9+7)
#define FOR(a,b,c) for (register int a=b;a<=c;++a)
#define FORD(a,b,c) for (register int a=b;a>=c;--a)
using namespace std;
//char buf[1<<20],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline ll read(){
	ll x=0,f=1;char c;
	for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
	for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());return x*f;
}
template<typename T>
inline void write(T a){
	if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
	while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//
ll n,a[mn],k,sum,b[mn],s1[mn],s2[mn];
inline bool ch(int c){
	int ta=0,tb=0;
	FOR(i,1,n)b[i]=a[i]%c;
	sort(b+1,b+1+n);
	FOR(i,1,n)s1[i]=s1[i-1]+b[i];
	FORD(i,n,1)s2[i]=s2[i+1]+(c-b[i]);
	FOR(i,0,n)if(s1[i]==s2[i+1]&&s1[i]<=k)return 1;
	return 0;
}
signed main(){
	#ifdef _WIN32
		// freopen("0.in","r",stdin);
		// freopen("0.out","w",stdout);
		long double be=clock();
	#endif
	n=read();k=read();
	FOR(i,1,n)a[i]=read(),sum+=a[i];
	ll ans=1,sq=sqrt(sum);
	FOR(i,1,sq)if(sum%i==0){
		if(ch(i))ans=Max(ans,i);
		if(ch(sum/i))ans=Max(ans,sum/i);
	}
	writeln(ans);
	#ifdef _WIN32
		long double en=clock();
		printf("Time: %.0Lfms\n",en-be);
		fclose(stdin);fclose(stdout);
	#endif
	return 0;
}

Measured memory_bytes: 4352
//#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=1e9+7;
const int MAXN=1e5+9;
const double eps=1e-8;
const long double pi=3.1415926535897932384626433832795;
const long double e=2.71828182845904523536028747135266;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int t=1;
    while(t--){
        ll n,a,b;
        cin >>  n >> a >> b;
        ll ans=n/(a+b)*a+(n%(a+b)>=a?a:n%(a+b));
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#coding: utf-8
import math
import heapq

MOD = 10**9+7

a,b,x = map(int, input().split())

V = (a**2)*b

if x>=(V/2):
    h = 2*b-2*x/(a*a)
    htan = h/a
else:
    h = 2*x/(a*b)
    htan = b/h

ans = math.atan(htan)*180/(math.atan(1.0)*4)
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>

int main() {
	int S;
	int h, m, s;
	
	scanf("%d", &S);

	int t = S % 3600;
	h = S / 3600;
	m =t / 60;
	s = t % 60;

	printf("%d:%d:%d\n", h, m, s);

	return 0;
}

Measured memory_bytes: 1812
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<float, float>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
    }
    double sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            sum += sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
        }
    }
    cout << fixed << setprecision(10) << (sum * 2.0) / (n * 1.0);
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

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

#define fo1(i, n) for (int i = 0; i < n; i++)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int((x).size())
using ll = long long; using vi = vector<int>; using ii = pair<int,int>;
const int oo = 0x3f3f3f3f; const ll OO = ll(oo)*oo;
#ifndef DEBUG
#define endl '\n'
#define debugf(...)
#define debug(...)
#else
#define debugf(...) printf(__VA_ARGS__)
#define debug(...) __VA_ARGS__
#endif
const int N = 200005;

ll ps[N];
map<ll, ll> f;

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

	int n;
	ll k;
	cin >> n >> k;

	f[0] = 1;
	ll ans = 0;
	rep(i, 1, n+1) {
		ll x; cin >> x;
		ps[i] = (ps[i-1] + x) % k;

		if (i >= k) {
			ll a = i - k;
			f[((ps[a] - a)%k + k) % k]--;
		}

		ans += f[((ps[i] - i)%k + k) % k];
		f[((ps[i] - i)%k + k) % k]++;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 14336
/*

*/
#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,a,n) for(int i=(a);i<(n);i++)
#define repe(i,a) for(auto &i:a)

void Inparray1(vector<ll> &f,int n){for(int i=0;i<n;i++) cin>>f[i];}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n,k;
  cin>>n>>k;
  vector<ll> a(n);
  Inparray1(a,n);

  //各学期には期末テストが 1 回行われ、その点数に応じて、
  //以下のように各学期の評点が付けられます。
  //1 学期から K − 1 学期までの評点：付けられない。
  //K 学期から N 学期までの評点：
  //その学期を含めた直近 K 回の期末テストの点数を掛け算したもの。
  //K + 1 ≤ i ≤ N を満たすそれぞれの i について、
  //i 学期の評点が i − 1 学期の評点より真に高かったかどうか判定
  rep2(i,k,n){
    if(a[i-k]<a[i]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}

Measured memory_bytes: 4784
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (ll i=0;i<N;i++)
#define loop(i,N,M) for(ll i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)
#define MP(a,b) make_pair(a,b)

#if __has_include("debug.hpp")
#include "debug.hpp"
#else
template<typename T>
void debug(T& obj) {}
#endif

template<typename T>
T in(){
	T val;
	cin >> val;
	return val;
}

template<typename T>
vector<T> inv(ll num) {
	vector<T> val(num);
	rep(i,num) cin >> val[i];
	return val;
}

//----------------------------------------------------------------------
void solve() {

	ll n,k;
	cin >> n >> k;
	vector<ll> vec(n);
	rep(i,n) cin >> vec[i];

	SORTS2L(ll,vec);
	ll sum = 0;
	rep(i,n-k) sum += vec[i];

	cout << sum;

}
//----------------------------------------------------------------------

int main(int argc, char* argv[]) {
	solve();
	return 0;
}


Measured memory_bytes: 4776
#include <bits/stdc++.h>
#define endl "\n"

using namespace std;

int main(){
    string s, t, sum;
    int len, res=0;
    cin >> s >> t;
    sum=s+s;
    if(sum.find(t) != string::npos) res=1;
    cout << (res&1? "Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 256
// Sky's the limit :)
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    int T = 1; 
    // cin >> T; 
    while (T--) {
        int n;
        cin >> n;
        vector<int> a(n + 1);
        for(int i = 1; i <= n; i++)
            cin >> a[i];

        int ps[n + 1];
        ps[1] = a[1];
        for(int i = 3; i <= n; i += 2)
            ps[i] = a[i] + ps[i - 2];   

        int dp[n + 1] = {};
        // dp[1] = a[1];
        for(int i = 2; i <= n; i++) {
            if(i % 2 == 0)
                dp[i] = max(dp[i - 2] + a[i], ps[i - 1]);
            else
                dp[i] = max(dp[i - 1], dp[i - 2] + a[i]);
        }
        // for(int i = 1; i < n; i++)
        //     cout << dp[i] << ' ';
        cout << dp[n] << '\n';
    }
    
    return 0;
}



Measured memory_bytes: 7892
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rnfor(i,a,b) for(ll (i) = (a) - 1; (i) >= (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()

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

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

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    rep1(i, k)r = r * n-- / i;
    return r;
}

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep0(i, n)cin >> a[i];
    sort(all(a));
    rep0(i, n - 1){
        if(a[i] == a[i + 1]){
            pf("NO");
            return 0;
        }
    }
    pf("YES");
    return 0;
}


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;

namespace ProblemE
{
    class Program
    {
        class Range
        {
            public int Max { get; set; } 
            public int Min { get; set; }

            public Range(int max, int min)
            {
                Max = max;
                Min = min;
            }
        }

        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            var A = new List<int>();
            var B = new List<int>();
            var range = new Range[N];
            for(int i = 0; i < N; i++)
            {
                var temp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                range[i] = new Range(temp[1], temp[0]);
                A.Add(temp[0]);
                B.Add(temp[1]);
            }
            A.Sort();
            B.Sort((a, b) => b - a);

            
            var ans = new List<int>();
            if(N % 2 == 1)
            {                
                int min = A[N / 2];
                int max = B[N / 2];

                Console.WriteLine(max - min + 1);
            }
            else
            {
                var listx = new List<int>();
                var listy = new List<int>();

                int doublemin = A[N / 2 - 1] + A[N / 2];
                
                int doublemax = B[N / 2 - 1] + B[N / 2];

                Console.WriteLine(doublemax - doublemin + 1);
            }

           
        }
    }
}


Measured memory_bytes: 49860
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main(void) {
    
    
    // int x,a;
    // cin>>x>>a;
    // if(x<=a)fin(0);
    // else fin(10);
    string s;
    cin>>s;
    Sort(s);
    if(s=="abc")fin("Yes");
    else fin("No");
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<deque>
#include<bitset>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
typedef long long ll;
typedef pair<ll,ll> P;
template<class T> inline bool chmax(T&a , T b){ if(a<b){ a=b; return true; } else{ return false; } }
template<class T> inline bool chmin(T&a , T b){ if(a>b){ a=b; return true; } else{ return false; } } 

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

int main(){
    ll n,p;
    cin >> n >> p;
    string s;
    cin >> s;
    ll ans=0;
    reverse(s.begin(),s.end());
    if(p==2){
        for(ll i=0;i<n;i++){
            if((s[i]-'0')%2==0){
                ans += n-i;
            }
        }
    }else if(p==5){
        for(ll i=0;i<n;i++){
            if((s[i]-'0')%5==0){
                ans += n-i;
            }
        }
    }else{
        ll k = 1;
        vector<ll> a(n);
        for(ll i=0;i<n;i++){
            a[i] = (s[i]-'0')*k%p;
            k = k*10%p;
        }
        vector<ll> cum(n+1);
        cum[0] = 0;
        for(ll i=0;i<n;i++){
            cum[i+1] = (cum[i] + a[i])%p;
        }
        vector<ll> t(p);
        for(ll i=0;i<=n;i++){
            t[cum[i]]++;
        }
        for(ll i=0;i<p;i++){
            ans += (ll)t[i]*(t[i]-1)/2;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3716
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
a=list(map(int,input().split()))
a.sort()
print(sum(a[N::2]))

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

int main() {
  int A;
  int B;
  int C;
    cin>> A;
    cin>> B;
    cin>> C;
  
  if(A==B){
    if(B==C){
    cout<<"Yes"<<endl;
    }
  }
      else{
        cout<<"No"<<endl;
      }
  if(A==B){
    if(B!=C){
      cout<<"No"<<endl;
    }
  }
 
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String s = sc.next();
		String dream = "dream";
		String dreamer = "dreamer";
		String erase = "erase";
		String eraser = "eraser";
		s = s.replace(eraser, "");
		s = s.replace(erase, "");
		s = s.replace(dreamer, "");
		s = s.replace(dream, "");
		if (s.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 30172
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 3456;
int val[MAXN][MAXN];
LL dp[MAXN][MAXN][4];

int main() {
    int R, C, K;
    scanf("%d %d %d", &R, &C, &K);
    for (int i = 0; i < K; i++) {
        int r, c, v;
        scanf("%d %d %d", &r, &c, &v);
        val[r][c] = v;
    }
    for (int i = 1; i <= R; i++) {
        for (int j = 1; j <= C; j++) {
            for (int k = 0; k <= 3; k++) {
                if (k < 3)
                    dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k] + val[i][j]);
                //not take
                dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k]);
                //not take
                dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                if (k)// take
                    dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k - 1] + val[i][j]);
                //printf("i = %d j = %d k = %d dp = %lld\n", i, j, k, dp[i][j][k]);
            }
        }
    }
    LL ans = 0;
    for (int k = 0; k <= 3; k++) {
        if (k != 3)
            dp[R][C][k] += val[R][C];
        ans = max(ans, dp[R][C][k]);
    }
    printf("%lld\n", ans);

    return 0;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
by Benq;
*/


Measured memory_bytes: 332312
#include<iostream>
#include<string>
#include<iomanip>
#include<map>
#include<vector>
#include<math.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)
#define min(a,b) (a>b?b:a)
#define max(a,b) (a>b?a:b)
#define yn(f) (f?"Yes":"No")
#define YN(f) (f?"YES":"NO")
#define pro "はいプロ　世界一○○が上手　○○界のtourist　○○時代の終焉を告げる者　実質○○　○○するために生まれてきた男"
#define Answer_to_the_Ultimate_Question_of_Life_the_Universe_and_Everything 42


signed main(){
	cout<<fixed<<setprecision(7);
	map<int,int>mp;
	vector<int> ve;
	int n, a, count = 0;
	
	cin>>n;
	
	rep(i,n){
		cin>>a;
		if(mp[a] == 0)ve.push_back(a);
		mp[a]++;
	}
	for(int y : ve){
		if(mp[y] < y) count += mp[y];
		else count += mp[y]-y;
		// cout<<mp[y]<<" "<<y<<endl;
	}
	cout<<count<<endl;
	
	
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int m = t.size();
    vector <vector <int>> dp(n + 1, vector <int> (m + 1));
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
            if (s[i - 1] == t[j - 1]) dp[i][j] = max(dp[i][j], dp[i - 1][j - 1] + 1);
        }
    }
    string res = "";
    int ci = n, cj = m;
    while (ci > 0 && cj > 0) {
        if (s[ci - 1] == t[cj - 1] && dp[ci][cj] == dp[ci - 1][cj - 1] + 1) {
            res.push_back(s[ci - 1]);
            --ci, --cj;
        }
        else if (dp[ci][cj] == dp[ci - 1][cj]) {
            --ci;
        }
        else {
            --cj;
        }
    }
    reverse(res.begin(), res.end());
    cout << res << '\n';
}

Measured memory_bytes: 35584
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.14159265

int main()
{
    double area,vol,val,theta,result,a,b,c,x;
    
    scanf("%lf%lf%lf",&a,&b,&x); 
    val = 180.0 / PI;
    
    if(x>(a*a*b)/2)
    {
        vol= a*a*b;
        area = (vol-x)/a;
        c = (2*area)/a;
        theta = atan(c/a)* val;
        
        printf("%lf\n",theta);
    }
    else
    {
        area = x/a;
        c = (2*area)/b;
        theta = atan(c/b)* val;
        result = 90- theta;
        printf("%lf",result);

    }

    return 0;
}

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

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define loop3(i,j,k,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)
#define loop4(i,j,k,l,a) for(int i=0; i<a; i++)for(int j=0; j<a; j++)if(i!=j)for(int k=0; k<a; k++)if(i!=k&&j!=k)for(int l=0; l<a; l++)if(i!=l&&j!=l&&k!=l)
#define rep1(i,a) for(int i=1; i<=a; i++)

#define scnd1(a) scanf("%d", &a)
#define scnd2(a,b) scanf("%d%d", &a,&b)
#define scnd3(a,b,c) scanf("%d%d%d", &a,&b,&c)
#define scnd4(a,b,c,d) scanf("%d%d%d%d", &a,&b,&c,&d)

#define cin1(a) cin >> a;
#define cin2(a,b) cin >> a >> b;
#define cin3(a,b,c) cin >> a >> b >> c;
#define cin4(a,b,c,d) cin >> a >> b >> c >> d;
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define prtd1(a) printf("%d\n", a)
#define prtd2(a,b) printf("%d %d\n", a,b)
#define prtd3(a,b,c) printf("%d %d %d\n", a,b,c)
#define prtd4(a,b,c,d) printf("%d %d %d %d\n", a,b,c,d)

#define mem(a,n) memset( a, n, sizeof(a))
#define INF 1000000000
typedef long long ll;

int main() {
    int n;
    cin>>n;
    
    int x=111;
    while(n>x) x+=111;
    
    cout<<x<<endl;
}

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

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

        vector<pair<double, double>> v;
        for (int i=0; i<N; i++) {
                double a, b;
                cin >> a >> b;

                v.emplace_back(a, b);
        }

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

        double ans = 0;

        do {
                for (int i=1; i<N; i++) {
                        ans += hypot(v[i].first - v[i - 1].first, v[i].second - v[i - 1].second);
                }
        } while (next_permutation(v.begin(), v.end()));

        for (int i=2; i<=N; i++) ans /= i;

        cout << setprecision(10) << fixed << ans << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int f[10];
bool vis[15];
int main(){
	int n,k,a[15],len;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=k;i++){
		scanf("%d",&a[i]);
		vis[a[i]]=1;
	}
	f[0]=1;
	for(int i=1;i<=8;i++) f[i]=f[i-1]*10;
	for(int i=n;;i++){
		for(int j=1;;j++){
			if(i/f[j]==0){
				len=j;
				break;
			}
		}
		if(len==1){
			if(vis[i]!=1){
				printf("%d\n",i);
				break;
			}
		}
		else if(len==2){
			if(vis[i/10]!=1&&vis[i%10]!=1){
				printf("%d\n",i);
				break;
			}
		}
		else if(len==3){
			if(vis[i%10]!=1&&vis[i/10%10]!=1&&vis[i/100]!=1){
				printf("%d\n",i);
				break;
			}
		}
		else if(len==4){
			if(vis[i%10]!=1&&vis[i/10%10]!=1&&vis[i/100%10]!=1&&vis[i/1000]!=1){
				printf("%d\n",i);
				break;
			}
		}
		else if(len==5){
			if(vis[i%10]!=1&&vis[i/10%10]!=1&&vis[i/100%10]!=1&&vis[i/1000%10]!=1&&vis[i/10000]!=1){
				printf("%d\n",i);
				break;
			}
		}
	}
}

Measured memory_bytes: 256
using System;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int z, x;
            while (true)
            {
                string[] input = Console.ReadLine().Split(' ');
                z = int.Parse(input[0]);
                x = int.Parse(input[1]);
                if (z + x == 0)
                {
                    break;
                }
                else
                {
                    if (z < x)
                    {
                        Console.WriteLine(z + " " + x);
                    }
                    else
                    {
                        Console.WriteLine(x + " " + z);
                    }
                }
            }
        }
    }
}

Measured memory_bytes: 9260
#include <iostream>
#include <algorithm>
#include <map> 
#include <vector>
#include <set>
using namespace std;
int main(){
    int i,C;
    cin >>C;
set<int> st;
for(i=0;i<C;i++){
    int a;
    cin >> a;
    if(st.count(a)==1){
    st.erase(a);
    }else{
        st.insert(a);
    }
}
std::cout << st.size();
}

Measured memory_bytes: 4864
import java.util.*;
import java.io.*;

public class Main {
    static Scanner sc = new Scanner(System.in);
    
    //male=1, female=-1, vacant=0
    public static int ask(int seatNum){
    	System.out.println(seatNum);
    	String s = sc.next();
    	if(s.equals("Male")) return 1;
    	else if(s.equals("Female")) return -1;
    	else System.exit(0);//vacant
    	return -255;
    }
    
    //seat[vMin]==seat[vMax]==eS
    //assert vMin%2 != vMax%2
    public static void search(int edgeMin, int edgeMax, int edgeSex){
    	
    	//you have found the vacant seat
    	if(edgeMax-edgeMin<=4){
    		for(int i=edgeMin+1;i<edgeMax;i++) ask(i);
    	}
    	
    	int midSeat = (edgeMin+edgeMax)/2;
    	int midSex = ask(midSeat);
    	if((midSeat-edgeMin)%2==0 && edgeSex==midSex){
    		search(midSeat,edgeMax,edgeSex);
    	}else
    	if((midSeat-edgeMin)%2==0 && edgeSex!=midSex){
    		search(edgeMin,midSeat+1,edgeSex);
    	}else
    	if((midSeat-edgeMin)%2==1 && edgeSex==midSex){
    		search(edgeMin,midSeat,edgeSex);
    	}else
    	if((midSeat-edgeMin)%2==1 && edgeSex!=midSex){
    		search(midSeat-1,edgeMax,edgeSex);
    	}
    }
    
    public static void main(String[] args) {
        
        int N = sc.nextInt();
        int firstSeat = ask(0);
        search(0,N,firstSeat);
    }
}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl

int main() {
	int N, A, B;
	cin >> N >> A >> B;
	int maxi = min(A, B);
	int mini = max(0, A + B - N);
	cout << maxi << " " << mini << endl;
	return 0;
}

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

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

    sort(a,a+N,greater<int>());
    int Alice = 0;
    int Bob = 0;
    for (int i = 0; i < N; i++)
    {
        if(i % 2 == 0){
            Alice += a[i];
        }
        else{
            Bob += a[i];
        }
    }

    cout << Alice - Bob << endl;
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N(11);
char s[N][N];
int main() {
	int h, w;
	cin >> h >> w;
	int tot(0);
	for(int i(0); i < h; i++) {
		cin >> s[i];
		for(int j(0); j < w; j++) {
			tot += s[i][j] == '#';
		}
	}
	bool posi(false);
	for(int msk(0); msk < (1 << (h - 1 + w - 1)); msk++) {
		int cnt(0);
		int x(0), y(0);
		if(s[x][y] != '#') {
			continue;
		}
		cnt = 1;
		for(int i(0); i < h - 1 + w - 1; i++) {
			if(msk >> i & 1) {
				x += 1;
			}else {
				y += 1;
			}
			if(x >= h || y >= w || s[x][y] != '#') {
				cnt = -1;
				break;
			}
			cnt += 1;
		}
		if(cnt == tot) {
			posi = true;
			break;
		}
	}
	printf("%s\n", posi ? "Possible" : "Impossible");
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>

using namespace std;

int main(void)
{
	int n;
	vector<char> s;
	cin >> n;
	if (n % 2) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0; i < n; i++) {
		char c;
		cin >> c;
		s.push_back(c);
	}
	s.push_back('\0');
	int m = n / 2;
	bool flag = true;
	for (int i = 0; s[m + i] != '\0'; i++) {
		if (s[i] != s[m + i]) flag = false;
	}
	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
#include<numeric>
using namespace std;
using ll = long long;
int main(){
  string s;
  cin >> s;
  int n = s.length();
  vector<int> a(n);
  int d = 0, tmp = 0;
  
  for(int i = 0; i < n; i++) {
    if(s[i] == 'R' && d == 0){
      tmp++;
    }else if(s[i] == 'L' && d == 0){
      if(tmp % 2 == 0){
        a[i] += tmp / 2;
        a[i - 1] += tmp / 2;
      } else {
        a[i] += tmp / 2;
        a[i - 1] += tmp / 2 + 1;
      }

      tmp = 0;
      d = 1;
      i--;
    } else if(s[i] == 'L' && d == 1) {
      int j = i;
      tmp = 0;
      while(s[j] == 'L') {
        j++;
        tmp++;
      }
      if(tmp % 2 == 0){
        a[i] += tmp / 2;
        a[i - 1] += tmp / 2;
      } else {
        a[i] += tmp / 2 + 1;
        a[i - 1] += tmp / 2;
      }

      tmp = 0;
      d = 0;
      i = j - 1;
    }
  }

  for(int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include<vector>
#include<algorithm>
#define ll long long
#define INVALID -1
#define mod 1e9+7
#define rep(n) for(int i=0;i<n;++i)
using namespace std;
int main(void){
    // Your code here!

int n,m;
vector<pair<ll, ll>> vec;
cin>>n>>m;
for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    vec.push_back({a,b});
}

sort(vec.begin(),vec.end(),[](auto val1, auto val2){
    
    return val1.second < val2.second;
});

ll ans=0;
ll l=vec[0].first,r=vec[0].second;
for(int i=1;i<m;i++){
    l= max(vec[i].first, l);
    r= min(vec[i].second,r);
}
cout<<max(ans, (r-l+1));
}


Measured memory_bytes: 4936
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		String s = nextString();
		
		String ans ="consonant";
		if("a".equals(s)||"i".equals(s)||"u".equals(s)||"e".equals(s)||"o".equals(s))
			ans="vowel";
		System.out.println(ans);

	}

	public static boolean isPalindromicStr(String s) {
		int h = 0;
		int t = s.length() - 1;
		while (h <= t) {
			if (s.charAt(h) != s.charAt(t)) {
				break;
			}
			h++;
			t--;
		}
		if (h > t) {
			return true;
		}
		return false;
	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const ll INF = 1e9;
const ll MAX = 100005;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a, b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n, m, arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n, arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len = v.size();
    for(int i = 0; i < len; ++i) {
        s<<v[i];
        if(i < len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len = vv.size();
    for(int i = 0; i < len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

ll a, b, c, d;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    rep(i,n){
        cin>>a>>b>>c>>d;
        if(a<b){
            Yes(false);
            continue;
        }
        if(b > d) {
            Yes(false);
            continue;
        }
        ll m = __gcd(b, d);
        Yes(b-m+a%m<=c);
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int house[][][] = new int[4][3][10];
        for (int b = 0; b < 4; b++) {
        	for (int f = 0; f < 3; f++) {
        		for (int r = 0; r < 10; r++) {
        			house[b][f][r] = 0;
        		}
        	}
        }
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
        	int b = scanner.nextInt() - 1;
        	int f = scanner.nextInt() - 1;
        	int r = scanner.nextInt() - 1;
        	int v = scanner.nextInt();
			house[b][f][r] += v;
        }
        for (int b = 0; b < 4; b++) {
        	for (int f = 0; f < 3; f++) {
        		for (int r = 0; r < 10; r++) {
        			System.out.print(" "+house[b][f][r]);
        		}
                System.out.println();
        	}
        	if (b < 3) System.out.println("####################");
        }
    }
}



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

struct Edge {
  int to, weight;
  Edge(int t, int w) :to(t), weight(w) {}
};

struct Graph {
  vector<vector<Edge>> edges;

  Graph(int N) :edges(N) {}

  void addEdge(int a, int b) { addEdge(a, b, 1); }

  void addEdge(int a, int b, int w) {
    edges[a].emplace_back(b, w);
  }
};

using P = pair<long long, long long>;
const long long INF = 1e18 + 10;
const int MOD = 1e9 + 10;

int main() {
  int N, M, L; cin >> N >> M >> L;

  Graph G(N);
  rep(i, M) {
    int x, y, w; cin >> x >> y >> w;
    x--; y--;
    if (w > L) continue;
    G.addEdge(x, y, w);
    G.addEdge(y, x, w);
  }

  vector<vector<long long>> ans(N, vector<long long>(N, 0));

  rep(k, N) {
    vector<long long> d(N, INF);
    priority_queue <P, vector<P>, greater<P>> q;
    d[k] = 0;
    q.push(P(0, k));

    while (!q.empty()) {
      P p = q.top(); q.pop();
      int v = p.second;
      if (d[v] < p.first) continue;

      for (Edge x : G.edges[v]) {
        long long cost;
        if ((d[v] % MOD) + x.weight > L) cost = (d[v] / MOD + 1) * MOD + x.weight;
        else cost = d[v] + x.weight;
        if (d[x.to] > cost) {
          d[x.to] = cost;
          q.push(P(d[x.to], x.to));
        }
      }
    }
    rep(i, N) {
      ans[k][i] = d[i];
    }
  }

  int Q; cin >> Q;
  rep(i, Q) {
    int s, t; cin >> s >> t;
    s--; t--;
    if (ans[s][t] == INF) cout << -1 << endl;
    else cout << ans[s][t] / MOD << endl;
  }
}

Measured memory_bytes: 2432
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;
// vector<pair<pii,pii> > v;
void mainmain(){
	int a,b,c;
	int cnt=0;
	while(cin>>a>>b>>c,a||b||c){
		// v.PB(mkp(mkp(a,b),mkp(c,0)));
		int ans=0;
		reep(i,1,c){
			reep(j,1,c){
				int x=i*(100.0+a)/100;
				int y=j*(100.0+a)/100;
				if(x+y==c){
					int xx=i*(100.0+b)/100;
					int yy=j*(100.0+b)/100;

					ans=max(ans,xx+yy);
					// cout<<xx<<" "<<yy<<" "<<ans<<endl;
				}
			}
		}
		// v[cnt++].S.S=ans;
		cout<<ans<<endl;
	}
	// rep(i,v.size()){
		// int t;
		// cin>>t;
		// if(v[i].S.S!=t){
			// cout<<v[i].F.F<<" "<<v[i].F.S<<" "<<v[i].S.F<<" "<<v[i].S.S<<" "<<t<<endl;
		// }
	// }

}



}
main() try{
    mainmain();
}
catch(...){
}

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


typedef long long ll;

ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}


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


int main(){
    while(true){
        ll a,b;
        cin >> a >> b;
        
        if(cin.eof()){
            break;
        }

        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
}




Measured memory_bytes: 2988
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; ++i)
  {
    /* code */cin >> arr[i];
  }
  sort(arr, arr + n);
  int dp[k + 1];

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

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

  for (int i = 0; i <= k; ++i)
  {
      if(dp[i] == 1) continue;
      bool fg = 0;
      for (int j = 0; j < n; ++j)
      {
         if(i - arr[j] >= 0)
         if(dp[i - arr[j]] == 2) {fg = 1; break; }
      }

      if(fg) dp[i] = 1;
      else dp[i] = 2;
  }

  if(dp[k] == 1) cout << "First";
  else cout << "Second";

  //cout << dp[k];




  return 0;
}

Measured memory_bytes: 640
/////////////////////////////////TEST CASES////////////////////////////////////
/*
*/
/////////////////////////////////////CODE//////////////////////////////////////		
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = a ; i > b ; i--)
#define fastio ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define PI 3.14159265
typedef long long ll;
#define vl vector<ll> 
#define IN(inp) ll inp;cin>>inp;
#define pb push_back
#define all(a) a.begin(),a.end()
#define FR(i,a) for(auto i:a)
#define what(A) cout<<#A<<" is "<<A<<endl;
ll MAX = 100000000000;
ll MOD = 1000000007;
ll dp[100010][2];
void solve()
{
	IN(n)IN(W);
	vl w, v;
	FOR(i, 0, n)
	{
		IN(in1)IN(in2);
		w.push_back(in1);
		v.push_back(in2);
	}
	FOR(i, 0, n)
	{
		FOR(j,1,W+1)
		{
			dp[j][1] = max(dp[j][0], (j-w[i]>=0?dp[j - w[i]][0]+v[i]:0));
		}
		FOR(j, 1, W + 1)
			dp[j][0] = dp[j][1];
	}
	cout << dp[W][1];
}
int main()
{
	fastio
		//freopen("input.txt", "rt", stdin);
		//freopen("output.txt", "wt", stdout);
		ll test = 1;
	//cin >> test;
	while (test--)
	{
		solve();
	}
}

Measured memory_bytes: 5172