akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args) {
#if DEBUG
        //MyDebugger.MakeTestCase("../TextFile2.txt"); return;
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }
    
    static object process(TextReader input) {
        char s = input.ReadLine()[0];
        return ((char)(s + 1)).ToString();

    }
}


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

using namespace std;

int main(){
	long long n;
	cin>>n;
	vector<char> a;
	int i=1;
	while(n>0){
		
		if(n%26==0)
			a.push_back('z');
		else
			a.push_back(char(int('a')-(i)+n%26));
		n=(n-1)/26ll;
		
	}
	for(int i=a.size()-1;i>=0;i--){
		cout<<a[i];
	}
}



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

int main(){
    int x,n;
    cin>>x>>n;
    vector<int>pn(n);
    rep(i,n)cin>>pn[i];
    map<int,int>mp;
    for(int i=0;i<=200;i++){
        mp[i]=abs(i-x);
    }
    int mn=10000;
    vector<int>ans;
    for(auto p:mp){
        bool ok=true;
        rep(i,n){
            if(p.first==pn[i]){
                ok=false;
                break;
            }
        }
    if(ok)mn=min(p.second,mn);
        
    }
    for(auto p:mp){
        bool ok=false;
        rep(i,n){
            if(p.second==mn && p.first!=pn[i]){
                ok=true;
            }
            else {ok=false; break;}
        }
        if(ok)ans.push_back(p.first);
    }
    int anskai=10000;
    rep(i,ans.size())anskai=min(anskai,ans[i]);
    if(ans.size()>0)cout<<anskai<<endl;
    else cout<<x<<endl;
}

Measured memory_bytes: 3640
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const long long MOD = 1000000000 + 7;//1000000000 + 7 998244353 924844033 1000000000 + 9;
constexpr long long INF = 1LL << 60;//numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourth; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge {
	LL from, to, cost;
};
vector<vector<Edge>>g;
vector<edge>ed;
vector<Pll>pv;
set<LL>st;
map<Pll, LL>ma;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
string str, ss;
bool f;
LL n, m, s, t, h, w, k, q, p, ans, sum, cnt, a[210000], b[210000], fact[1000], dp[210][100010];
LL dpdp(int x, int y) {
	if (x == n)return y;
	if (dp[x][y] != -1)return dp[x][y];
	return dp[x][y] = (dpdp(x + 1, y%a[x]) + dpdp(x + 1, y)*(n - x - 1))%MOD;
}
int main() {
	cin >> n >> m;
	rep(i, n) {
		cin >> a[i];
	}
	sort(a, a + n, [](LL x, LL y) {return x > y; });
	rep(i, n + 1)rep(j, 100010)dp[i][j] = -1;
	cout << dpdp(0, m) << endl;
	return 0;
}

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

int main() {
  string s;
  cin >> s;
  vector<char> result;
  for (int i = 0; i < s.size(); ++i) {
    char c = s[i];
    if (c == '0') {
      result.push_back('0');
    } else if (c == '1') {
      result.push_back('1');
    } else if (c == 'B' && 0 < result.size()) {
      result.pop_back();
    }
  }
  int r_size = result.size();
  for (int i = 0; i < r_size; ++i) {
    cout << result[i];
  }
}

Measured memory_bytes: 256
require 'set'

n, m = gets.split.map(&:to_i)
a = [[?#] * (m + 2)] + (1..n).map { [?#] + gets.chomp.split("") + [?#] } + [[?#] * (m + 2)] 
y = x = dy = dx = gy = gx = nil
(1..n).each do |i|
  (1..m).each do |j|
    next if a[i][j] == ?. or a[i][j] == ?# 
    if a[i][j] ==  ?G
      gy, gx = i, j
      a[i][j] = ?.
      next
    end
    y, x = i, j
    case a[i][j]
    when ?<
      dy, dx = 0, -1
    when ?^
      dy, dx = -1, 0
    when ?v
      dy, dx = 1, 0
    when ?>
      dy, dx = 0, 1
    end
    a[i][j] = ?.
  end
end

reached = Set[[y, x, dy, dx]]
answer = -1
loop do
  until a[y + dy][x + dx] == ?.
    dy, dx = -dx, dy 
    break if reached.include?([y, x, dy, dx])
    reached << [y, x, dy, dx]
  end
  y += dy
  x += dx
  break if reached.include?([y, x, dy, dx])
  reached << [y, x, dy, dx]
  if y == gy && x == gx
    answer = reached.to_a.map {|b| b[0..1]}.uniq.size
    break
  end
  if a[y + dx][x - dy] == ?.
    dy, dx = dx, -dy
    y += dy
    x += dx
    break if reached.include?([y, x, dy, dx])
    reached << [y, x, dy, dx]
    if y == gy && x == gx
      answer = reached.to_a.map {|b| b[0..1]}.uniq.size
      break
    end
  end
end
p answer



Measured memory_bytes: 9284
n, x, y = map(int,input().split())

ans_list = [0]*(n)
for i in range(1, n+1):
    for j in range(i+1, n+1):
            min_dis = min(abs(j-i), abs(x-i) + 1 + abs(j-y), abs(y-i)+1+abs(j-x))
            ans_list[min_dis] += 1

for i in range(1, len(ans_list)):
    print(ans_list[i])

Measured memory_bytes: 3444
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    A, B, C, D = map(int, input().split())
    dp = [0] * 1000
    for i in range(A, B):
        dp[i] += 1
    for i in range(C, D):
        dp[i] += 1
    print(dp.count(2))


if __name__ == '__main__':
    main()


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


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

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

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

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

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


#define REP(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define PB push


#define MOD 1000000007LL
#define EPS 1e-10

LL N;
set<LL> s;

bool CheckIf753(LL number)
{
    vector<bool> ok(10);
    ok.assign(10, false);
    while (number > 0)
    {
        ok[number % 10] = true;
        number /= 10;
    }
    return ok[7] && ok[5] && ok[3];
}

void dfs(LL number, LL digitsNum)
{
    if (number > N) return;

    for (int i : {3, 5, 7, 0})
    {
        if (i == 0)
        {
            if (CheckIf753(number))
            {
                s.insert(number);
            }
        }
        else
        {
            dfs(number * 10 + i, digitsNum + 1);
        }
    }
}

int main()
{
    cin >> N;
    dfs(0, 0);
    cout << s.size() << endl;
    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
using pll = pair<ll, ll>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}
ll ceilll(ll a, ll b) {return (a + b-1) / b;} // if(a%b == 0) (a/b) + 1
ll get_digit(ll a) {ll digit = 0; while(a != 0){a /= 10; digit++;} return digit;} // a != 0
template<typename T> void vecdbg(vector<T>& v){ rep(i, v.size()){cout << v[i] << " ";} br;}
template<typename T> void vecvecdbg(vector<vector<T>>& v){ rep(i, v.size()){rep(j, v[i].size()){cout << v[i][j] << " ";} br;}}

// 0 false, 1 true 
// string number to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp
// global vector -> 0 initialization

struct UnionFind
{
    vector<long long> d;
    UnionFind(long long n = 0) : d(n, -1)
    {
    }

    //root : -size, not root: root
    long long root(long long x){
        if(d[x] < 0){
            return x; 
        }
        return d[x] = root(d[x]);
    }

    bool unite(long long x, long long y){
        x = root(x);
        y = root(y);
        if(x == y){
            return false;
        }
        if(d[x] > d[y]){
            swap(x, y);
        }
        d[x] += d[y];
        d[y] = x;
        return true;
    }

    long long size(long long x){
        return -d[root(x)];
    }

    bool issame(long long a, long long b){
        return root(a) == root(b);
    }
};

int main() {
    ll n, m; cin >> n >> m;
    UnionFind uf(n);
    rep(i, m){
        ll a, b; cin >> a >> b; a--; b--;
        uf.unite(a, b);
    }

    map<ll, ll> mp;
    rep(i, n){
        mp[uf.root(i)]++;
    }

    cout << mp.size() - 1 << endl;

}

Measured memory_bytes: 9264
// {{{
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
// }}}

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

static constexpr int mod = (int)1e9 + 7;
static constexpr int inf = 100100100;
static constexpr ll linf = 1e18;
static constexpr double eps = 1e-9;
static constexpr double pi = 3.14159265359;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rrep(i, n) for (ll i = n; i >= 0; --i)
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define pb push_back
#define ist insert
#define fst first
#define snd second

int main() {
    // cin.tie(0);
    // ios_base::sync_with_stdio(false);
    ll N;
    cin >> N;
    map<char, ll> M;
    rep (i, N) {
        ll a;
        cin >> a;
        if (a <= 399) {
            ++M['g'];
        } else if (a <= 799) {
            ++M['b'];
        } else if (a <= 1199) {
            ++M['G'];
        } else if (a <= 1599) {
            ++M['s'];
        } else if (a <= 1999) {
            ++M['B'];
        } else if (a <= 2399) {
            ++M['y'];
        } else if (a <= 2799) {
            ++M['o'];
        } else if (a <= 3199) {
            ++M['r'];
        } else {
            ++M['x'];
        }
    }
    ll cnt = 0;
    for (auto it : M) {
        if (it.fst == 'x') continue;
        ++cnt;
    }
    if (cnt == 0) {
        ll amin = 1;
        ll amax = M['x'];
        cout << amin << ' ' << amax << endl;
    } else {
        ll amin = cnt;
        ll amax = cnt + M['x'];
        cout << amin << ' ' << amax << endl;
    }
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

typedef vector<int> vi;

int main()
{
  int N, M;
  cin >> N >> M;
  vector<int> a(M), b(M), c(M);
  REP(i, M)
  {
    cin >> a[i] >> b[i] >> c[i];
    a[i]--, b[i]--;
  }
  int INF = 1010;
  vector<vi> dist(N, vi(N, INF));
  REP(i, N)
  REP(j, N)
  {
    if (i == j)
      dist[i][j] = 0;
  }
  REP(i, M)
  {
    dist[a[i]][b[i]] = c[i];
    dist[b[i]][a[i]] = c[i];
  }
  REP(k, N)
  REP(i, N)
  REP(j, N)
  dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]); // ワーシャルフロイド法
  int ans = M;
  REP(k, M)
  {
    bool use = false;
    REP(i, N)
    REP(j, N)
    {
      if (dist[i][j] == dist[i][a[k]] + c[k] + dist[b[k]][j])
        use = true;
    }
    if (use)
      ans--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

struct Element
{
  long taste;
  std::array<int, 3> indexes;

  bool operator<(const Element& rhs) const
  {
    return taste < rhs.taste;
  }
};

template<typename T, typename U>
long taste_sum(const T& tastes, const U& indexes)
{
  long result = 0;
  for (auto i = 0u; i < tastes.size(); ++i) {
    result += tastes[i][indexes[i]];
  }
  return result;
}

template<typename T>
std::vector<long> solve(int k, T& tastes)
{
  std::vector<long> result(k);

  for (auto& v : tastes) {
    std::sort(v.begin(), v.end());
  }

  std::priority_queue<Element> queue;
  const std::array<int, 3> xyz0 = {
    static_cast<int>(tastes[0].size() - 1),
    static_cast<int>(tastes[1].size() - 1),
    static_cast<int>(tastes[2].size() - 1)
  };
  queue.push({taste_sum(tastes, xyz0), xyz0});

  std::set<std::array<int, 3>> memo;

  for (int i = 0; i < k; ++i) {
    const auto e = queue.top();
    queue.pop();
    result[i] = e.taste;

    for (int j = 0; j < 3; ++j) {
      if (e.indexes[j] > 0) {
        auto xyz = e.indexes;
        --xyz[j];
        if (memo.insert(xyz).second) {
          queue.push({taste_sum(tastes, xyz), xyz});
        }
      }
    }
  }

  return result;
}

int main()
{
  std::vector<int> sizes(3);
  int k;
  std::vector<std::vector<long>> tastes(3);
  std::cin >> sizes[0] >> sizes[1] >> sizes[2] >> k;
  for (int i = 0; i < 3; ++i) {
    tastes[i].resize(sizes[i]);
    for (int j = 0; j < sizes[i]; ++j) {
      std::cin >> tastes[i][j];
    }
  }

  const auto result = solve(k, tastes);
  for (int i = 0; i < k; ++i) {
    std::cout << result[i] << std::endl;
  }
}


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

using namespace std;

#define pi 3.1415926536
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bs binary_search
#define int long long
#define float double

typedef map<int,int> mii;
typedef map<char,int> mci;
typedef map<string,int> msi;
typedef map<string,string> mss;
typedef map<char,char> mcc;
typedef map<pair<int,int>,int> mpi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef set<int> si;
typedef set<string> ss;
typedef set<char> sc;
int const max1= 1e5+5;
int const mod = 1e9+7;


int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t=1;
//cin>>t;
while(t--){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    int ans=0;
    if(n<=2){
        cout<<0;
    }
    else{
        for(int i=0;i<n-2;i++){
            for(int j=i+1;j<n-1;j++){
                if(a[j]!=a[i]){
                    for(int k=j+1;k<n;k++){
                        if(a[i]+a[j]>a[k] && a[k]!=a[i] && a[k]!=a[j]){
                            //cout<<i<<" "<<j<<" "<<k<<endl;
                            ans++;
                        }
                    }
                }
            }
        }
        cout<<ans;
    }
}
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
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 int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
	ll n;
	cin >> n;
	ll ans = 0;
	set<ll> s;
	for(ll i = 1; i*i<= n; i++){
		if(n%i==0){s.insert(i);s.insert(n/i);}
	}
	for(auto e: s){
		if(e-1>n/e) ans += e-1;
	}
	cout << ans << endl;
}

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

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  vector<int> a(100);
  a[0] = 2;
  a[1] = 1;
  rep(i, 2, n+1) {
    a[i] = a[i-1] + a[i-2];
  }  
  cout << a[n] << "\n";

}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>

#define ll long long
#define pll pair<ll, ll>

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

const int INF = 1111111111;

using namespace std;

const int N = 3333;
const int S = 3333;

const int MOD = 998244353;

int n, s;
int a[N];
int dp[S][S];

void init()
{
	cin >> n >> s;
	rep(i, n) cin >> a[i];
}

void solve()
{
	dp[0][0] = 1;
	rep(i, n)
	{
		rep(j, s + 1)
		{
			dp[i + 1][j] = (dp[i + 1][j] + (dp[i][j] * 2 % MOD)) % MOD;

			int rev = j - a[i];
			if (rev >= 0)
			{
				dp[i + 1][j] = (dp[i + 1][j] + dp[i][rev]) % MOD;
			}
		}
	}

	cout << dp[n][s] << endl;
}

int main()
{
	init();
	solve();
}


Measured memory_bytes: 42212
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

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

	if (x < a) {
		cout << 0 << endl;
	}
	else {
		cout << 10 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		//最小公倍数を入れる
		long lcm = 0;

		//最小公倍数を求める
		int i=1;
		while(i<=b){
			if((long)a * i % b == 0) {
				lcm = (long)a*i;
				break;
			}
			else{
				i++;
			}
		}

		 System.out.println(lcm);
		 sc.close();
	}
}


Measured memory_bytes: 21844
/*
     Author: Wasi Ur Rahman
     RMSTU
*/

#include <bits/stdc++.h>
using namespace std;
#define  fast           ios::sync_with_stdio(false);cin.tie(0)
int pos[27] = {0};
int main()
{
    fast;
    int a,b,c;
    cin >> a >> b >> c;
    swap(a,b);
    swap(a,c);
    cout << a << " " << b << " " <<  c << endl;
}


Measured memory_bytes: 256
// Problem : C - Maximum Volume
// Contest : AtCoder Beginner Contest 159
// URL : https://atcoder.jp/contests/abc159/tasks/abc159_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...) printf("")
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("-1");exit(0);}

	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int MM=5e6+10;
	ll fac[MM],facinv[MM],Inv[MM];ll Comb(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,MM-1) fac[i]=fac[i-1]*i%MOD;
		facinv[MM-1]=invm(fac[MM-1]);fd(i,MM-1,1) facinv[i-1]=facinv[i]*i%MOD;
		Inv[1]=1;fo(i,2,MM-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	}

	const int N=1e6+10;
	//------------------FIXED------------------
	
	void main()
	{
		double L=qread();printf("%lf", pow(L/3,3) );
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	// freopen("z.txt","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	srand(time(0));
	mine::main();
	//debug("\n------------------------------------------\nTime: %.2lf s\n",1.0*clock()/CLOCKS_PER_SEC);
}

Measured memory_bytes: 384
#include <iostream>


using namespace std;

int main()
{
    int n, a, odd;
    cin >> n;

    while (n--) {
        cin >> a;
        if (a % 2 != 0) ++odd;
    }
    if (odd % 2 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <bitset>
#include <stack>
#include <deque>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> pip;
typedef long long LL;

int main() {
    int a[4];
    int b[] = {1, 4, 7, 9};
    for (int i = 0; i < 4; i++) scanf("%d", &a[i]);
    sort(a, a + 4);
    bool ans = true;
    for (int i = 0; i < 4; i++) {
        if (a[i] != b[i]) ans = false;
    }
    puts(ans ? "YES" : "NO");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
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; }

int main(){
    int n;
    cin >> n;
    vector<P> ab(n);
    rep(i,n) cin >> ab[i].first >> ab[i].second;
    sort(all(ab));
    int ans = 0;
    ans += ab[n-1].first + ab[n-1].second;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3932
#include <iostream>
using namespace std;
int main(){
  int i,max,min,a,sum;
  min=10000;
  max=1;
  sum=0;
  for(i=0;i<3;i++){
    cin >>a;
    sum+=a;
    if(max<a)max=a;
    if(min>a)min=a;
  }
  cout<<min<<" "<<sum-min-max<<" "<<max<<endl;
  return 0;
}
    

Measured memory_bytes: 1164
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <climits>
#include <cfloat>

using namespace std;
using ll = long long int;

const ll MOD = 1000000007;

template<typename T>
int cin_vec(vector<T> &vec) {
    for (auto &i : vec) {
        cin >> i;
    }
    return 0;
}

template<typename T>
int cout_vec(vector<T> vec, bool insertNewLine = true) {
    if (insertNewLine) {
        for (const auto &i : vec) {
            cout << i << endl;
        }
    } else {
        for (const auto &i : vec) {
            cout << i << flush;
        }
    }
    return 0;
}

template<typename T>
ll min_vec(std::vector<T> vec) {
    auto iter = min_element(vec.begin(), vec.end());
    ll index = distance(vec.begin(), iter);
    return index;
}

template<typename T>
ll max_vec(std::vector<T> vec) {
    auto iter = max_element(vec.begin(), vec.end());
    ll index = distance(vec.begin(), iter);
    return index;
}

int main() {
    int n, k;
    string s;
    cin >> n >> k >> s;
    --k;
    if (s[k] == 'A') {
        s[k] = 'a';
    } else if (s[k] == 'B') {
        s[k] = 'b';
    } else {
        s[k] = 'c';
    }
    cout << s;
    return 0;
}

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

int main() {
  int n = 0;
  cin >> n;
  int a = n%10;
  if (a ==2 || a ==4 || a == 5 || a == 7 || a==9){
  	cout << "hon" << endl;
  } else if (a ==0 || a ==1 || a == 6 || a == 8){
  	cout << "pon" << endl;
  } else {
    cout << "bon" << endl;
  }
  
  
 return 0; 
}

Measured memory_bytes: 3132
#include<iostream>
#include<string>
using namespace std;
int main() {
	int n,b,f,r,v,ro[4][3][10];
	for(int i=0;i<4;i++)
		for(int j=0;j<3;j++)
			for(int k=0;k<10;k++)
				ro[i][j][k]=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>b>>f>>r>>v;
		ro[b-1][f-1][r-1]+=v;
	}
	for(int i=0;i<4;i++){
		for(int j=0;j<3;j++){
			for(int k=0;k<10;k++){
				cout<<" "<<ro[i][j][k];
			}cout<<endl;
	}
	if(i!=3){
		for(int j=0;j<20;j++)
			cout<<"#";
		cout<<endl;
	}
}
return 0;
}




Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define dunk(a) cout << (a) << "\n"
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> d(n);
	rep(i, n) cin >> d[i];
	sort(all(d));
	int ans = d[n / 2] - d[n / 2 - 1];
	dunk(ans);
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

ll n, m, q;
vector<ll> ar;
ll ans;
int a[55], b[55], c[55], d[55];

ll calc() {
  ll res = 0;
  REP(i, q) {
    if (ar[b[i]] - ar[a[i]] == c[i]) {
      res += d[i];
    }
  }
  return res;
}

void dfs(ll p, ll c) {
  if (p == n + 1) {
    ans = max(ans, calc());
    return;
  }

  FOR(i, c, m + 1) {
    ar.push_back(i);
    dfs(p + 1, i);
    ar.pop_back();
  }
}

int main() {
  cin >> n >> m >> q;
  REP(i, q) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    a[i]--;
    b[i]--;
  }
  ans = 0;

  dfs(1, 1);
  cout << ans << endl;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x);
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;

const ll MAX = 2e5+6;
const ll inf = 5e18;

ll h[MAX],a[MAX],n;

ll tree[MAX*2];

void update(ll x,ll v){
    x+=n;
    tree[x]=v;
    while(x>0){
        x>>=1;
        tree[x]=max(tree[x<<1],tree[x<<1 | 1]);
    }
}

ll query(ll l,ll r){
    ll ans=0;
    for(l+=n,r+=n;l<r;l>>=1,r>>=1){
        if(l&1) ans=max(ans,tree[l++]);
        if(r&1) ans=max(ans,tree[--r]);
    }
    return ans;
}

int main(){
    fastio;
    cin>>n;
    f(i,0,n) cin>>h[i];
    f(i,0,n) cin>>a[i];
    f(i,0,n) h[i]--;
    f(i,0,n){
        ll dis = query(0,h[i]);
        update(h[i],a[i]+dis);
    }
    cout<<query(0,n)<<endl;
    return 0;       
}

Measured memory_bytes: 6528
/*																													   
 Templatka c++ Kacper Fis																							   																											   //
*/																													  
#include <functional>																							   
#include <bits/stdc++.h>																							   
																													   
using namespace std; 																								   
																													   
const int INF = 1000000001;																						   
const float PI = 3.14;	
const int mod = 1e9+7;																							   
typedef long long LL;																								   
																													   
typedef vector<int> vi;																								   
typedef list<int> li;																								   
typedef queue<int> qi; 																								   
typedef pair<int,int> ii; 																							   
typedef map<string,int> msi; //np msi['nazwa'] = 'liczba'															   
typedef vector<ii> vii; //vector par<int>, do tworzenia tablicy dla grafów wagowych #dijkstra #Bellman_Ford			   
typedef priority_queue< ii, vector<ii>, greater<ii> > pq; //kolejka priorytetowa vectorów par(top()=min) #dijkstra																													   																				   list<int>::iterator it;																								   
																				   
vector<ii>::iterator iter;																							   
																													   																				   
#define print_list(x) for(it = (x).begin(); it != (x).end(); it++) {cout << *it << " ";}							   
#define print_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++) {cout << *it2 << " ";}						   
#define search_list(x) for(it = (x).begin(); it != (x).end(); it++)													   
#define search_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++);											   
#define pb(x) push_back(x) 																							   
#define pf(x) push_front(x)																							   
#define mp(x, y) make_pair(x, y)                                                                                       
///////////////////////////////////////////////GLOBAL DEFINITIONS//////////////////////////////////////////////////////




///////////////////////////////////////////////FUNCTIONS/////////////////////////////////////////////////////////////




/////////////////////////////////////////////////////MAIN////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])																					 
{ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);                  												       
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	int a, b, c;
	cin >> a >> b >> c;
	
	if(b / a >= c) cout << c << endl;
	else cout << b / a << endl;
	
	
	
	
	
	
	
	
	
	
	
	
						
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int x=s.size();
	int o=0;
	for(int i=1;i<x;i++){
		if(o!=0)break;
		for(int k=0;k<i;k++){
			if(s[k]==s[i]){
				o++;
				cout<<"no"<<endl;
			}
		}
	}
	if(o==0){
		cout<<"yes"<<endl;
	}
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include <random>
#define ll long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const int INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const int MOD = 1000000007;
const int MAX = 510000;
const double pi = acos(-1);
const double eps = 1e-9;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    double concnow=0.0;
    ll ans=0,sugar=0;
    rep(i,31){
        if(100*a*i>f) continue;
        rep(j,31){
            if(100*a*i+100*b*j>f) continue;
            if(i==0&&j==0) continue;
            rep(k,3001){
                if(100*a*i+100*b*j+c*k>f) continue;
                rep(l,3001){
                    ll sum=i*a*100+j*b*100+k*c+l*d;
                    double conc=(double)((double)((k*c+l*d)*100)/(double)(sum));
                    if((k*c+l*d)*100>e*(i*a*100+j*b*100)) break;
                    if(sum>f) break;
                    if(concnow<conc){
                        ans=sum;
                        sugar=k*c+l*d;
                        concnow=conc;
                    }
                }
            }
        }
    }
    if(ans==0) cout<<100*a<<" "<<0<<endl;
    else cout<<ans<<" "<<sugar<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		for(int i=0; i<m; i++){
			int money=sc.nextInt();//初期資金
			int year=sc.nextInt();
			int n=sc.nextInt();
			int max=0;
			for(int j=0; j<n; j++){
				int f=sc.nextInt();
				double d=sc.nextDouble();
				int hand=sc.nextInt();
				int sum=0;
				int temp=money;
				if(f==0){//単利
					//この場合のsumは単利と手数料の合計
					for(int k=0; k<year ;k++){
						sum += (int)Math.floor(temp*d);
						temp -= hand;
					}
					sum += temp;//なので最後に初期資金を足す
				}
				else if(f==1){//複利
					//この場合のsumは最終金額
					sum=money;
					for(int k=0; k<year ;k++){
						sum += (int)Math.floor(sum*d);
						sum -= hand;
					}
				}
				//System.out.println("j="+(j+1)+" sum="+sum);
				max=Math.max(max, sum);
			}
			System.out.println(max);
		}

	}

}

Measured memory_bytes: 42800
var
  i:longint;
  x:char;
  a:array[1..4] of char;
begin
  a[1]:='Y';
  a[2]:='A';
  a[3]:='K';
  a[4]:='I';
  for i:=1 to 4 do
  begin
    read(x);
    if x<>a[i] then begin writeln('No');exit;end;
  end;
  writeln('Yes');
end.

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

int a[100010], b[100010];

int main(){
    int n;
    cin >> n;
    rep(i, n){
        cin >> a[i] >> b[i];
    }
    rep(i, n-2){
        if (a[i]==b[i] && a[i+1] == b[i+1] && a[i+2] == b[i+2]){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3636
S = input()
print(
    "Yes" if sum(
        [1 if i % 2 == 0 and S[i] in "RUD" else
         1 if i % 2 != 0 and S[i] in "LUD" else 0
         for i in range(len(S))]) == len(S)
    else "No")


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

int main()
{
	int n;
	std::cin >> n;
	std::vector<int> a(n + 1, 0);
	for (int x = 1; x < 100; x++)
	{
		for (int y = 1; y < 100; y++)
		{
			for (int z = 1; z < 100; z++)
			{
				int value = x * x + y * y + z * z + x * y + y * z + z * x;
				if (value <= n)
					++a[value];
			}
		}
	}
	for (int i = 1; i <= n; i++)
	{
		std::cout  << a[i] << '\n';
	}
	return 0;
}

Measured memory_bytes: 3560
#include<stdio.h>

int main(){
  int n;
  int a;
  int b;
  int c;
  int d;
  char str[300000] = {};
  int i = 0;
  int flag = 1;
  int three = 0;
  scanf("%d %d %d %d %d",&n,&a,&b,&c,&d);
  scanf(" %s",str);
  if(c < d){
    three = 1;
    for(i=a-1;i<d;i++){
      if(str[i] == '#' && str[i+1] == '#'){
        flag = 0;
      }
    }
  }else{
    for(i=a-1;i<c;i++){
      if(str[i] == '#' && str[i+1] == '#'){
        flag = 0;
      }
    }
    for(i=b-1;i<d;i++){
      if(str[i-1] == '.' && str[i] == '.' && str[i+1] == '.'){
        three = 1;
       // printf("%d#",i);
      }
    }
  }
  
  if(three && flag){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}
      
      
        

Measured memory_bytes: 512
n, a, b = list(map(int, input().split()))
s = list(input())

sum = a + b
passingD = 0  # 国内
passingF = 0  # 海外
flag = 'No'

for i, student in enumerate(s, 1):
    if student == 'a' and (passingD + passingF) < sum:
        passingD = passingD + 1
        flag = 'Yes'
    elif student == 'b' and (passingD + passingF) < sum and passingF < b:
        passingF = passingF + 1
        flag = 'Yes'
    else:
        flag = 'No'

    print(flag)

Measured memory_bytes: 4708
x,y = map(int,input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]
 
if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from itertools import accumulate

n = ni()

a = [i for i in range(1,101)]
acc = list(accumulate(a))

if n%2:
    groups = [[i, n-i] for i in range(1,(n+1)//2)]
    groups.append([n])
else:
    groups = [[i, n-i+1] for i in range(1,n//2 + 1)]
    
edges = []

for i in range(len(groups)):
    for j in range(len(groups[i])):
        for k in range(1,n+1):
            if k in groups[i] or groups[i][j] > k:
                continue
            
            else:
                edges.append([groups[i][j], k])
                
print(len(edges))
for ei in edges:
    print(*ei)

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

typedef long long ll;
const ll INF=1LL<<60;

int main(){
    ll N,W;
    cin>>N>>W;
    ll w[110],v[110];
    for(int i=1;i<=N;i++){
        cin>>w[i]>>v[i];
    }
    vector<vector<ll>> dp(110,vector<ll>(100010));
    for(int i=1;i<=100000;i++){
        dp[0][i]=INF;
    }
    dp[0][0]=0;
    for(int i=1;i<=N;i++){
        for(int j=0;j<=100000;j++){
            dp[i][j]=dp[i-1][j];
            if(j>=v[i]){
                dp[i][j]=min(dp[i][j],dp[i-1][j-v[i]]+w[i]);
            }
        }
    }
    for(int i=100000;i>=0;i--){
        if(dp[N][i]<=W){
            cout<<i<<endl;
            return 0;
        }
    }
}


Measured memory_bytes: 87296
l,r = map(int, input().split())
# l=10000000
# r=100000000

mini=l*r%2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        if(j%2019==0):
            mini=0
            break;
        
        if(i*j%2019<mini):
            mini=i*j%2019
    if mini==0:
        break;
print(mini)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

// 繰り返し二乗法 x^n % mod を求める
ll mod_pow(ll x, ll n, ll mod = MOD) {
	if (n == 0) return 1;
	ll res = mod_pow(x * x % mod, n / 2, mod);
	if (n & 1) res = res * x % mod;
	
	return res;
}

 // 20^5以下階乗とその逆元(mod mod[素数])を求める
vector<ll> fact, inv;
void fact_inv(int n, ll mod = MOD) {
	fact.resize(n + 1);
	inv.resize(n + 1);
	
	fact[0] = 1;
	FOR(i, 1, n + 1) fact[i] = fact[i - 1] * i % mod;
	inv[n] = mod_pow(fact[n], mod - 2, mod);
	for (int i = n; i > 0; i--) inv[i - 1] = inv[i] * i % mod;
}

int main() {
	int Q;
	cin >> Q;
	
	ll mod = 1000003;
	fact_inv(mod - 1, mod);
	
	while (Q--) {
		ll x, d, n;
		scanf("%lld %lld %lld", &x, &d, &n);
		
		ll ans;
		if (x == 0) ans = 0;
		else if (d == 0) ans = mod_pow(x, n, mod);
		else {
			ll inv_d = mod_pow(d, mod - 2, mod);
			ll xd = x * inv_d % mod;
			if (xd + n - 1 >= mod) ans = 0;
			else {
				ans = fact[xd + n - 1] * inv[xd - 1] % mod; 
				ans = ans * mod_pow(d, n, mod) % mod;
			}
		}
		printf("%lld\n", ans);
	}
	return 0;
}


Measured memory_bytes: 16512
a = int(input())
b = list(map(int, input().split()))
c = 0
for i in range(a):
    c += b[i]
d = 0
e = 0
for i in range(a):
    d += b[i]
    if d >= c // 2:
        e = d - b[i]
        print(min(abs(c - 2 * d), abs(c - 2 * e)))
        exit()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    int w;
    cin >> w;
    int i=0;
    while(i<S.size()){
        if(i%w==0)  cout << S.at(i);
        i++;
    }
    cout << endl;
}


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

int n, k, M, binom[305][305], f[305][305], sum[305][305];

int main() {
	scanf("%d%d%d", &n, &k, &M), ++n, ++k;
	for (int i = 0; i <= n; ++i)
		for (int j = binom[i][0] = 1; j <= i; ++j)
			binom[i][j] = (binom[i - 1][j] + binom[i - 1][j - 1]) % M;
	fill(f[1] + 1, f[1] + 1 + k, 1);
	for (int i = k - 1; i; --i)
		sum[1][i] = k - i;
	for (int i = 2; i <= n; ++i) {
		for (int x = 1; x <= k; ++x)
			for (int j = 1; j <= i - 1; ++j)
				f[i][x] = (f[i][x] + 1ll * f[i - j][x] * sum[j][x] % M * binom[i - 2][j - 1]) % M;
		for (int x = k - 1; x; --x)
			sum[i][x] = (sum[i][x + 1] + f[i][x + 1]) % M;
	}
	printf("%d\n", f[n][1]);
	return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

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

Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int GetGroup(int i)
{
    switch (i)
    {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
        return 0;
    case 4:
    case 6:
    case 9:
    case 11:
        return 1;
    case 2:
        return 2;
    }
    return -1;
}

void _main()
{
    int x, y;
    cin >> x >> y;
    cout << (GetGroup(x) == GetGroup(y) ? "Yes" : "No") << endl;
}


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

int main(){
  std::vector<int> v(3);
  int n = 0;
  for(int i=0; i<3; i++) {
    std::cin >> v[i];
    n += v[i];
  }
  if(n>21){
    std::cout << "bust";
  }
  else{
    std::cout << "win" ;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

		long a[];
		a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(sc.next());
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

}

Measured memory_bytes: 60608
import sys
input=sys.stdin.readline
n,a,b=map(int,input().split())
s=input()
nin=0
fr=0;l=[""]*n
for i in range(n):
    l[i]="No"
    if s[i]=="a" and nin<a+b:nin+=1;l[i]="Yes"
    elif s[i]=="b":
        if fr+1<=b and nin<a+b:nin+=1;fr+=1;l[i]="Yes"
    
print(*l,sep="\n")

Measured memory_bytes: 6448