akhauriyash/Code-Regression huggingface dataset:
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto N = RD;
	long ans = 1;
	long best;
	foreach (i; 1..N+1)
	{
		auto x = i;
		long cnt;
		while (x % 2 == 0)
		{
			x /= 2;
			++cnt;
		}
		if (cnt > best)
		{
			best = cnt;
			ans = i;
		}
	}

	writeln(ans);
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N;cin >> N;
    vector<int> h(N+2);
    rep(i,N)cin >> h[i];
    vector<int> dp(N+2);
    rep(i,N+2)dp[i] = 1 << 30;
        dp[0] = 0;
    rep(i,N){
        chmin(dp[i+1],dp[i] + abs(h[i] - h[i+1]));
        chmin(dp[i+2],dp[i] + abs(h[i] - h[i+2]));        
    }
    cout << dp[N-1] << endl;
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int llu;
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pair<int,int>>
#define pb push_back
#define mp map<lli,lli>
#define INF 1000000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
int v[10][10];
int main()
{
    ll h,w,k;
    ll ans=0;
    cin>>h>>w>>k;
    string s[10];
    for(int i=1;i<=h;i++)
    {
        cin>>s[i];
    }
    for(int i=1;i<=h;i++)
    {
        s[i]='0'+s[i];
    }
    ll re=pow(2,h)-1,ce=pow(2,w)-1;
    for(ll i=0;i<=re;i++)
    {   
        int ha[10];
        int t=i;
        for(int k=1;k<=h;k++)
        {
            ha[k]=t%2;
            t=t/2;
        }
        for(int j=0;j<=ce;j++)
        {     
             int wa[10];
             t=j; 
             for(int k=1;k<=w;k++)
             {   
                 wa[k]=t%2;
                 t=t/2;
             }
             for(int l=1;l<=h;l++)
             {
                 for(int m=1;m<=w;m++)
                 {
                     v[l][m]=0;
                 }
             }
             for(int l=1;l<=h;l++)
             {
                 if(ha[l]==1)
                 {for(int m=1;m<=w;m++)
                 {
                     v[l][m]=1;
                 }
                 }
             }
             for(int m=1;m<=w;m++)
             {
                 if(wa[m]==1)
                 {for(int l=1;l<=h;l++)
                 {
                     v[l][m]=1;
                 }
                 }
             }
             int count=0;
             for(int l=1;l<=h;l++)
             {
                 for(int m=1;m<=w;m++)
                 {
                     if(s[l][m]=='#'&&v[l][m]==0)
                     {
                         count++;
                     }
                 }
             }
             if(count==k)
             {   
                 ans++;
             }
        }
    }
    cout<<ans;
    return 0;
}


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

int main(){
int N,M; 
cin >> N >> M;
  
int L=0, R=N, maxL=0, minR=N; 
  
for(int i=1;i<=M;i++){
  cin >> L >> R;
  maxL = max(L, maxL);
  minR = min(R, minR);
}
int num = 0;
if (maxL>minR) num = 0;
else  num = minR-maxL+1;
printf("%d\n",num); 
}

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

using namespace std;

#define rep(i, n) for(long int i = 0; i < n; i++)
#define P pair<int, int>
#define ll long long
typedef vector<int> vec;
typedef vector<vec> mat;

int main(){
    ll a;
    double b;
    cin >> a >> b;
    b *= 100;
    b += 0.0001;
    ll c = (ll)b;
    ll ans = a * c;
    ans /= 100;
    cout << ans << endl;
}


Measured memory_bytes: 3724
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    result = input()
    if result == "AC":
        ac += 1
    elif result == "WA":
        wa += 1
    elif result == "TLE":
        tle += 1
    elif result == "RE":
        re += 1
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Measured memory_bytes: 9208
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ll long long
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define repr(i, a, n) for (ll i = (n); i >= (a); --i)
using namespace std;
const int INF(1 << 30);
const ll LLINF(1LL << 55LL);
const int pi = 3.1415926536;
const int MOD = 1000000007;
const int MAX = 510000;

void Main() {
  int n, d, x, a;
  cin >> n >> d >> x;
  int ans = 0;
  rep(i, 0, n) {
    cin >> a;
    ans++;
    rep(j, 1, d + 1) {
      if (j * a + 1 <= d) {
        ans++;
      }
    }
  }

  cout << ans + x << endl;
}

int main() {
  std::cin.tie(nullptr);                  // 標準入出力高速化
  std::ios_base::sync_with_stdio(false);  // CとC++の入出力出力を非同期
  std::cout << std::fixed << std::setprecision(15);  // 小数を10進数表示
  Main();
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		List<Integer> li=new ArrayList<>();
		int count=0;
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i)=='R')
			{
				count++;
			}
			else
			{
				li.add(count);
				count=0;
			}
		}
      if(count>0)
      {
        li.add(count);
      }
		Collections.sort(li,Collections.reverseOrder());
		System.out.println(li.get(0));
	}

}


Measured memory_bytes: 35680
#include <bits/stdc++.h>
#define maxn 100005
using namespace std;

int cost[3][maxn], dp[3][maxn] = {};
int n;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for(int i = 1; i <= n; i++) {
        for(int k = 0; k < 3; k++) {
            cin >> cost[k][i];
        }
    }
    for(int i = 1; i <= n; i++) {
        for(int j = 0; j < 3; j++) {
            dp[j][i] = 0;
            for(int k = 0; k < 3; k++) {
                if(k != j) {
                    dp[j][i] = max(dp[j][i], dp[k][i - 1]);
                }
            }
            dp[j][i] += cost[j][i];
        }
    }
    cout << max({dp[0][n], dp[1][n], dp[2][n]}) << '\n';
    return 0;
}


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

using namespace std;

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

int solve0(int n) {
    int sum = 0;
    vector<vector<int>> r;
    for (int a = 1; a <= n; a++) {
        for (int b = 1; b <= n; b++) {
            for (int c = 1; c <= n; c++) {
                sum += gcd(gcd(a, b), c);
            }
        }
    }
    return sum;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    
    cout << solve0(n) << "\n";
    
    return 0;
}

// scanf("%d %d", &a, &b)
// printf("%d %d", 123, 456);

// getline(cin, s)
// while (cin >> x) {...} - read unknown data


Measured memory_bytes: 3612
/**
*    author:  Dooloper
*    created: 12.05.2020 15:45:57
**/

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>


using namespace std;
typedef unsigned long long ll;

int main() {
    cin.tie(0);
    int A,B,C,K;
    cin>>A>>B>>C>>K;
    int cnt = 0;
    int card = K;
    cnt += min(card,A)*1;
    card -= min(card,A);
    card -= min(card,B);
    cnt += min(card,C)*(-1);
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);
const int limit = 200010;

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    cout << min(c, b / a) << endl;
    return 0;
}

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

using namespace std;

// 多次元 mul_array<int, 1, 2, 3> a
template <typename T, std::size_t... Ns>
struct index_reverse_for_array;
template <typename T, std::size_t N, std::size_t... Ns>
struct index_reverse_for_array<T, N, Ns...> { using type = std::array< typename index_reverse_for_array<T, Ns...>::type, N>; };
template <typename T, std::size_t N>
struct index_reverse_for_array<T, N> { using type = std::array<T, N>; };
template <class T, std::size_t... Ns> using mul_array = typename index_reverse_for_array<T, Ns...>::type;

using u32 = uint32_t;
using s32 = uint32_t;
using u64 = uint64_t;
using s64 = uint64_t;

int main() {
    //cout << fixed << setprecision(10);

    int n;
    cin >> n;
    priority_queue<int> d;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (d.size() <= ((n / 2)))
            d.push(a);
        else if (d.top() > a) {
            d.pop();
            d.push(a);
        }
    }

    int a = d.top();
    d.pop();
    int b = d.top();
    if (a == b)
        cout << 0 << endl;
    else
        cout << max(a, b) - min(a, b) << endl;

    return 0;
}





Measured memory_bytes: 640
#include <iostream>
#include <string>
#define llint long long

using namespace std;

llint n;
string s[105];

int main(void)
{
	while(1){
		cin >> n;
		if(n == 0) break;
		
		for(int i = 1; i <= n; i++) cin >> s[i];
		
		llint ans = 0;
		for(int i = 1; i+1 <= n; i++){
			if(s[i][1] != s[i+1][1]) continue;
			if(s[i][0] == s[i+1][0]) continue;
			ans++;
		}
		cout << ans << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3092
use proconio::input;

fn main() {
    input! { n: usize }
    let mut a = vec![0; n];
    let mut ac = vec![0; 1000_000 + 1];
    let mut ma = 0;
    for i in 0..n {
        input! { ai: usize }
        a[i] = ai;
        ac[ai] += 1;
        ma = ma.max(ai);
    }

    let mut pc = true;
    for i in 2..=ma {
        let mut c = 0;
        for j in (0..=ma).skip(i).step_by(i) {
            c += ac[j];
        }
        if c > 1 {
            pc = false;
            break;
        }
    }

    println!("{} coprime", if pc {
        "pairwise"
    } else {
        let mut v = a[0];
        for i in 1..n {
            v = num_integer::gcd(v, a[i]);
        }
        if v == 1 {
            "setwise"
        } else {
            "not"
        }
    });
}


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

int N, M;

int main()
{
	scanf("%d %d", &N, &M);

	int l, r, s, e; int cnt = 0;
	int ok = 1;
	for(int i = 0; i < M; i++)
	{
		scanf("%d %d", &l, &r);
		cnt++;
		if(cnt == 1) { s = l; e = r; }
		else
		{
			if(r < s) { printf("0\n"); ok = 0; break; }
			else if(l < s && r >= s && r <= e) e=r;
			else if(l >= s && r <= e) { s=l; e=r; }
			else if(l >=s && l <= e && r > e) s=l;
			else if(l > e) { printf("0\n"); ok = 0; break; }
		}
	}

	if(ok) printf("%d\n", e-s+1);
}

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

int main() {
    long A,B;
    cin >> A >> B;
    
    if (A==B) {
        cout << B << endl;
    } else if (A+1==B) {
        cout << long(A^B) << endl;
    } else {
      	if (A%2==0) {
              //A^(A+1)=1,(A+2)^(A+3)=1, ...
              //1^1=0,0^1=1
              if (B%2==0) {
                  if (((B-A)/2)%2==1) {
                      cout << long(1^B) << endl;
                  } else {
                      cout << long(0^B) << endl;
                  }
              }else{
                  if (((B-A+1)/2)%2==1) {
                    cout << 1 << endl;
                  } else {
                      cout << 0 << endl;
                  } 
              }
        } else {
              //(A+1)^(A+2)=1,(A+3)^(A+4)=1, ...
              //1^1=0,0^1=1
          	if (B%2==0) {
                  if (((B-1-A)/2)%2==1) {
                    cout << long(A^1^B) << endl;
                  } else {
                    cout << long(A^0^B) << endl;
                  }
              }else{
                  if (((B-A)/2)%2==1) {
                      cout << long(A^1) << endl;
                  } else {
                      cout << long(A^0) << endl;
                  }
              }
        }
    }
    return 0;
}


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

int main() {
    string S, T;
    int i, count = 0;
    cin >> S >> T;

    for (i = 0; i < S.length(); i++) {
        if (S[i] == T[i]) {
            continue;
        } else {
            count++;
        }
    }

    cout << count << endl;
}

Measured memory_bytes: 3856
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
using ll = long long;
int constexpr N = 2005, MOD = 1e9 + 7;
int c[N][N];

int C(int n, int k) {
    if(!(k >= 0 && k <= n))
        return 0;
    return c[n][k];
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    for(int i = 0; i < N; ++i) {
        c[i][0] = 1;
        c[i][i] = 1;
    }
    for(int i = 1; i < N; ++i) {
        for(int j = 1; j < i; ++j) {
            c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
            if(c[i][j] >= MOD)
                c[i][j] -= MOD;
        }
    }

    int n, k;
    cin >> n >> k;
    n -= k;
    for(int i = 1; i <= k; ++i) {
        int m = n - (i - 1);
        int ans = 1ll * C(m + i, i) * C(k - 1, i - 1) % MOD;
        cout << ans << '\n';
    }

}

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

int main(){
    int N,K;
    cin >> N >> K;
    vector<int> h(N);
    for(int i = 0; i < N; i++)
    {
        cin >> h[i];
    }
    sort(h.begin(),h.end());

    int min = 1000000000;
    for(int i = 0; i < N-K+1; i++)
    {
        if(h[i+K-1]-h[i]<min) min = h[i+K-1]-h[i];
    }
    
    cout << min << endl;
}

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

int main() {
  int h, w; cin >> h >> w;
  char pictures[h + 2][w + 2];
  
  for (int i = 0; i < h + 2; ++i) {
    for (int j = 0; j < w + 2; ++j) {
      if (i == 0 || i == h + 1 || j == 0 || j == w + 1) {
        pictures[i][j] = '#';
        continue;
      }
      cin >> pictures[i][j];
    }
  }
  
  for (int i = 0; i < h + 2; ++i) {
    for (int j = 0; j < w + 2; ++j) {
      cout << pictures[i][j];
    }
    cout << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
    int ops, kval;
    int sum = 1;
    scanf("%d", &ops);
    scanf("%d", &kval);
    for (int i = 0; i < ops; i++) {
        if (sum < kval) {
            sum *= 2;
        } else {
            sum += kval;
        }
    }
    printf("%d", sum);
}

Measured memory_bytes: 1720
//４つの数字を+-を使って7にする
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int x = scan.nextInt();

        int[] a = new int[4];
        int[] b = new int[8];
        int N = 7;

        for (int i = 0; i < 4; i++) {
            a[3-i] = x%10;
            x = x/10;
        }

        b[0] = a[0]+a[1]+a[2]+a[3];
        b[1] = a[0]+a[1]+a[2]-a[3];
        b[2] = a[0]+a[1]-a[2]+a[3];
        b[3] = a[0]+a[1]-a[2]-a[3];
        b[4] = a[0]-a[1]+a[2]+a[3];
        b[5] = a[0]-a[1]+a[2]-a[3];
        b[6] = a[0]-a[1]-a[2]-a[3];
        b[7] = a[0]-a[1]-a[2]+a[3];
        if(b[0] == N)
            System.out.println(a[0] + "+" + a[1] + "+" + a[2] + "+" + a[3] + "=" + N);
        else if(b[1] == N)
            System.out.println(a[0] + "+" + a[1] + "+" + a[2] + "-" + a[3] + "=" + N);
        else if(b[2] == N)
            System.out.println(a[0] + "+" + a[1] + "-" + a[2] + "+" + a[3] + "=" + N);
        else if(b[3] == N)
            System.out.println(a[0] + "+" + a[1] + "-" + a[2] + "-" + a[3] + "=" + N);
        else if(b[4] == N)
            System.out.println(a[0] + "-" + a[1] + "+" + a[2] + "+" + a[3] + "=" + N);
        else if(b[5] == N)
            System.out.println(a[0] + "-" + a[1] + "+" + a[2] + "-" + a[3] + "=" + N);
        else if(b[6] == N)
            System.out.println(a[0] + "-" + a[1] + "-" + a[2] + "-" + a[3] + "=" + N);
        else if(b[7] == N)
            System.out.println(a[0] + "-" + a[1] + "-" + a[2] + "+" + a[3] + "=" + N);

    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef pair<int, bool> ib;

#define FOR(a, b, c) for(int a = b; a < c; ++a)
#define RFOR(a, b, c) for(int a = b; a >= c; --a)
#define mp(a, b) make_pair(a, b)
#define all(v) v.begin(), v.end()

#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define vvi vector<vi>
#define vb vector<bool>
#define fst first
#define snd second
#define MAXN 100010
#define LOGMAXN 20
#define MAXM 44100
#define LOGMAXN 20
#define INF 1000000007
#define INFLL 1000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007LL

int n;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	int a, b;
	while(cin >> n)
	{
		bool can = false;
		FOR(i, 0, 10)
			FOR(j, 0, 10)
				if(i*j == n)
				{
					can = true;
					break;
				}
		printf("%s\n", can ? "Yes" : "No");
	}
	return 0;
}


Measured memory_bytes: 256
N, S = map(int, input().split())
mod = 998244353
A = list(map(int, input().split()))
dp1 = [[0]*(S+1) for _ in range(N+1)]
r = 0

for i in range(1, N+1):
    a = A[i-1]
    dp1[i][0] = 1
    for j in range(S+1):
        dp1[i][j] += dp1[i-1][j]
        if j == a:
            dp1[i][j] += 1
        if j-a >= 0:
            dp1[i][j] += dp1[i-1][j-a]
        dp1[i][j] %= mod
    r += dp1[i][S]
print(r%mod)


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

int  main(){
int a,b,c;
int flag = 0;
cin >> a>> b>> c;
for(int i=b;i<=c;i++){
  if(i%a==0){
    flag = 1;
    break;
  }
}
if(flag){
  cout << "OK" << endl;
}else{
  cout << "NG" << endl;
}
return 0;
}

Measured memory_bytes: 3624
N,T = map(int,input().split())
X = [list(map(int,input().split())) for n in range(T)]
M = N
m = 0

for a,b in X:
  M = min(M,b)
  m = max(m,a)
  
if M<m:
  print(0)
else:
  print(M-m+1)

Measured memory_bytes: 27036
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<vector>

using namespace std;

int main() {
	vector<long long> data;
	data.resize(3);
	cin >> data[0] >> data[1] >> data[2];
	unsigned long long ans;
	if (data[0] % 2 == 0 || data[1] % 2 == 0 || data[2] % 2 == 0) {
		cout << 0 << endl;
	}
	else {
		unsigned long long buf;
		sort(data.begin(), data.end());
		cout << data[0] * data[1] << endl;
 	}

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Codeforces
{
	internal class Template
	{
		private void Solve()
		{
			var n = cin.NextInt();
			var a = new int[n];
			for (var i = 0; i < n; i++)
			{
				a[i] = cin.NextInt();
			}
			var groups = a.GroupBy(x => x).ToDictionary(x => x.Key, x => x.Count());
			if (groups.Count > 2)
			{
				Console.WriteLine("No");
			}
			else if (groups.Count == 1)
			{
				var key = groups.Single().Key;
				if (n >= key*2 || key + 1 == n)
				{
					Console.WriteLine("Yes");
				}
				else
				{
					Console.WriteLine("No");
				}
			}
			else
			{
				var keys = groups.Select(x => x.Key).OrderBy(x => x).ToList();
				if (keys[1] - keys[0] > 1)
				{
					Console.WriteLine("No");
				}
				else
				{
					if (keys[1] >= n)
					{
						Console.WriteLine("No");
					}
					else if (groups[keys[0]] > keys[0])
					{
						Console.WriteLine("No");
					}
					else if (groups[keys[1]] < 2 * (keys[0] + 1 - groups[keys[0]]))
					{
						Console.WriteLine("No");
					}
					else
					{
						Console.WriteLine("Yes");
					}
				}
			}
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
			new Template().Solve();
			Console.ReadLine();
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}

Measured memory_bytes: 38064
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
	unsigned int x;
	cin >> x;
	
	vector<long long> p;
	
	for (int i = 0; i < 150; ++i) {
		p.push_back(pow(i, 5));
	}
	
	int a, b;
	bool ok = false;
	for (int i = 0; i < 150 && !ok; ++i) {
		for (int j = -150; j < 150 && !ok; ++j) {
			if (j < 0)
				ok = (p[i] + p[j * -1] == x);
			else
				ok = (p[i] - p[j] == x);
			
			if (ok) {
				a = i;
				b = j;
			}
		}
	}
	
	cout << a << " " << b << endl;
}

Measured memory_bytes: 4108
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll N,T,A,t,a;
	cin>>N;
	t=a=1;
	for(ll n=0;n<N;n++){
		cin>>T>>A;
		ll k=max((t+T-1)/T,(a+A-1)/A);
		t=k*T;
		a=k*A;
	}
	cout<<t+a<<endl;
	return 0;
} 

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();

		HashSet<Integer> hs = new HashSet<Integer>();
		boolean dist = true;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			if (hs.contains(x))
				dist = false;
			hs.add(x);
		}
		pw.println(dist ? "YES" : "NO");
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < arr.length; i++)
				arr[i] = nextInt();
			return arr;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


Measured memory_bytes: 57364
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = n;i >= m;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define ALL(n) n.begin(),n.end()

int main() {
	int a, b;
	cin >> a >> b;
	cout << max(a + b, max(a - b, a*b)) << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
li = []
for i in range(n):
  l = list(map(int,input().split()))
  for j in l[1:]:
    li.append(j)
ans = 0
for i in range(31):
  if li.count(i) == n:
    ans += 1
print(ans)

Measured memory_bytes: 3060
# @author 

import sys

class CRemainderMinimization2019:
    def solve(self):
        l, r = [int(_) for _ in input().split()]
        if r - l > 2019:
            print(0)
        else:
            ans = float('inf')
            for i in range(l, r + 1):
                for j in range(i + 1, r + 1):
                    ans = min(ans, (i * j) % 2019)
            
            print(ans)

solver = CRemainderMinimization2019()
input = sys.stdin.readline

solver.solve()


Measured memory_bytes: 40176
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define HUGE_NUM 2000000000000000000

struct Info{
	ll value;
	double P;
};

int N;
int POW[21];
ll M;
Info info[21];

ll gcd(ll a,ll b){

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

ll lcm(ll a,ll b) {
	if(a < b)swap(a,b);
    ll common = gcd(a,b);
    a /= common;
    if(a > HUGE_NUM/b) {
        return -1;
    }
    return a*b;
}

int main(){

	for(int i = 0; i < 21; i++)POW[i] = pow(2,i);

	scanf("%d %lld",&N,&M);

	for(int i = 0; i < N; i++){
		scanf("%lld",&info[i].value);
	}

	for(int i = 0; i < N; i++){
		scanf("%lf",&info[i].P);
		info[i].P /= 100.0;
	}

	double ans = 0,group_P;
	int member_num;
	ll common;
	vector<ll> G;

	for(int state = 1; state < POW[N]; state++){

		member_num = 0;
		group_P = 1.0;
		G.clear();

		for(int loop = 0; loop < N; loop++){
			if(state & (1 << loop)){

				group_P *= info[loop].P;
				member_num++;
				G.push_back(info[loop].value);
			}
		}

		common = 1;

		for(int i = 0; i < member_num; i++){

			common = lcm(common,G[i]);
			if(common == -1)break;
		}
		if(common == -1)continue;

		if(member_num%2 == 0){

			ans -= group_P*(M/common);

		}else{

			ans += group_P*(M/common);

		}
	}

	printf("%.10lf\n",ans);

	return 0;
}



Measured memory_bytes: 3432
#include <stdio.h>

#define ABS(X) (((X)>=0)?(X):(-(X)))

int main () {
	int x, a, b;
	scanf ("%d %d %d", &x, &a, &b);
	if (ABS(x-a)>ABS(x-b))
		printf ("B\n");
	else
		printf ("A\n");
	return 0;
}

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;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    string s;
    cin >> s;
    int n = s.size();
    int ans = 0;
    rep(i, n){
        for(int j = i; j < n; j++){
            bool flag = true;
            rep(k, j - i + 1){
                if (s[i + k] != 'A' && s[i + k] != 'T' && s[i + k] != 'G' && s[i + k] != 'C'){
                    flag = false;
                }
            }
            if (flag) ans = max(ans, j - i + 1);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;

#define MOD 998244353

int main(){
    ll n;
    cin >> n;
    if (n%2==1){
        cout << "No" << endl;
        return 0;
    }
    string s;
    cin >> s;
    for (ll i=0;i<s.size()/2;i++){
        if (s[i]!=s[i+n/2]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,sum=0,ans=0,x;scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",&x),sum+=x,ans-=x*x;
	printf("%d",(ans+sum*sum)/2);
	return 0;
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X=ST()
    stack = []
    for s in X:
        stack.append(s)
        if(stack[-2:]==["S","T"]):
            stack.pop();stack.pop()
    print(len(stack))
if __name__ == '__main__':
    main()

Measured memory_bytes: 7888
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// #define sfind(i) (*find_by_order(i))
// #define ord(i) order_of_key(i)
typedef long long ll;
typedef pair<int , int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
#define vi vector<int>
#define vl vector<ll>
#define _max(vec) (*max_element(all(vec)))
#define _min(vec) (*min_element(all(vec)))
#define fi first
#define si second
#define pb push_back
#define all(name) name.begin(), name.end()
#define ral(name) name.rbegin(), name.rend()
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod)
#define mod_in(a) power(a, mod - 2)
#define ncr(n, r) (n>=r?((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod):0LL)
#define deb(x) cerr << "[" << #x << " " << x << "]" << endl;
#define endl '\n'  //....????
// #define int ll
vector<ll> ft(1, 1LL);

/*======================================================================*/


void solve(){
    string s;
    cin >> s;
    int ans = 0;
    int i = 0;
    while(i < 3){
        int c = 0;
        while(i < 3 and s[i] == 'R')c++, i++;
        i++;
        ans = max(ans, c);
    }
    cout << ans << endl;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[4] = {1, -1, 0, 0};
ll d2[4] = {0, 0, 1, -1};

int main(){
    ll N, M;
    cin >> N >> M;
    priority_queue<ll, VL, greater<ll>> A;
    rep(i, 0, N){
        ll a; cin >> a;
        A.push(a);
    }
    VP bc(M);
    rep(i, 0, M) cin >> bc[i].second >> bc[i].first;
    sort(ALL(bc), greater<PL>());
    ll i = 0;
    while(true){
        auto q = A.top();
        //cerr << q << endl;
        if(i >= M) break;
        if(q >= bc[i].first) break;
        A.pop();
        A.push(bc[i].first);
        bc[i].second--;
        if(bc[i].second == 0) i++;
    }
    ll ans = 0;
    while(!A.empty()){
        auto t = A.top();
        ans += t;
        A.pop();
    }
    cout << ans <<  endl;
    return 0;
}

Measured memory_bytes: 2676
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int cnt_0 = 0;
  int cnt_1 = 0;
  rep(i,s.size()) {
    if(s[i]=='0')cnt_0++;
    else cnt_1++;
  }
  cout << 2*min(cnt_0,cnt_1) << endl;
}


Measured memory_bytes: 512
#include<iostream>
#include<string>

using namespace std;

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

Measured memory_bytes: 3632
macro_rules! debug {
    ( $x:ident [ $i:expr ] ) => {
        if cfg!(debug_assertions) {
            println!("{}[{}] = {}", stringify!($x), $i, $x[$i]);
        }
    };
    ( $x:ident [ $i:expr ][ $j:expr ] ) => {
        if cfg!(debug_assertions) {
            println!("{}[{}][{}] = {}", stringify!($x), $i, $j, $x[$i][$j]);
        }
    };
    ( $x:expr ) => {
        if cfg!(debug_assertions) {
            println!("{}:{} {} = {:?}", line!(), column!(), stringify!($x), $x);
        }
    };
}

fn main() {
    use std::cmp::max;
    let stdin = std::io::stdin();
    let mut stdin = my::io::InputReader::new(stdin.lock());
    let N:i32 = stdin.read();
    let H:i32 = stdin.read();
    let W:i32 = stdin.read();
    let result = max(N - H + 1, 0) * max(N - W + 1, 0);
    println!("{}", result);
}

mod my {
    pub mod io {
        use std::io::{BufRead, ErrorKind, Result};
        use std::str::{FromStr, from_utf8};
        use std::fmt::Debug;

        pub fn read_word<R: BufRead>(r: &mut R, buf: &mut Vec<u8>)
                                              -> Result<usize> {
            let mut read = 0;
            loop {
                let (done, used) = {
                    let available = match r.fill_buf() {
                        Ok(n) => n,
                        Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
                        Err(e) => return Err(e)
                    };
                    match available.iter().position(|&x| x == b'\n' || x == b' ') {
                        Some(i) => {
                            buf.extend_from_slice(&available[..i]);
                            (true, i + 1)
                        }
                        None => {
                            buf.extend_from_slice(available);
                            (false, available.len())
                        }
                    }
                };
                r.consume(used);
                read += used;
                if done || used == 0 {
                    return Ok(read);
                }
            }
        }

        pub struct InputReader<R: BufRead> {
            reader: R,
            buf: Vec<u8>,
        }

        impl<R: BufRead> InputReader<R> {
            pub fn new(reader: R) -> InputReader<R> {
                InputReader {
                    reader: reader,
                    buf: Vec::<u8>::new(),
                }
            }

            pub fn read_word(&mut self) {
                read_word(&mut self.reader, &mut self.buf);
            }
            
            pub fn read<T>(&mut self) -> T
                where T: FromStr,
                      T::Err: Debug
            {
                self.buf.clear();
                self.read_word();
                from_utf8(&self.buf).unwrap().trim().parse().unwrap()
            }
        }
    }
}

Measured memory_bytes: 4352
import collections, re, itertools, copy

S = input()
T = input()

# 文字リストとcollections.Counterを渡すと、同じ文字が存在するインデックスの集合を返す関数
def same_letter_index_set(A, cA):
    output = []
    for s in cA.keys():
        match_index_list = [m.span() for m in re.finditer(s, A)]
        output.append(list(itertools.chain.from_iterable([m.span() for m in re.finditer(s, A)])))
    return output

# 2重リストを2つ与えると、それらの要素が一致しているかどうかを返す関数
def same_multi_list(A_input,B_input):
    A = copy.deepcopy(A_input)
    B = copy.deepcopy(B_input)
    for i in A:
        try:
            B.remove(i)
        except:
            return False
    if len(B) == 0:
        return True
    else:
        return False

# それぞれの文字列において、同じ文字が存在するインデックスの集合を考える。それらが完全一致すれば置き換え可能
cS = collections.Counter(S)
cT = collections.Counter(T)
print("Yes" if same_multi_list(same_letter_index_set(S, cS), same_letter_index_set(T, cT)) else "No")

Measured memory_bytes: 61844
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


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


def main():
    N = II()
    tasks = []

    for i in range(N):
        task = LI()
        tasks.append([task[1], task[0]])
    tasks.sort()

    sum_time = 0

    for task in tasks:
        sum_time += task[1]
        if sum_time > task[0]:
            print("No")
            return

    print("Yes")


main()


Measured memory_bytes: 98952
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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


Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>
#include <cmath>

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

int main()
{
    double a, b, h, m, pi = 3.14159265359;

    std::cin >>
        a >> b >> h >> m;

    double ans = a * a + b * b - 2 * a * b * std::cos(pi * 11 / 360 * (h * 60 + m));

    std::cout
        << std::fixed
        << std::setprecision(12) << sqrt(ans) << std::endl;

    return 0;
}

Measured memory_bytes: 4256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n); for(long long i = 0;i < (n);i++)
using ll = long long;
using vl = vector<long long>;
using P = pair<long long,long long>;
const ll mod = 1000000007;

bool sq(ll x){
	bool ok = false;
	ll i = 0;
	while(i*i <= x){
		if(i*i == x){
			ok = true;
			break;
		}
		i++;
	}
	return ok;
}


int main(){
	ll n,d; cin >> n >> d;
	ll x[10][10];
	rep(i,n){
		rep(j,d)cin >> x[i][j];
	}
	ll ans = 0;
	rep(i,n){
		for(ll j = i+1;j<n;j++){
			ll l = 0;
			rep(k,d)l += (x[i][k] - x[j][k])*(x[i][k] - x[j][k]);
		if(sq(l))ans++;
	}
	}
	cout << ans << endl;
}

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

#define LL long long
#define RG register

using namespace std;
template<class T> T gi() {
	T x = 0; bool f = 0; char c = getchar();
	while (c != '-' && (c < '0' || c > '9')) c = getchar();
	if (c == '-') f = 1, c = getchar();
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f ? -x : x;
}
char c[] = {'R', 'Y', 'G', 'B'};
int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	int H = gi<int>(), W = gi<int>(), k = gi<int>();
	for (int i = 1; i <= H; i++, puts(""))
		for (int j = 1; j <= W; j++) {
			int x = i + j + 1000, y = i - j + 1000;
			printf("%c", c[((x / k) & 1) << 1 | ((y / k) & 1)]);
		}
	return 0;
}


Measured memory_bytes: 3632
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
using namespace std;

long long n;

long long gcd(long long x,long long y)
{
    if(y==0)
        return x;
    return gcd(y,x%y);
}

int main()
{
    scanf("%I64d",&n);
    for(long long i=1;i<=3500;i++)
        for(long long j=1;j<=3500;j++)
        {
            long long t1=(4*i*j)-n*(i+j);
            if(t1<0)
                continue;
            long long t2=i;
            long long t3=gcd(t1,t2);
            t1/=t3,t2/=t3;
            t2*=n;
            t3=gcd(t1,t2);
            t1/=t3,t2/=t3;
            t2*=j;
            t3=gcd(t1,t2);
            t1/=t3,t2/=t3;
            if(t1==1)
            {
                printf("%I64d %I64d %I64d\n",i,j,t2);
                return 0;
            }
        }
}


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

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string ans = "No";
  rep(i,26)rep(j,15) if(i*4+j*7==n) ans = "Yes";
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.*;

class Main {
    static char calc(String str, int index) {
        char answer = str.charAt(0);

        if (str.charAt(0) == '1') {
            int lastIndex = 0;
            int str_l = str.length();
            for (int i = 1; i < str_l; i++) {
                if (str.charAt(i) == '1') {
                    lastIndex = i;
                } else {
                    break;
                }
            }

            if (index - 1 <= lastIndex) {
                answer = '1';
            } else {
                answer = str.charAt(lastIndex + 1);
            }
        }

        return answer;
    }

    public static void main(String args[]) throws IOException {
        String S;
        int K;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        S = br.readLine();
        String k_s = br.readLine();
        K = k_s.length() > 3 ? 101 : Integer.parseInt(k_s);

        PrintWriter pw = new PrintWriter(System.out);
        pw.println(calc(S, K));
        pw.flush();
    }
}


Measured memory_bytes: 25044
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define MAX_N 300
class Dinic {
public:
  struct Edge { int to, cap, rev; };
  vector<Edge> G[MAX_N];
  int level[MAX_N], iter[MAX_N];

  void add_edge(int from, int to, int cap) {
    G[from].pb((Edge) { to, cap, (int)G[to].size() });
    G[to].pb((Edge) { from, 0, (int)G[from].size() - 1 });
  }

  void bfs(int s) {
    memset(level, -1, sizeof(level));
    queue<int> q;
    level[s] = 0;
    q.push(s);
    while (!q.empty()) {
      int x = q.front(); q.pop();
      for (int i=0; i<G[x].size(); i++) {
        Edge &e = G[x][i];
        if (e.cap > 0 && level[e.to] < 0) {
          level[e.to] = level[x] + 1;
          q.push(e.to);
        }
      }
    }
  }

  int dfs(int x, int t, int f) {
    if (x == t) return f;
    for (int &i=iter[x]; i<G[x].size(); i++) {
      Edge &e = G[x][i];
      if (e.cap > 0 && level[x] < level[e.to]) {
        int d = dfs(e.to, t, min(f, e.cap));
        if (d > 0) {
          e.cap -= d;
          G[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }

  int max_flow(int s, int t) {
    int flow = 0;
    while (true) {
      bfs(s);
      if (level[t] < 0) return flow;
      memset(iter, 0, sizeof(iter));
      int f;
      while (true) {
        f = dfs(s, t, INF);
        if (f <= 0) break;
        flow += f;
        if (flow >= INF) return INF;
      }
    }
  }
};

int N;
bool G[100][100];
int A[100];
bool dead[100], dead2[100];

int solve(int fix) {
  rep(i, N) dead2[i] = dead[i];
  if (fix != -1) rep(i, N) if (G[fix][i] || G[i][fix]) dead2[i] = true;
  int v = 0;
  Dinic dinic;
  int s = N+N, t = N+N+1;
  rep(i, N) {
    if (dead2[i]) continue;
    v++;
    rep(j, N) {
      if (!dead2[j] && i != j && G[i][j]) dinic.add_edge(i, j+N, 1);
    }
    dinic.add_edge(s, i, 1);
    dinic.add_edge(i+N, t, 1);
  }
  return v - dinic.max_flow(s, t);
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  rep(i, N) cin >> A[i];
  rep(i, N) rep(j, N) G[i][j] = A[j] % A[i] == 0;
  int m = solve(-1);
  vector<int> ans;
  rep(i, N) {
    if (!dead[i] && ans.size() + 1 + solve(i) == m) {
      ans.pb(i);
      rep(j, N) if (G[i][j] || G[j][i]) dead[j] = true;
    }
  }
  assert(m == ans.size());
  rep(i, m) cout << ans[i]+1 << (i+1==m?"\n":" ");
  return 0;
}

Measured memory_bytes: 3256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N, K;
 cin >> N >> K;
 vector<int> a(N);
  
  for(int i = 0; i < N; i++) cin >> a.at(i);
  
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  int ans = 0;
  
  for(int i = 0; i < K; i++) ans += a.at(i);
  
  cout << ans << endl;
 }

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


int main()
{
    string S,T;
    cin >> S >> T;
    int counter = 0;
    if(T.size() == S.size() + 1){
        for(int i = 0; i < S.size();i++){
            if(S.at(i) == T.at(i)){
                counter++;
            }
        }
        if(counter == S.size()){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }else{
        cout << "No" << endl;
    }

}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    ll N; cin >> N;
    // N--;
    string ans = "";
    while (N > 0) {
        // cout << "a + " << (int)(N % 26) << endl;;
        // ans += 'a' + N % 26;
        // N /= 26;
        ans += (char)('a' + (N - 1) % 26);
        N = (N - 1) / 26;
    }
    reverse(ALL(ans));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628