akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cassert>
#include <deque>
#include <fstream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#include <bitset>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define POW(n) ((n)*(n))
#define ALL(a) (a).begin(),(a).end()
#define dump(v) (cerr << #v << ": " << v << endl)
#define cerr if(true) cerr

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<unsigned long long> vull;
typedef pair<int,int> pp;

// ll n = to_T<ll>("114514")
template <class T> T to_T(const string& s) { istringstream is(s); T res; is >> res; return res; }
template <class T> string to_s(const T& a) { ostringstream os; os << a; return os.str(); }

// int cost[2010][2010];
std::vector<int> E[100010];
// std::vector<int> ans,O;
// bool is[2010] = {};
int dp[11][100010];

// void BFS(int pos,int d, int c){
// 	vi q;
// 	q.push_back(pos);
// 	is[pos] = true;
// 	ans[pos] = c;
//
// 	REP(dd,d){
// 		vi ne;
// 		for(int from:q){
// 			for(int to:E[from]) if(!is[to]){
// 				ne.push_back(to);
// 				is[to] = true;
// 				ans[to] = c;
// 			}
// 		}
// 		q = ne;
// 		ne.clear();
// 	}
// }

void solve(long long N, long long M, vector<long long> a, vector<long long> b, long long Q, vector<long long> v, vector<long long> d, vector<long long> c){
	// ans.resize(N,-1);
	// O.resize(N,0);
	// memset(dp,-1,sizeof(dp));
	REP(i,11) REP(j,N) dp[i][j] = -1;

	REP(i,M){
		E[a[i]].push_back(b[i]);
		E[b[i]].push_back(a[i]);
	}

	REP(i,Q){
		dp[d[i]][v[i]] = max(dp[d[i]][v[i]],i);
	}

	for(int i=10;i>0;i--) REP(j,N) {
		dp[i - 1][j] = max(dp[i - 1][j],dp[i][j]);
		for(int to:E[j]) {
			dp[i - 1][to] = max(dp[i-1][to],dp[i][j]);
		}
	}

	REP(i,N)
		cout << (dp[0][i] < 0?0:c[dp[0][i]]) << endl;
}



int main(){
	ios::sync_with_stdio(false);
	long long N;
	long long M;
	long long Q;
	cin >> N;
	cin >> M;
	vector<long long> a(M-1+1);
	vector<long long> b(M-1+1);
	for(int i = 0 ; i <= M-1 ; i++){
		cin >> a[i];a[i]--;
		cin >> b[i];b[i]--;
	}
	cin >> Q;
	vector<long long> v(Q-1+1);
	vector<long long> d(Q-1+1);
	vector<long long> c(Q-1+1);
	for(int i = 0 ; i <= Q-1 ; i++){
		cin >> v[i];v[i]--;
		cin >> d[i];
		cin >> c[i];
	}
	solve(N, M, a, b, Q, v, d, c);
	return 0;
}


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

using namespace std;
const int maxn = 57;

char G[maxn][maxn];
int dx[8] = {0 , 0 , 1 , 1 , 1 , -1, -1 , -1 };
int dy[8] = {1 , - 1 , 0 , 1 , -1 , 0 , 1 , -1 };
int check(int x, int y)
{
    if(G[x][y] == '#') return 1;
    else return 0;
}

int main()
{
    int H,W;
    cin>>H>>W;
    for(int i = 1 ; i <= H ; i++){
        cin>>G[i];
    }
    for(int i = 1 ; i <= H ; i++){
        for(int j = 0 ; j <W ; j++){
            if(G[i][j] == '#') continue;
            int t = 0;
            for(int k = 0 ; k < 8 ; k++){
                t += check(i+dx[k] , j + dy[k]);
            }
            G[i][j] = '0' + t;
        }
    }
    for(int i = 1 ; i <=H ;i++){
        cout<<G[i]<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    H,W = LMIIS()
    MOD = H*W
    S = [input() for _ in range(H)]

    from collections import deque
    def tansaku(S,V,length,q):
        if len(q) == 0:
            return length-1
        q2 = []
        for y,x in q:
            if  x >= 1 and S[y][x-1] == '.' and V[y][x-1]:
                V[y][x-1] = False
                q2.append((y,x-1))

            if x < W-1 and S[y][x+1] == '.' and V[y][x+1]:
                V[y][x+1] = False
                q2.append((y,x+1))

            if y >= 1 and S[y-1][x] == '.' and V[y-1][x]:
                V[y-1][x] = False
                q2.append((y-1,x))

            if y < H-1 and S[y+1][x] == '.' and V[y+1][x]:
                V[y+1][x] = False
                q2.append((y+1,x))

        return tansaku(S,V,length+1,q2)
    
    def getmax():
        max_length = 0
        for h in range(H):
            for w in range(W):
                V = [[True] * W for _ in range(H)]
                if S[h][w] == '.':
                    V[h][w] = False
                    max_length = max(tansaku(S,V,0,[(h,w)]),max_length)
        return max_length
    
    print(getmax())
   
    






if __name__ == '__main__':
    main()

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

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }

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

    int x; cin >> x;
    if(x < 1200) cout << "ABC" << endl;
    else cout << "ARC" << endl;
}


Measured memory_bytes: 3588
/*

Author : AllKilled
Date   : 202001197 19:50:00 UTC+8

Website: https://atcoder.jp/contests/abc152
Contest: AtCoder Beginner Contest 152
Problem: Task F.
Result :

*/
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef pair<LL, LL> PLL;

const int inf = 0x3f3f3f3f;
const LL MOD = 1e9+7;
const LL M = 20;
const LL MAXN = 50 + 3;
const LL MAXM = (1 << M) + 3;

///--------------------------------------------///

int n, m, c[MAXN];
vector<pair<int, int> > e[MAXN];
LL dp[2][MAXM];

int dfs(int u, int fa, int aim, int id) {
    if (u == aim) {
        return 1;
    }
    for (auto &x : e[u]) {
        if (x.first == fa) continue;
        int res = dfs(x.first, u, aim, id);
        if (res) {
            c[x.second] |= 1ll << id;
            return 1;
        }
    }
    return 0;
}

int main()
{
    cin >> n;
    for (int a, b, i = 1; i < n; ++i) {
        cin >> a >> b;
        e[a].push_back({b, i});
        e[b].push_back({a, i});
    }
    cin >> m;
    for (int u, v, i = 0; i < m; ++i) {
        cin >> u >> v;
        dfs(u, -1, v, i);
    }
    int now = 0, pre, cnt = 0;
    memset(dp[now], 0, sizeof(dp[now]));
    dp[now][0] = 1;
    for (int i = 1; i < n; ++i) {
        now ^= 1; pre = now ^ 1;
        for (int j = 0; j < 1<<m; ++j) {
            dp[now][j] = dp[pre][j];
        }
        if (c[i] == 0) {
            ++cnt;
            continue;
        }
        for (int j = 0; j < 1<<m; ++j) {
            dp[now][j | c[i]] += dp[pre][j];
        }
    }
    LL ans = dp[now][(1 << m) - 1] * (1 << cnt);
    //cout << dp[now][(1 << m) - 1] << " " << cnt << " " << (1 << cnt) << endl;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 16640
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <random>
#include <chrono>
using namespace std;

const int maxn = 1e5 + 5;

int n;
int a[maxn];
int b[maxn], m;

typedef long long LL;
int c[maxn];
int pre[maxn];
int d[maxn * 2];

void add(int p, int c){
    for(int i = p;i < maxn * 2;i += i & -i){
        d[i] += c;
    }
}

int sum(int p){
    int ret = 0;
    for(int i = p;i > 0;i -= i & -i){
        ret += d[i];
    }
    return ret;
}
LL cal(int val){
    //memset(d, 0, sizeof(d));
    c[0] = 0;
    for(int i = 1;i <= n;i++){
        if(a[i] >= val)
            c[i] = 1;
        else
            c[i] = -1;
    }
    pre[0] = 0;
    add(pre[0] + maxn, 1);
    for(int i = 1;i <= n;i++){
        pre[i] = pre[i - 1] + c[i];
        add(pre[i] + maxn, 1);
    }
    long long ans = 0;
    for(int i = 0;i <= n;i++){
        add(pre[i] + maxn, -1); 
        ans += sum(maxn * 2 - 1) - sum(pre[i] + maxn - 1);
    } 
    return ans;
}

int main(){
    cin >> n;
    for(int i = 1;i <= n;i++){
        scanf("%d", &a[i]);
        b[i] = a[i];
    }
    sort(b + 1, b + 1 + n);
    m = unique(b + 1, b + 1 + n) - b - 1;
    int l = 1, r = m;
    while(l < r){
        int mid = (l + r + 1) / 2;
        if(cal(b[mid]) >= 1LL * n * (n + 1) / 4){
            l = mid;
        }else{
            r = mid - 1;
        }
    }
    cout << b[l] << endl;
    return 0;
}


Measured memory_bytes: 2176
#include<stdio.h>
#include<string.h>
int main(){
    char n[200000+1];
    scanf("%s",n);
    int sum=0;
    for(int i=0;i<strlen(n);i++){
        sum=sum+n[i]-'0';
    }
    if(sum%9==0){
        printf("Yes\n");
        return 0;
    }else{
        printf("No\n");
        return 0;
    }
}

Measured memory_bytes: 1796
#include "bits/stdc++.h"
#define int long long

using namespace std;

const int MOD = 1000000007;
int modpow(int a, int p){
    if(p == 0){
        return 1;
    }
    int t = modpow(a, p / 2);
    if(p % 2 == 0){
        return t * t % MOD;
    }
    return t * t % MOD * a % MOD;
}
int modinv(int a) { return modpow(a, MOD - 2); }

struct UnionFind {
    vector<int> data;
    UnionFind(int size) : data(size, -1) {}
    bool unionSet(int x, int y) {
        x = root(x);
        y = root(y);
        if(x != y) {
            if(data[y] < data[x])
                swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    bool findSet(int x, int y) { return root(x) == root(y); }
    int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
    int size(int x) { return -data[root(x)]; }
};

signed main() {
    double L;
    cin >> L;
    cout << setprecision(12) << L * L * L / 27 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	VI B,P(N),Q(N);
	REP(i, N)cin >> P[i];
	REP(i, N)cin >> Q[i];
	REP(i, N)B.push_back(i + 1);
	int a, b;
	int cnt = 0;
	do {
		cnt++;
		bool A = true, C = true;

		REP(i, N) {
			if (B[i] != Q[i])C = false;
			if (B[i] != P[i])A = false;
		}
		if (A)a = cnt;
		if (C)b = cnt;

	} while (std::next_permutation(B.begin(), B.end()));


	cout << abs(a - b) << 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 ll long long int

int main(){
  int n,T;
  cin>>n>>T;
  int c[n],t[n];
  pair<int,int> a[n];
  rep(i,n){
    cin>>c[i]>>t[i];
    a[i]=make_pair(c[i],t[i]);
  }
  sort(a,a+n);
  rep(i,n){
    if(a[i].second<=T){
      cout<<a[i].first<<endl;
      return 0;
    }

  }
  cout<<"TLE"<<endl;
  return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input!{
        n: usize,
        x: usize,
        m: usize,
    }
    
    let mut to = vec![100001; m];
    let l = {
        let mut a = x;
        while to[a] == 100001 {
            let b = a * a % m;
            to[a] = b;
            a = b;
        }
        a
    };
    
    let mut ans = 0;
    let mut a = x;
    if n <= 300000 {
        for _ in 0..n {
            ans += a;
            a = a * a % m;
        }
    }
    else {
        let mut n = n;
        while a != l {
            ans += a;
            a = a * a % m;
            n -= 1;
        }
        // a = a * a % m;
        // n -= 1;
        let mut cycle = 0;
        let mut sum = 0;
        loop {
            sum += a;
            a = a * a % m;
            cycle += 1;
            if a == l {
                break;
            }
        }
        let loops = n/cycle;
        ans += sum * loops;
        n -= loops * cycle;
        for _ in 0..n {
            ans += a;
            a = a * a % m;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2764
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pair<ll,ll>>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
template<typename T>
void max_self(T &a,T b){
    a=max(a,b);
}
template<typename T>
void min_self(T &a,T b){
    a=min(a,b);
}
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=5e5+10,oo=0x3f3f3f3f,MOD=1e9+7;
const double PI = acos(-1);
vi v;
void sieve() {
    vector<bool> isPrime(mxN + 1, true);
    isPrime[0] = isPrime[1] = 0;
    for (ll i = 2; i <= mxN; ++i) {
        if (isPrime[i]) {
            v.pb(i);
            for (int j = i * 2; j <= mxN; j += i)
                isPrime[j] = 0;
        }
    }
}
void solve(){
    //14
    int n;
    cin>>n;
    string s;
    cin>>s;
    int x=0,res=0;
    loop(n,i,0){
        x+=(s[i]=='I');
        x-=(s[i]=='D');
        res=max(res,x);
    }
    cout<<res<<Endl;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3656
//#pragma GCC target ("avx2")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")

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

#define int long long

using namespace std;
using namespace __gnu_pbds;

template <class T> using ordered_set =
tree<T, null_type, less<T>,
rb_tree_tag, tree_order_statistics_node_update>;

const int N = (int)(1e6 + 5);
const int M = (int)(1e9 + 7);
const int INF = (int)(1e18 + 9);
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};

int a[N];

signed main() {
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  cout << a[n / 2 + 1] - a[n / 2];
  return 0;
}


Measured memory_bytes: 1024
/*
* @Author: Kabid
* @Date:   2020-04-19 17:59:10
*/

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define in(x)  scanf("%d", &x);
#define ins(x)  scanf("%s", &x);
#define out(x) printf("%d", x);
#define lin puts("");
#define _ putchar(' ');
int r;
int main(){
	double pi=acos(-1);
	scanf("%d",&r);
	printf("%lf",2*pi*(double)r);

	
    return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for(int i = 0; i < N; i++){
    cin >> d.at(i);
  }
  sort(ALL(d));
  int l = d.at(N/2 - 1);
  int r = d.at(N/2);
  cout << r - l << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
using namespace std;
unsigned long long ans,bns=0;
char a,b,c,d,e,f;
int main()
{
	cin>>a>>b;
	if(a=='A'&&b=='A')cout<<"="<<endl;
    if(a=='A'&&b=='B')cout<<"<"<<endl;
    if(a=='A'&&b=='C')cout<<"<"<<endl;
    if(a=='A'&&b=='D')cout<<"<"<<endl;
    if(a=='A'&&b=='E')cout<<"<"<<endl;
    if(a=='A'&&b=='F')cout<<"<"<<endl;
    if(a=='B'&&b=='A')cout<<">"<<endl;
    if(a=='B'&&b=='B')cout<<"="<<endl;
    if(a=='B'&&b=='C')cout<<"<"<<endl;
    if(a=='B'&&b=='D')cout<<"<"<<endl;
    if(a=='B'&&b=='E')cout<<"<"<<endl;
    if(a=='B'&&b=='F')cout<<"<"<<endl;
    if(a=='C'&&b=='A')cout<<">"<<endl;
    if(a=='C'&&b=='B')cout<<">"<<endl;
    if(a=='C'&&b=='C')cout<<"="<<endl;
    if(a=='C'&&b=='D')cout<<"<"<<endl;
    if(a=='C'&&b=='E')cout<<"<"<<endl;
    if(a=='C'&&b=='F')cout<<"<"<<endl;
    if(a=='D'&&b=='A')cout<<">"<<endl;
    if(a=='D'&&b=='B')cout<<">"<<endl;
    if(a=='D'&&b=='C')cout<<">"<<endl;
    if(a=='D'&&b=='D')cout<<"="<<endl;
    if(a=='D'&&b=='E')cout<<"<"<<endl;
    if(a=='D'&&b=='F')cout<<"<"<<endl;
    if(a=='E'&&b=='A')cout<<">"<<endl;
    if(a=='E'&&b=='B')cout<<">"<<endl;
    if(a=='E'&&b=='C')cout<<">"<<endl;
    if(a=='E'&&b=='D')cout<<">"<<endl;
    if(a=='E'&&b=='E')cout<<"="<<endl;
    if(a=='E'&&b=='F')cout<<"<"<<endl;
    if(a=='F'&&b=='A')cout<<">"<<endl;
    if(a=='F'&&b=='B')cout<<">"<<endl;
    if(a=='F'&&b=='C')cout<<">"<<endl;
    if(a=='F'&&b=='D')cout<<">"<<endl;
    if(a=='F'&&b=='E')cout<<">"<<endl;
    if(a=='F'&&b=='F')cout<<"="<<endl;
	return 0;
}

Measured memory_bytes: 256
while True:
    n, x = [int(i) for i in input().split()]

    if n == x == 0:
        break

    count = 0
    for s in range(1, n - 1):
        for m in range(s + 1, n):
            for e in range(m + 1, n + 1):
                if x == sum([s, m, e]):
                    count += 1

    print(count)

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

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

  map<string, int> mp;
  for (int i = 0; i < s.size(); i++) {
    int maxlen = min(k, (ll)(s.size() - i));
    for (int j = 1; j <= maxlen; j++) {
      mp[s.substr(i, j)]++;
    }
  }

  int cnt = 1;
  for (auto x : mp) {
    if (cnt == k) {
      cout << x.first << endl;
      return 0;
    }
    cnt++;
  }
  return 0;
}


Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n;
	cin>>n;
	ll ch[52];
	ll cnt=0;
	for(ll i=0;i<n;i++){
		ll now;
		cin>>now;
		now--;
		if(now!=i){
			cnt++;
		}
	}
	if(cnt<=2){
		cout << "YES";
	}
	else{
		cout << "NO";
	}
	// your code goes here
	return 0;
}

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

int n, m, ans, T[101], P[101], X[101];
int main() {
	cin >> n;
	rep(i, n) {
		cin >> T[i];
		ans += T[i];
	}
	cin >> m;
	rep(i, m) {
		cin >> P[i] >> X[i];
		cout << ans - T[P[i] - 1] + X[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while(true){
			String input = br.readLine();

			if(input == null){
				break;
			}

			String[] tmpArray = input.split(" ");

			int n = Integer.parseInt(tmpArray[0]);
			int q = Integer.parseInt(tmpArray[1]);

			if(n == 0 && q == 0){
				break;
			}

			Node[] nodes = new Node[n + 1];
			nodes[0] = new Node(0, -1);
			nodes[0].marked = true;

			nodes[1] = new Node(1, 0);
			nodes[1].marked = true;

			for(int i = 2; i <= n; i++){
				int num = Integer.parseInt(br.readLine());

				nodes[i] = new Node(i, num);
			}

			long sum = 0;

			for(int i = 0; i < q; i++){
				tmpArray = br.readLine().split(" ");
				int tmp = Integer.parseInt(tmpArray[1]);
				if(tmpArray[0].equals("M")){
					nodes[tmp].marked = true;
				}

				else {
					sum += nearest(nodes, tmp);
				}
			}

			System.out.println(sum);
		}
	}

	static int nearest(Node[] nodes, int id){
		while(true){

//			System.out.println("id = "+id);

			if(nodes[id].marked){
				return id;
			}

			id = nodes[id].parent;
		}
	}

}

class Node {
	int id;
	int parent;
	boolean marked = false;

	public Node(int id, int parent){
		this.id = id;
		this.parent = parent;
	}
}


Measured memory_bytes: 100884
#include <iostream>
using namespace std;
int main(void){
    int x, y;
    for(int i=1; i<=3000; i++){
        cin >> x >> y;
        if(x==0 && y==0) break;
        if(x>y){
            cout << y << " " << x << endl;
        }
        else{
            cout << x << " " << y << endl;
        }
    }
    
}



Measured memory_bytes: 3080
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let s: String = input();
    let s: Vec<char> = s.chars().collect();
    let mut count = 0;
    for i in 0..(s.len() / 2) {
        if s[i] != s[s.len() - i - 1] {
            count += 1;
        }
    }
    println!("{}", count);
}


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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()      //昇順
#define RALL(obj) (obj).rbegin(), (obj).rend()   //降順
#define print(obj) cout << obj << endl
#define scan(obj) cin >> obj

typedef long long ll;

using namespace std;

int main(void){
    string s;
    cin >> s;
    ll n = s.length(), left = 0, right = 0, sum = 1;
    vector<ll> ans(n);
    rep(i, n){
        ans[i] = 0;
    }
    char temp = 'R';
    for(int i = 1; i < n; i++){
        if(temp == 'R' && temp == s[i]){
            sum++;
        } else if(temp == 'R' && temp != s[i]){
            left = i - 1;
            right = i;
            ans[i - 1] += (sum / 2) + sum % 2;
            ans[i] += sum / 2;
            temp = 'L';
            sum = 1;
        } else if(temp == 'L' && temp == s[i]){
            sum++;
        } else if(temp == 'L' && temp != s[i]){
            ans[left] += sum / 2;
            ans[right] += (sum / 2) + sum % 2;
            temp = 'R';
            sum = 1;
        }
        if(i == n - 1){
            ans[left] += sum / 2;
            ans[right] += (sum / 2) + sum % 2;
        }
    }
    for(int i = 0; i < n; i++){
        cout << ans[i];
        if(i != n - 1) cout << ' ';
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	int four = 0, two = 0;
	rep(i, n){
		if(a[i]%4 == 0) four++;
		else if(a[i]%2 == 0) two++;
	}
	string ans = "No";
	if(n-1 <= four * 2 + two / 2) ans = "Yes";
	if(n-four*2 <= two) ans = "Yes";
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#define N 200

int main(void)
{
	int a[N];
	int n;

	scanf("%d", &n);

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

	for (int i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			if ((a[i] % 3 == 0) || (a[i] % 5 == 0))
			{

			}
			else
			{
				printf("DENIED");
				return 0;
			}
		}
	}
	printf("APPROVED");

	return 0;
}

Measured memory_bytes: 128
solve :: Int -> Int -> Int -> Int -> Int
solve a b c x = length . filter (== x) $ [ tot i j k | i <- [0..a], j <- [0..b], k <- [0..c]]
    where tot i j k = 500 * i + 100 * j + 50 * k

main = do
    a <- readLn :: IO Int
    b <- readLn :: IO Int
    c <- readLn :: IO Int
    x <- readLn :: IO Int
    print $ solve a b c x 

Measured memory_bytes: 508
import java.util.Scanner;

	public class Main {

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			int k = sc.nextInt();
			long ret=0;
			
			for(int i=1;i<=k;i++) {
				for(int j=1;j<=k;j++) {
					for(int m=1;m<=k;m++) {
						ret+=gcd(gcd(i,j),m);
					}
				}
			}
			
			System.out.println(ret);
			
		}
		
		
		static int gcd (int a, int b) {
			int temp;
			while((temp = a%b)!=0) {
				a = b;
				b = temp;
			}
			return b;
		}
	}

Measured memory_bytes: 35816
def main():
    N,K = map(int,input().split())
    XY = [list(map(int,input().split())) for _ in [0]*N]
    
    iX = sorted(x for x,y in XY)
    iY = sorted(y for x,y in XY)
    X = {x:i for i,x in enumerate(iX)}
    Y = {y:i for i,y in enumerate(iY)}

    c = [[0]*(N+1) for i in [0]*(N+1)]
    for x,y in XY:
        c[Y[y]+1][X[x]+1] = 1

    for i in range(N):
        ci1 = c[i+1]
        for j in range(N):
            ci1[j+1] += ci1[j]
    for i in range(N):
        ci1 = c[i+1]
        ci = c[i]
        for j in range(N):
            ci1[j+1] += ci[j+1]

    ans = 10**20
    for u in range(N):
        for d in range(u+K-1,N):
            l = 0
            r = 0
            dY = iY[d]-iY[u]
            cd = c[d+1]
            cu = c[u]
            while r<N:
                if cd[r+1]+cu[l]-cu[r+1]-cd[l] >=K:
                    ans = min(ans, (iX[r] - iX[l])*dY)
                    l+=1
                else:r+=1

    print(ans)
main()

Measured memory_bytes: 3064
#include<iostream>
#include<cmath>

using namespace std;

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

	int tb = b, s = 0;
	for(int i = 0; i < 3; ++i) { tb /= 10; s++; if(tb == 0) break; }

	int sum = a * pow(10, s) + b;

	if((int)sqrt(sum)*(int)sqrt(sum) == sum) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main (){
	var a,b,k int
	fmt.Scan(&a, &b, &k)
	as := enumDivisions(a)
	bs := enumDivisions(b)
	cnt := 0
	for i := len(as)-1; i  > 0; i-- {
		for j := len(bs)-1; j > 0;j-- {
			if bs[j] == as[i] {
				cnt++
			}
			if cnt == k {
				fmt.Println(bs[j])
				return
			}

		}
	}
	fmt.Println(1)
}

// 約数列挙
func enumDivisions(n int) []int {
	var res []int
	for i := 1; i * i <= n; i++ {
		if n % i == 0 {
			res = append(res, i)

			// 重複しないならばiの相方である n/i もappend
			if n/i != i {
				res = append(res, n/i)
			}
		}
	}
	// 小さい順に並び替える
	sort.Ints(res)
	return res
}



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


public class Test
{	
    public static void Main()
	{
	    int[] n = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        Console.WriteLine((n[0]-1)*(n[1]-1));

	} 
}

Measured memory_bytes: 11220
import java.util.*
import kotlin.math.acos
import kotlin.math.cos
import kotlin.math.round
import kotlin.math.sin

fun main(args: Array<String>) {
    val n = readLong()
    val m = requireNotNull(List(5) { readLong() }.min())

    println((n + m - 1) / m + 4)
}

// read
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()

Measured memory_bytes: 35228
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
#include<map>
using namespace std;


int main() {
    int a, b;
    cin >> a >> b;
    if(a%b == 0){
        cout << 0;
    }
    else{
        cout << 1;
    }
    cout << endl;
}


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

using namespace std;

int main() {
  int n;
  multiset<int> mySet;
  for(int i=1; i<501; i++) {
    int val = i;
    for(int j=i+1; j<501 && val<1001; j++) {
      val += j;
      mySet.insert(val);
    }
  }
  while(cin>>n && n) {
    cout<<mySet.count(n)<<endl;
  }
}

Measured memory_bytes: 1344
n,x,y=gets.split.map &:to_i
C=[0]*n
(1..n).each{|i|
(i+1..n).each{|j|
d=[j-i,(x-i).abs+1+(y-j).abs].min
C[d]+=1
}
}
(1...n).each{|k|p C[k]}

Measured memory_bytes: 2172
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using D = double;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

LL a, b;

int main() {
	cin >> a >> b;
	cout << (abs(a - b) <= 1 ? "Brown" : "Alice") << endl;
}

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

int main() {
    int n; cin >> n;
    long long a[100010];
    long long b[100010];
    for (int i = 0; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = n; i >= 0; i--) {
        if (i == n) {
            b[n] = a[n];
        } else {
            b[i] = b[i+1] + a[i];
        }
    }
    if (n == 0) {
        if (a[0] == 1) {
            cout << 1 << endl;
        } else {
            cout << -1 << endl;
        }
        return 0;
    }
    if (a[0] >= 1) {
        cout << -1 << endl;
        return 0;
    }
    long long res = 1;
    long long now = 1;
    for (int i = 1; i <= n; i++) {
        now *= 2;
        // cout << "now: " << now << endl;
        // cout << "bi: " << b[i] << endl;
        long long add = min(now, b[i]);
        res += add;
        now = add - a[i];
        if (now < 0) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 5188
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	ll n,w;
	cin >> n >> w;
	ll value[n],wt[n];ll sum=0;
	for(int i=0;i<n;i++){cin >> wt[i] >> value[i];sum+=value[i];}
    vector<ll>prev(sum+1,INT_MAX),cur(sum+1,INT_MAX);
    prev[0]=0;
    
    for(int i=0;i<n;i++){
    for(ll j=0;j<=sum;j++){
    if(j<value[i])cur[j]=prev[j];
    else
    cur[j]=min(wt[i]+prev[j-value[i]],prev[j]);
    //if(cur[j]<=w)cout << cur[j] << "," << j << " ";
    }
    //cout << endl;
    swap(cur,prev);
    }
    ll ans=0;
    for(ll i=0;i<=sum;i++){
    	
    if(prev[i]<=w){ans=max(ans,i);}
    }
    //cout << endl;
    cout << ans;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'
 
int main() {
  ios::sync_with_stdio(0); cin.tie(0);
 
  ll a,b,k;
  cin >> a >> b >> k;
  ll a_eat = min(a,k);
  a -= a_eat;
  k -= a_eat;
  ll b_eat = min(b,k);
  b -= b_eat;
  k -= a_eat;
  cout << a << " " << b << endl;

}


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

#define int long long int
#define loop(i,s,e) for(int i=s; i<e; i++)
#define endl '\n'
#define vii vector<int>
#define pii pair<int, int>
#define ff first
#define ss second
#define N 100001
#define pb push_back
#define INF LLONG_MAX
#define inf INT_MAX
#define M (int)(1e9+7)

void INP();

#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define rtn                                       if(0)return;
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{     rtn 
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}
int arr[101];
int n, k;	

int dp[101][100001];

int util(int index, int candies_left){
	if(index == n and candies_left == 0) return 1;
	if(index == n) return 0;

	if(dp[index][candies_left] != -1) return dp[index][candies_left];

	int ans = 0;
	ans += util(index+1, candies_left), ans%=M;
	if(candies_left-1>=0) ans += util(index, candies_left-1), ans%=M;
	if(candies_left-1 >= arr[index]) ans -= util(index+1, candies_left-1-arr[index]), ans%=M;
	if(ans<0) ans+=M;

	return dp[index][candies_left] = (ans%M);
}

void alpha()
{	
	memset(dp, -1, sizeof(dp));

	cin>>n>>k;

	loop(i,0,n) cin>>arr[i];

	cout<<util(0, k)%M<<endl;
}

int32_t main(){

	ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	//INP();
    int t=1;
	//cin>>t;

  	while(t--) alpha();

	return 0;

}






















inline void INP()
{
      #ifndef ONLINE_JUDGE
          freopen("input.txt",  "r",  stdin);
          freopen("output.txt", "w", stdout);
      #endif
}
 
 

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






//A
int main(){
    char test[3];
    for(int i = 0;i < 3;i++){
        cin >> test[i];
    }
    if(test[0] == test[1] && test[1] == test[2]){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
}






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

using namespace std;
#define int long long int
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define vi vector <int>
#define sz(s) (int)s.size()
#define pii pair<int,int>
#define piii pair< int,pair<int,int> >
#define tiii tuple <int,int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define rall(v) v.rbegin(),v.rend()
#define endl '\n'
#define matrix vector <vector <int> >
#define boost ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define NAYAN freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define N 100006
#define mod 1000000007
#define mod2 998244353
#define inf 1e18

vector <int> g[N];
int ind[N];
int dist[N];
int vis[N];

void dfs(int u)
{
    vis[u]=1;
    for(int v:g[u])
    {
        ind[v]--;
        dist[v]=max(dist[v],dist[u]+1);
        if(ind[v]==0)
            dfs(v);
    }
}


int32_t main()  
{
    boost
    // #ifndef ONLINE_JUDGE 
    // NAYAN
    // #endif

    int n,m;
    cin >> n >> m;
    int i;
    int u,v;
    for(i=1;i<=m;i++)
    {
        cin >> u >> v;
        g[u].pb(v);
        ind[v]++;
    }

    for(i=1;i<=n;i++)
    {
        if(ind[i]==0 && vis[i]==0)
        {
            dfs(i);
        }
    }

    int ans=0;

    for(i=1;i<=n;i++)
    {
        ans=max(ans,dist[i]);
    }

    cout << ans;




}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
 
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define si set<int>
#define stk stack<int>
#define que queue<int>
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std; 

int main(){
	string s,t,u;
	cin>>s>>t;
	int a,b;
	cin>>a>>b;
	cin>>u;
	if(u==s)
		a--;
	if(u==t)
		b--;
	cout<<a<<" "<<b<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int N, X, min, ans;
    int m[100000];

    cin >> N >> X;

    ans = N;
    min = 1000000;
    for (int i = 0; i < N; i++)
    {
        cin >> m[i];
        X -= m[i];
        if (min > m[i])
            min = m[i];
    }

    ans += X / min;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)

int main()
{
    int n, c, k;
    cin >> n >> c >> k;
    int t[n];
    repi(i, n, 0)
    {
        cin >> t[i];
    }
    sort(t, t + n);
    int ans = 1, cnt = 0, limit = t[0] + k;
    repi(i, n, 0)
    {
        cnt++;
        if (cnt > c || t[i] > limit)
        {
            cnt = 1;
            limit = t[i] + k;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

        /*Author*/
        /*plab0n*/
#define MAX 12345678;
#define max(x,y) ((x) >= (y) ? (x) : (y))
#define min(x,y) ((x) < (y) ? (x) : (y))
#define scI(a) scanf("%d",&a);
#define scLL(a) scanf("%lld",&a);
#define scI2(a,b) scanf("%d%d",&a,&b);
#define scLL2(a,b) scanf("%lld%lld",&a,&b);

#define dekhao(a) printf("%lld\n",a);
#define dekhao2(a,b) printf("%d %d\n",a,b);
#define loop(i,n) for(i=1; i<=n; i++)

int main()
{
    long long n,m,cnt=0;

    scLL2(n,m);

    if(n<=(m/2))
    {
        cnt+=n;
        m-=(2*n);
        cnt+=(m/4);
        dekhao(cnt);
    }
    else
    {
        dekhao(m/2);
    }
}



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <climits>
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define in insert
#define vll vector<ll>
#define endl "\n"
#define pll pair<ll,ll>
#define f first
#define s second
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define int ll
#define sz(x) (ll)x.size()
#define all(x) (x.begin(),x.end())
using namespace std;

 
const ll INF = 1e12;
const ll N =(1e5+5); // TODO : change value as per problem
const ll MOD = 1e9+7;


void solve(){
    int d,t,s;
    cin >> d >> t >> s;
    // t = d/s
    // d = s*t
    if(d <= (s*t)) cout << "Yes\n";
    else cout << "No\n";   
}
signed main(){
 
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
     // freopen(".in","r",stdin);freopen(".out","w",stdout);
    
     ll tt=1;   
     // cin >> tt;
    while(tt--){    
        solve();
    }    
}

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

int main(){
    int n;
    string w[110];
    bool can = true;

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

    for(int i = 0; i < n; ++i){
        if(i < n-1){
            if(w[i].back() != w[i+1].front()){
                can = false;
                break;
            }
        }
        for(int j = 0; j < i; ++j){
            if(w[i] == w[j]){
                can = false;
                break;
            }
        }
    }
    
    if(can == true){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
#include<cassert>
#include<functional>
#include<unordered_map>
#include<deque>
#include<cmath>





using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;
typedef pair<double, double> pdd;

#define show(x) cerr << x
#define debug(x) show(#x << ": " << (x) << endl)

const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const ll INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();
const ll mod = 998244353;




void solve() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    vector<vector<ll> > dp(c + 1, vector<ll> (d + 1, 0));
    dp[a][b] = 1;
    for (int i = a; i <= c; ++i) {
        for (int j = b; j <= d; ++j) {
            dp[i][j] = (dp[i][j] + dp[i - 1][j] * j) % mod;
            dp[i][j] = (dp[i][j] + dp[i][j - 1] * i) % mod;
            dp[i][j] = (dp[i][j] - dp[i - 1][j - 1] * (i - 1) * (j - 1)) % mod;
            dp[i][j] = (dp[i][j] + mod) % mod;
        }
    }
    cout << dp[c][d] << endl;



}


//#define LOCAL

int main() {
    ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    solve();



#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif	
    return 0;
}


Measured memory_bytes: 73456
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
// memo  fixed  setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1000000007;
/*"itob" int to "N"base */           template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ret;static numeric_limits<TypeInt> t;TypeInt n = v;if (t.is_signed) {if (v < 0) n *= -1;}while (n >= base) {ret += table[n%base];n /= base;}ret += table[n];if (t.is_signed) {if (v < 0 && base == 10) ret += '-';}reverse(ret.begin(), ret.end());return ret;}
/*"chmin" a = MAX*/                  template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/*"chmax" a = MIN*/                  template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*"ctoi"  char to int*/              int ctoi(char c) {return c-'0';}
/*"gcd"   MAX*/                      int gcd(ll a,ll b){return b?gcd(b,a%b):a;}
/*"lcm"   MIN*/                      int lcm(ll a,ll b){return a*b/gcd(a,b);}
/*"primecheck"If prime,return true.*/bool primecheck(ll n){if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}

int main(){
    int n,k;
    cin >> n >> k;
    vector<double>a(n);
    for(int i=0;i<n;i++){
        int z;
        cin >>z;
        a.at(i)=(z+1)/2.0;
    }
    vector<double>che(n+1,0);
    for(int i=1;i<=n;i++){
        che.at(i)=che.at(i-1)+a.at(i-1);
    }
    double ans = 0;
    for(int i=0;i<n;i++){
        if(i+k>n)continue;
        ans = max(ans,che.at(i+k)-che.at(i));
    }
    cout <<fixed<<setprecision(10);
    cout << ans <<endl;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
using namespace std;

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  fspcnt = 0;
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}*/


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<int> res(n);
  int m = 0;
  invrep(i,n){
    int k = 0;
    int cnt = 0;
    for(int j=i;j < n;j = j + (i + 1)){
      if(res[j] == 1){
        cnt++;
      }
    }
    res[i] = (a[i] + cnt) % 2;
    m += res[i];
  }
  cout << m << endl;
  rep(i,n){
    if(res[i] == 1){
      cout << i+1 << " ";
    }
  }
      
      
    
  
  
  

  
}

Measured memory_bytes: 2432