akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        new Main().solve();
    }

    private void solve() throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        StringTokenizer tokenizer = new StringTokenizer(f.readLine());
        int res = -1;
        for (int i = 1; i <= 5; i++) {
            int num = Integer.parseInt(tokenizer.nextToken());
            if (num == 0) {
                res = i;
            }
        }

        System.out.println(res);
    }
}


Measured memory_bytes: 32600
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define D()
#define INF 1000000000000
#define MOD 10000007
#define MAXR 100000
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INITA(a,i,j,v) for(ll k=i;k<=j;k++){a[k]=v;}

int main() {
    int h, w;
    cin >> h >> w;
    REP(i, h) {
        string s = "";
        REP(j, w) {
            char c;
            cin >> c;
            s = s + c;
        }
        cout << s << endl;
        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>

#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<string> s(n);
	rep(i, n) cin >> s[i];

	map<string, int> mp;
	rep(i, n) {
		mp[s[i]]++;
	}
	cout << mp.size() << endl;

	return 0;
}

Measured memory_bytes: 25004
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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 T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

ll MOD = 998244353;

const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll add(ll x, ll y)
{
    x += y;
    if (x >= MOD)
        return x - MOD;
    return x;
}
ll sub(ll x, ll y)
{
    x -= y;
    if (x < 0)
        return x + MOD;
    return x;
}
ll mult(ll x, ll y)
{
    return (x * y) % MOD;
}
ll bin_pow(ll x, ll p)
{
    if (p == 0)
        return 1;
    if (p & 1)
        return mult(x, bin_pow(x, p - 1));
    return bin_pow(mult(x, x), p / 2);
}

signed main()
{
    int n, m, k;
    cin >> n >> m >> k;
    COMinit();
    int cnt = 0;
    for (int i = 0; i <=k ; i++)
    {
        int x = COM(n - 1, i) * m;
        x %= MOD;
        cnt += x*bin_pow(m - 1, n - 1 - i);
        cnt %= MOD;
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 15584
#include <iostream>
#include <sstream>
#include <regex>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
#define itn ll
#define int ll
//const int INF = 100100100;
const int INF = (1LL << 32);
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;


static const int MAX = 100000;
int n;
vector<int> G[MAX];
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev) {
	prenum[current] = lowest[current] = timer;
	timer++;
	visited[current] = true;
	int next;
	rep(i, G[current].size()) {
		next = G[current][i];
		if (!visited[next]) {
			parent[next] = current;
			dfs(next, current);
			lowest[current] = min(lowest[current], lowest[next]);
		}elif(next != prev) {
			lowest[current] = min(lowest[current], prenum[next]);
		}
	}
}

void art_points() {
	rep(i, n) visited[i] = false;
	timer = 1;
	dfs(0, -1);
	set<int> ap;
	int np = 0;
	FOR(i,1, n) {
		int p = parent[i];
		if (p == 0) np++;
		elif(prenum[p] <= lowest[i]) ap.insert(p);
	}
	if (np > 1) ap.insert(0);
	//for (auto a : ap)
		//cout << a << '\n';
	for (set<int>::iterator it = ap.begin(); it != ap.end(); it++) {
		cout << *it << '\n';
	}
}

signed main() {
	ios::sync_with_stdio(false);
	int m;
	cin >> n >> m;
	rep(i, m) {
		int s, t;
		cin >> s >> t;
		G[s].pb(t);
		G[t].pb(s);
	}
	art_points();
	return 0;
}




Measured memory_bytes: 7512
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
	{
        int table[11][11]={0};
        if(n==0)
			break;
        for(int i=0,in;i<n;i++)
		{
            for(int j=0;j<n;j++)
			{
                cin>>in;
                table[i][j]=in;
                table[n][j]+=in;
                table[i][n]+=in;
            }
        }
        for(int i=0;i<n;i++)table[n][n]+=table[n][i];
        for(int i=0;i<n+1;i++)
		{
            for(int j=0;j<n+1;j++)printf("%5d",table[i][j]);
            cout<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1192
#include <cstdio>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define _ << " _ " <<
#define TRACE(x) cerr << #x << " = " << x << endl
#define debug(...) fprintf(stderr, __VA_ARGS__)
//#define debug
//#define TRACE(x)

using namespace std;

typedef long long llint;

const int MAXN = 105;

int n, a[MAXN], d, cnt[MAXN];
bool ok = true;

int main(void) {
  scanf("%d",&n);
  REP(i, n) {
    scanf("%d",&a[i]);
    d = max(d, a[i]);
    ++cnt[a[i]];
  }

  for (int x = d; x > d/2; --x)
    if (cnt[x] < 2)
      ok = false;

  if (d == 1 && n != 2) ok = false;

  if (d % 2 == 0) {
    if (cnt[d/2] != 1) ok = false;
    REP(x, d/2) if (cnt[x] >= 1) ok = false;
  } else {
    if (cnt[d/2 + 1] != 2) ok = false;
    REP(x, d/2 + 1) if (cnt[x] >= 1) ok = false;
  }

  printf(ok ? "Possible\n" : "Impossible\n");
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    vector<int> A(10);
    rep(i, S.size()){
        if(S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T'){
            if(i == 0){
                A[0]++; continue;
            }
            A[i] = A[i-1] + 1;
        }
    }
    sort(all(A));
    cout << A[9];
    cout << endl;
    return 0;
}




Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
bool flag[1000000];
int main(void)
{
	long long i,j,p,n,count;
	p = (long long)sqrt(1000000.0);
	for(i = 3; i <= p; i = i + 2)
	{
		if(flag[i] == false)
		{
			for(j = i * i; j <= 1000000; j = j + 2 * i)
			{
				flag[j] = true;
				
			}
		}
	}
		
	while((scanf("%lld",&n)) != EOF)
	{
		
		if(n == 1 || n == 0)
			count = 0;
		else
		{
			count = 1;
			for(i = 3; i <= n; i = i + 2)
			{
				if(flag[i] == false)
					count++;
			}
		}
		printf("%lld\n",count);
	}
	

		
	return 0;
}

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

void push(int);
int pop(void);
int isEmpty(void);
int isFull(void);

int top=0,S[1000];

int main(){
  int x,a,b;
  char s[1000];
  while(scanf("%s",s)!=EOF){
    if ( s[0] == '+' ){
      a=pop();
      b=pop();
      push(a+b);
    } else if ( s[0] == '-' ){
      a=pop();
      b=pop();
      push(b-a);
    } else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(a*b);
    } else {
      x = atoi(s);
      push(x);
    }
  }
  printf("%d\n",S[top]);
  return 0;
}

  



void push(int x){
  if(isFull()==1){
    top++;
    S[top]=x;
  }
 
}
int pop(){
  if(isEmpty()==1){
    top--;
    return S[top+1];
  }
 
  
}

int isEmpty(){
  if(top==0){
    return 0;
  }
  else{
    return 1;
  }

}
int isFull(){
  if(top>999){
    return 0;
  }
  else return 1;
}

Measured memory_bytes: 2760
#include <bits/stdc++.h>
using namespace std;
const int N = (int) 1e5;
int par[N];
int comps;

int find(int x) {
	return x == par[x] ? x : par[x] = find(par[x]);
}
void unite(int x, int y) {
	int fx = find(x);
	int fy = find(y);
	if (fx == fy) return;
	par[fx] = fy;
	--comps;
}
int main() {
	int n, m;
	cin >> n >> m;
	comps = n;
	for (int i = 0; i < n; ++i)
		par[i] = i;
	for (int i = 0; i < m; ++i) {
		int x, y, z;
		cin >> x >> y >> z, --x, --y;
		unite(x, y);
	}
	cout << comps << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#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 all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 100005;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
    COMinit();
    ll n,m;
    cin >> n >> m;
    if (abs(n-m) == 1){
        PRINT(fac[n]*fac[m]%MOD);
    }
    else if (n == m){
        PRINT(fac[n]*fac[m]*2%MOD);
    }
    else PRINT(0);
}

Measured memory_bytes: 2560
#include<cctype>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cmath>
#include<cassert>
#include<algorithm>
#include<numeric>
#include<vector>
#include<string>
#include<map>
#include<unordered_map>
#include<queue>
#include<tuple>
using namespace std;
typedef long long int lnt;
typedef unsigned long long int unt;
typedef unsigned ust;
typedef double dou;
typedef pair<int,int> P;
#define FZ(i,n)       for(int i=0;i<(n);++i)
#define FB(i,n)       for(int i=(n)-1;i>=0;--i)
#define FV(i,st,ed)   for(int i=st;i<(ed);++i)
#define FC(i,n)       for(int i=n;i;--i)
#define FZU(i,n)      for(ust i=0;i!=(n);++i)
#define FVU(i,st,ed)  for(ust i=st;i<(ed);++i)
#define FCU(i,n)      for(ust i=n;i;--i)
#define SZ(x)         ((int)x.size())
#define ALL(x)        std::begin(x),std::end(x)
#define likely(x)     __builtin_expect(!!(x), 1)
#define unlikely(x)   __builtin_expect(!!(x), 0)

#define RI(x) scanf("%d",&(x))
#define RII(x,y) scanf("%d %d",&(x),&(y))
#define RS(x) scanf("%s",x)
#define RI64(x) scanf("%I64d",&(x))
#define RII64(x,y) scanf("%I64d%I64d",&(x),&(y))

#define FIR first
#define SEC second
#define pritnf printf
constexpr ust N = 512;
char mp[N][N];
int mch[N][N];
int dp[N][N]; 
int go(char*a,char*b,int n){
    FZ(i,n)FZ(j,n){
        mch[i][j] = (i&&j?mch[i-1][j-1]:0)+(a[i]==b[j]);
    }
    FZ(i,n)FZ(j,n){
        dp[i][j] = (i?dp[i-1][j]:0)+mch[i][j];
        dp[i][j] = min(dp[i][j],(j?dp[i][j-1]:0)+mch[i][j]);
    }
    return dp[n-1][n-1];
}
bool sol(){
    int n,m;
    if(RII(n,m)==EOF)return 0;
    FZ(i,n)RS(mp[i]);
    {
        int nn = max(n,m);
        FZ(i,nn)FZ(j,nn)if(i<j){
            swap(mp[i][j],mp[j][i]);
        }
        swap(n,m);
        /*
        FZ(i,n){
            reverse(mp[i],mp[i]+m);
            mp[i][m] = 0;
            puts(mp[i]);
        }
        */
    }
    int ans = 0;
    FV(i,1,n){
        int tmp = go(mp[i-1],mp[i],m);
        //printf("%d %d\n",i,tmp);
        ans+= tmp;
    }
    printf("%d\n",ans);
    return 1;
}
int main(){
    while(sol());
    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
//#include <atcoder/all>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007; //998244353;

template<class _T> static void get(_T& a) {
	std::cin >> a;
}
template<class _T> static void get(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void get(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}
template <class _T> static _T tp_abs(_T a) {
	if (a < (_T)0) {
		a *= (_T)-1;
	}
	return a;
}

static void A_task();

int main()
{
	A_task();
	fflush(stdout);
	return 0;
}

static void A_task()
{
	int K;
	get(K);

	for (int i = 0; i < K; i++) {
		printf("ACL");
	}
	putchar('\n');
} 


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

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Console.ReadLine();
            if (read.IndexOf("a") != -1 && read.IndexOf("b") != -1 && read.IndexOf("c") != -1)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");

            }
        }
    }
}


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

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 100010;

int n;
int a[N];

int main()
{
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) scanf("%d", a + i);

    int mina = 0x3f3f3f3f;
    for(int i = n; i; i--)
    {
        if(mina + 1 < a[i])
        {
            puts("No");
            return 0;
        }
        mina = min(mina, a[i]);
    }
    puts("Yes");
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int n;
vector<int> v;
vector<pair<int,int> > ans;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int a;
		cin>>a;
		v.push_back(a);
	}
	sort(v.begin(),v.end());
	int MIN=v[0],MAX=v[v.size()-1];
	for(int i=1;i<v.size()-1;i++)
	{
		if(v[i]<=0)
		{
			ans.push_back(make_pair(MAX,v[i]));
			MAX-=v[i];
		}
		else
		{
			ans.push_back(make_pair(MIN,v[i]));
			MIN-=v[i];
		}
	}
	ans.push_back(make_pair(MAX,MIN));
	MAX-=MIN;
	cout<<MAX<<endl;
	for(int i=0;i<ans.size();i++)
		cout<<ans[i].first<<" "<<ans[i].second<<endl;
	return 0;
} 

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

struct product{
  string name;
  int P, A, B, C, D, E, F, S, M;
  double income;
  double time;
  double rate;
  product(string n, int Pi,int Ai,int Bi,int Ci,int Di,int Ei,int Fi,int Si,int Mi){
    name = n;
    P = Pi; A = Ai; B = Bi; C = Ci; D = Di; E = Ei; F = Fi; S = Si; M = Mi;
    income = F*S*M - P;
    time = A+B+C + (D+E)*M;
    rate = income / time;
  }
  
  bool operator < (const product & tgt) const {
    if(rate == tgt.rate)
      return name > tgt.name;
    return rate < tgt.rate;
  }

};

int main(){
  
  while(1){
    int n; cin >> n;
    if(!n) break;

    vector<product> list;
    for(int i=0; i<n; i++){
      string name;
      int P, A, B, C, D, E, F, S, M;
      cin >> name >>P >> A >> B >> C >> D >> E >> F >> S >> M;
      list.push_back(product(name, P, A, B, C, D, E, F, S, M));
    }
    sort(list.begin(),list.end());
    reverse(list.begin(),list.end());
    for(auto ele : list)
      cout << ele.name << endl;
    cout << "#" << endl;

  }
  
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

bool cana[3007], canb[3007];

bool can(int w, int s, int e) {
    return 100 * s <= w * e;
}
ld val(pair<int, int> a) {
    if (a.first + a.second == 0) return -1;
    return 100.0 * a.second / (a.first + a.second);
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    for (int i = 0; i <= 3000; i++) {
        for (int j = 0; j <= 3000; j++) {
            if (100 * a * i + 100 * b * j <= f) {
                cana[100 * a * i + 100 * b * j] = true;
            }
        }
    }
    for (int i = 0; i <= 3000; i++) {
        for (int j = 0; j <= 3000; j++) {
            if (c * i + d * j <= f) {
                canb[c * i + d * j] = true;
            }
        }
    }
    pair<int, int> res = make_pair(0, 0);
    for (int i = 0; i <= 3000; i++) {
        for (int j = 0; j <= 3000; j++) {
            if (cana[i] && canb[j] && i + j <= f && can(i, j, e) && val({i, j}) >= val(res)) res = {i, j};
        }
    }
    cout << res.first + res.second << " " << res.second << endl;
}



Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

void Main()
{
	int N;
  	vector<string> s(N);
  	vector<int> t(N);
  	string X;
  	cin >> N;
	rep(i,N) cin >> s[i] >> t[i];
  	cin >> X;
  	int j;
  	rep(i,N) {
    	if(s[i] == X) {
          	j = i;
      		break;
        }
    }
  	ll ans = 0;
  	rep3(i,j+1,N-1) {
    	ans += t[i];
    }
  	cout << ans << endl;
	return;
}

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

Measured memory_bytes: 640
def actual(N, S):
    number_of_hina_arare_types = len(set(S))

    color_map = {3: 'Three',
                 4: 'Four'}

    return color_map[number_of_hina_arare_types]

N = int(input())
S = input().split()

print(actual(N, S))

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

using namespace std;

const int MOD = 1e9 + 7;

int main()
{
  int n;
  cin >> n;
  long long ans = 1;
  for (int i = 0; i < n; i++)
    ans = ans * (i + 1) % MOD;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
const int MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {fac[0] = fac[1] = 1;finv[0] = finv[1] = 1;inv[1] = 1;for (int i = 2; i < MAX; i++){fac[i] = fac[i - 1] * i % MOD;inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;finv[i] = finv[i - 1] * inv[i] % MOD;}}
long long COM(int n, int k){if (n < k) return 0;if (n < 0 || k < 0) return 0;return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}

int main() {
  COMinit();
  int x,y;
  cin>>x>>y;
  if((x+y)%3){
    cout<<0<<endl;
    return 0;
  }
  int n=(x+y)/3;
  x-=n; y-=n;
  if(x<0||y<0){
    cout<<0<<endl;
    return 0;
  }
  cout<<COM(x+y,y)<<endl;
}

Measured memory_bytes: 27036
#include<iostream>

using namespace std;

int main() {
	int n, q;
	bool table[2001] = { false };
	cin >> n;
	int* a = new int[n];
	for (int i = 0;i < n;i++) {
		cin >> a[i];
	}
	int sum;
	for (int i = 1;i < 1 << n;i++) {
		sum = 0;
		for (int j = 0;j < n;j++) {
			if (i & 1 << j) {
				sum += a[j];
			}
		}
		if (sum <= 2000)table[sum] = true;
	}
	cin >> q;
	int work;
	for (int j = 0;j < q;j++) {
		cin >> work;
		if (table[work])cout << "yes\n";
		else cout << "no\n";
	}

}



Measured memory_bytes: 3096
import java.util.Scanner;


public class Main {
	public static void main(String[] args){
		Scanner sn = new Scanner(System.in);
		int an = sn.nextInt();
		for(int i = 0; i < an; i++){
			int bn = sn.nextInt();
			int blocks[] = new int[bn];
			for(int j = 0; j < bn; j++) blocks[j] = sn.nextInt();
			int up = 0, down = 0;
			for(int j = 0; j < blocks.length-1; j++){
				int diff = blocks[j] - blocks[j+1];
				up = Math.min(up, diff);
				down = Math.max(down, diff);
			}
			System.out.println(-up+" "+down);
		}
	}
}

Measured memory_bytes: 27712
e1,e2,e3,e4=map(int,input().split())
if e1==e3 and e2==e4:
    print('yes')
elif e1==e2 and e3==e4:
    print('yes')
elif e4==e1 and e2==e3:
    print('yes')
elif e1==e2==e3==e4:
    print('yes')
else:
    print('no')


Measured memory_bytes: 5596
#include <iostream>
#include<string>
using namespace std;
int main()
{
	string N;
	cin >> N;
	int Harshad=0;
	int num_N = stoi(N);

	for (unsigned i = 0; i < N.size(); i++)
	{
		int num = N[i] - '0';
		Harshad += num;
	}
	if (num_N%Harshad==0)
	{
	cout << "Yes" << endl;
	}
	else
	{
	cout << "No" << endl;
	}
}

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


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


int main() {
    ll ans=0;
    ll n; cin >> n;
    rep(i,n) ans+=i;
    cout << ans;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<map>
#include<set>
#include<vector>
#include<cstring>
#include<cassert>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<limits>
#include<ctime>
#include<stack>
#include<bits/stdc++.h>
#include<string>
#include<stdlib.h>
#include<stdio.h>
#define long long

using namespace std;

int main() {
	int n,m,c,ans=0;
	cin>>n>>m>>c;
	int b[m];
	for(int i=0;i<m;i++){
		cin>>b[i];
	}
	for(int i=0;i<n;i++){
		int a[m],sum=0;
		for(int j=0;j<m;j++){
			cin>>a[j];
			sum+=(a[j]*b[j]);
		}
		sum+=c;
		if(sum>0){
			ans++;
		}
	}
	cout<<ans;
}



Measured memory_bytes: 3604
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int n,d;
int m[101];
int all[101];
int c[101][10001];
int mis;
int main(void){
	while(1){
		scanf("%d %d",&n,&d);
		if(n+d==0)break;
		mis=0;
		for(int i=0;i<n;i++){
			scanf("%d",&m[i]);
			all[i]=0;
			mis+=m[i];
			for(int j=0;j<m[i];j++){
				scanf("%d",&c[i][j]);
				all[i]+=c[i][j];
			}
		}
		bool flag=true;
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				if(abs(all[i]-all[j])>d)flag=false;
			}
		}
		if(!flag){
			printf("No\n");
			continue;
		}
		int i;
		for(i=0;i<mis;i++){
			bool flag=false;
			for(int j=0;j<n;j++){
				int k;
				for(k=0;k<n;k++){
					if(k==j)continue;
					if(abs(all[k]-(all[j]-c[j][m[j]-1]))>d)break;
				}
				if(k==n){
					all[j]-=c[j][m[j]-1];
					m[j]--;
					flag=true;
					break;
				}
			}
			if(!flag)break;
		}
		printf("%s\n",i==mis?"Yes":"No");

	}
	return 0;
}

Measured memory_bytes: 1496
#include <iostream>
#include <algorithm>
#include <cmath>
#define ll long long
#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define RREP(x, n) for(int x = n; x > 0; --x)

using namespace std;
// input
string s;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> s;
    
    for(int i = s.size(); i > 0; i-=2){
        s.pop_back();
        s.pop_back();
        if (s.substr(0,i/2-1) == s.substr(i/2-1,i)){
            cout << s.size() << "\n";
            break;
        }
    }
}

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

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

    vector<long> h(n);
    for (long i=0; i<n; i++) {
        cin >> h.at(i);
    }

    long cnt=0;
    long maxcnt=0;
    for (long i=1; i<n; i++) {
        if (h.at(i)<=h.at(i-1)) {
            cnt++;
            maxcnt=max(maxcnt, cnt);
        } else {
            cnt=0;
        }
    }

    cout << maxcnt << endl;
    return 0;
}


Measured memory_bytes: 3976
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<utility>

using namespace std;

int main()
{
    char S[5];
    cin >> S;
    if(S[1]=='B'){
        cout << "ARC" << endl;
    }else{
        cout << "ABC" << endl;
    }

    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string Yes="Yes";
string YES="YES";
string NO="NO";
string No="No";
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define res resize
#define as assign
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
 
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
const double pi=3.1415926535897932384626;
int main(){
    int n,m;
    std::cin >> m>>n;
    std::cout << n*(n-1)/2+m*(m-1)/2 << std::endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ifor(i,n) for(i=0;i<n;i++)
#define ll long long
int main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     int i,n,t=INT_MAX,p=INT_MAX,j=0,x,a=0,b,l=0,r=0,c,y,m,q;
     string s;
     cin>>a>>b>>m;
     int ara[a];
     int arr[b];
     for(i=0;i<a;i++){
        cin>>ara[i];
     }
     for(i=0;i<b;i++){
        cin>>arr[i];
     }
     for(j=0;j<m;j++){
        cin>>x>>y>>c;

        l=ara[x-1]+arr[y-1]-c;
        p=min(p,l);

     }
     sort(ara,ara+a);
     sort(arr,arr+b);
     t=arr[0]+ara[0];
     cout<<min(p,t)<<endl;

     return EXIT_SUCCESS;
}




Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
using namespace std;

int main(void){
  int N,M;
  cin>>N>>M;
  vector<pair<int,int> > div(M);
  for(int i=0;i<M;++i){
    cin>>div[i].first>>div[i].second;
  }
  int cnt=0;
  int rgt=1;
  while(1){
  	//cerr<<rgt<<endl;
    ++cnt;
    int mx=rgt;
    for(int i=0;i<M;++i){
      if(div[i].first<=rgt && div[i].second>=mx) mx=div[i].second+1;
    }
    if(rgt==mx){cnt=-1;break;}
    if(mx==N+1){break;}
    rgt=mx;
  }
  if(cnt<0) cout<<"Impossible"<<endl;
  else cout<<cnt<<endl;
  
  return 0;
}

Measured memory_bytes: 1200
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)*}
    };
}

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

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, i321) => {
        read_value!($next, i32) - 1
    };

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

//
// # Examples
//
// # integers
// input! { n: i32, m: i32, ... }
//
// # array
// input! { n: i32, v: [i32; n], }
//
// # matrix
// input! { n: i32, m: i32, mat: [[]] }
//
// # string
// input! { s: chars }
//
// 3 4
// ####
// #..#
// .#.#
//
// input!{
//     h: i32,
//     w: i32,
//     board: [chars; h],
// }

// https://practice.contest.atcoder.jp/tasks/practice_1
//fn main() {
//    input!{
//        a: i32, b: i32, c: i32,
//        foo: chars,
//    }
//    let s: String = foo.into_iter().collect();
//    println!("{} {}", a+b+c, s);
//}
fn main() {
    input! { s: chars }
    let mut s = s.clone();
    s[3] = '8';
    let s: String = s.into_iter().collect();
    println!("{}",s);
}

Measured memory_bytes: 4352
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

from itertools import permutations

N = int(input())
P = tuple( map(int, input().split()))
Q = tuple( map(int, input().split()))

X = sorted(permutations(range(1, N+1)))
a = X.index(P)+1
b = X.index(Q)+1
print(abs(a-b))

Measured memory_bytes: 8052
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <queue>


using namespace std;

int facctorialMethod(int k);

int main() {
    vector <int> array, x, y;
    int N, tx, ty;
    double sum = 0, avg = 0;

    cin >> N;

    for (int i = 0; i < N; i++) {
        array.push_back(i);
        cin >> tx;
        x.push_back(tx);
        cin >> ty;
        y.push_back(ty);
    }


    do {
        for (int i = 1; i < N; i++) {
            sum += sqrt(pow(x[array[i]] - x[array[i - 1]], 2) + pow(y[array[i]] - y[array[i - 1]], 2));
        }

    } while (next_permutation(array.begin(), array.end()));

    avg = sum / facctorialMethod(N);

    cout << setprecision(15) << avg;

    return 0;
}

int facctorialMethod(int k) {
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

Measured memory_bytes: 256
/*
USER: caoash3
LANG: JAVA
TASK: 
*/

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

public class Main {

	static final boolean stdin = true;
	static final String filename = "";
	static FastScanner br;
	static PrintWriter pw;

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

		if (stdin) {
			br = new FastScanner();
			pw = new PrintWriter(new OutputStreamWriter(System.out));
		}

		else {
			br = new FastScanner(filename + ".in");
			pw = new PrintWriter(new FileWriter(filename + ".out"));
		}

		X solver = new X();
		solver.solve(br, pw);
	}

	static class X {
		static int N, MOD = (int) 1e9+7; 
		static long[][] dp;
		static LinkedList<Integer>[] edges;
		
		public void solve(FastScanner br, PrintWriter pw) throws IOException {
			N = br.nextInt();
			dp = new long[N][2];
			edges = new LinkedList[N];
			
			for(int i = 0; i < edges.length; i++) {
				edges[i] = new LinkedList<Integer>();
			}
			
			
			for(int i = 0; i < N-1; i++) {
				int x = br.nextInt();
				int y = br.nextInt();
				
				x--;
				y--;
				
				edges[x].add(y);
				edges[y].add(x);
				
			}
			
			for(int i = 0; i < N; i++) {
				
					dp[i][0] = 1;
					dp[i][1] = 1;
				
			}
			
			
			
			dfs(0,-1);
					
			pw.println((dp[0][0] + dp[0][1])%MOD);
			pw.close();
		}
		
		public static void dfs(int v, int pV) {
			long sum1 = dp[v][0]; //color black
			long sum2 = dp[v][1]; //color white
			
			for(int e : edges[v]) {
				if(e == pV) {
					continue;
				}
				dfs(e, v);
				
				sum1 = (sum1 * (dp[e][1]))%MOD;
				sum2 = (sum2 * (dp[e][0] + dp[e][1]))%MOD;
				
			}
			
			dp[v][0] = sum1;
			dp[v][1] = sum2;
			
		}

	}

	//fastscanner class
	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

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

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}

}
 



Measured memory_bytes: 86680
import sys

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

N, K = inp_list()
A = inp_list()
A = list(map(lambda x: x - 1, A)) # 0-indexed



pos = 0 # 現在の位置を表す index
# memo = [[False, 0] for _ in range(N)] # memo[i]: [bool, tel_cnt] , [数えたか、何回移動したか]
# memo[0] = [True, 0]
visited = [False for _ in range(N)]
teleport_count = {}
distance = 0
l_pos = 0
tel_cnt = 0
while True:
    nxt = A[pos]
    # if memo[nxt][0]: # 数えた
    if visited[nxt]:
        # r_pos, l_pos = memo[pos][1], memo[nxt][1]
        r_pos, l_pos = teleport_count[pos], teleport_count[nxt]
        distance = r_pos - l_pos
        break
    tel_cnt += 1
    # memo[nxt][1] = tel_cnt
    teleport_count[nxt] = tel_cnt
    # memo[nxt][0] = True
    visited[nxt] = True
    # index 更新
    pos = nxt

def get_key_from_value(val, d):
    for k, v in d.items():
        if v == val:
            return k
# def find_idx_by_telcnt(tel_cnt):
#     for i in range(N):
#         m = memo[i]
#         if m[1] == tel_cnt:
#             return i

if K <= l_pos:
    # print(find_idx_by_telcnt(K) + 1)
    print(get_key_from_value(K, teleport_count) + 1)
else:
    diff = K - l_pos
    rem = diff % (distance + 1)
    ans_pos = l_pos + rem
    # print(find_idx_by_telcnt(ans_pos) + 1)
    print(get_key_from_value(ans_pos, teleport_count) + 1)


Measured memory_bytes: 41616
var
  a,b,i,k:longint;
  n:string;
  p:boolean;
begin
  readln(a,b);
  readln(n);
  k:=pos('-',n);
  p:=true;
  for i:=1 to k-1 do if not(n[i] in ['0'..'9']) then p:=false;
  for i:=k+1 to a+b+1 do if not(n[i] in ['0'..'9']) then p:=false;
  if p and (k=a+1) then writeln('Yes') else writeln('No');
end.

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
template <class T> T input() {T t; cin>>t; return t;}
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (ll i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (ll i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (ll i = x.size()-1; i >= 0; i--)
#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define CHMAX(a,b) a = max(a,b)
#define CHMIN(a,b) a = min(a,b)
#define debug(x) cerr<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define e1 first
#define e2 second
#define newline putchar('\n')
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
const int INF = 1e7;
const ll MOD = 1e9 + 7;
const double pi = 3.141592653589793;
const VI dx = {1, 0, -1, 0};
const VI dy = {0, 1, 0, -1};

int main()
{
    int l;
    cin>>l;
    double ans = pow(l/3.0,3);
    cout<<fixed<<setprecision(15)<<ans<<endl;

    return 0;
}


Measured memory_bytes: 4040
using Yorukatsu052.Questions;
using Yorukatsu052.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Yorukatsu052.Questions
{
    /// <summary>
    /// https://atcoder.jp/contests/abc060/tasks/abc060_b
    /// </summary>
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var abc = inputStream.ReadIntArray();
            var a = abc[0];
            var b = abc[1];
            var c = abc[2];

            var mod = a % b;
            for (int i = 0; i <= b; i++)
            {
                if (mod * i % b == c)
                {
                    yield return "YES";
                    yield break;
                }
            }

            yield return "NO";
        }
    }
}


namespace Yorukatsu052
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace Yorukatsu052.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace Yorukatsu052.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,m,n;
    double s=0;

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

s=s/(4*m);
sort(ar,ar+n);
if(ar[n-m]>=s){
    cout<<"Yes";

}
else{
    cout<<"No";
}
return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n, m, q;
string s[2010];
int p[200010][4];

int sv[2010][2010];
int se[2010][2010];
int ce[2010][2010];
int re[2010][2010];

int sum_V(int k) {
    return sv[p[k][2]][p[k][3]] - sv[p[k][2]][p[k][1]-1] - sv[p[k][0]-1][p[k][3]] + sv[p[k][0]-1][p[k][1]-1];
}

int num_E0(int k) {
    return (re[p[k][2]+1][p[k][3]] - re[p[k][2]+1][p[k][1]-1]) + (ce[p[k][2]][p[k][3]+1] - ce[p[k][0]-1][p[k][3]+1]);
}

int num_E1(int k) {
    return (re[p[k][0]][p[k][3]] - re[p[k][0]][p[k][1]-1]) + (ce[p[k][2]][p[k][1]] - ce[p[k][0]-1][p[k][1]]);
}

int sum_E(int k) {
    return (se[p[k][2]][p[k][3]] - se[p[k][2]][p[k][1]-1] - se[p[k][0]-1][p[k][3]] + se[p[k][0]-1][p[k][1]-1] - num_E0(k) - num_E1(k)) / 2;
}

void solve() {
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (s[i][j] == '1') {
                if (i > 0 && s[i-1][j] == '1') se[i+1][j+1]++;
                if (j > 0 && s[i][j-1] == '1') se[i+1][j+1]++;
                if (i < n-1 && s[i+1][j] == '1') se[i+1][j+1]++;
                if (j < m-1 && s[i][j+1] == '1') se[i+1][j+1]++;
            }
        }
    }

    for (int i = 1; i < n; i++) {
        for (int j = 0; j < m; j++) {
            re[i+1][j+1] = re[i+1][j] + (s[i][j] == '1' && s[i-1][j] == '1');
        }
    }
    for (int i = 1; i < m; i++) {
        for (int j = 0; j < n; j++) {
            ce[j+1][i+1] = ce[j][i+1] + (s[j][i] == '1' && s[j][i-1] == '1');
        }
    }
    
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            sv[i][j] = sv[i-1][j] + sv[i][j-1] - sv[i-1][j-1] + (int)(s[i-1][j-1] == '1');
            se[i][j] += se[i-1][j] + se[i][j-1] - se[i-1][j-1];
        }
    }

    for (int i = 0; i < q; i++) {
        cout << sum_V(i) - sum_E(i)  << endl;
    }
}

void input() {
    cin >> n >> m >> q;
    for (int i = 0; i < n; i++) cin >> s[i];
    for (int i = 0; i < q; i++)
        for (int j = 0; j < 4; j++)
            cin >> p[i][j];
}

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

    input();
    solve();
}


Measured memory_bytes: 72320
function main(input) {
    var arr = input.split(' ');
    var cat = parseInt(arr[0]);
    var mixed = parseInt(arr[1]);
    var catNum = parseInt(arr[2]);
    var fulfillsCond = cat <= catNum && cat + mixed >= catNum;
    console.log(fulfillsCond ? 'YES' : 'NO');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
package main

import (
	"fmt"
)

func solve(n, x int) (ans int){
	var second, third int
	ans = 0
	for first:=1; first<=x/3+1; first++{
		second = first + 1
		for {
			third = x - (first + second)
			if second >= third {
				break
			} else if third <= n{
				ans++
			}
			second++
		}
	}
	return
}

func main(){
	var n, x int
	for {
		fmt.Scan(&n, &x)
		if n == 0 && x == 0{
			break
		}
		fmt.Println(solve(n, x))
	}
}


Measured memory_bytes: 1148