akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mp make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
using namespace std;
int n,m,num,ans;
vii e[50];
bool f[50];
void dfs(int x,int d){
	num++;
	f[x]=true;
	for(int i=0;i<e[x].size();i++){
		if(e[x][i].se!=d&&!f[e[x][i].fr])
		dfs(e[x][i].fr,d);
	}
}
int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		e[a].pb(mp(b,i));
		e[b].pb(mp(a,i));
	}
	for(int i=0;i<m;i++){
		num=0;
		zero(f);
		dfs(0,i);
		if(num!=n)
		ans++;
	}
	cout<<ans;
	re 0;
}


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

vector<vector<long long>> Factrization(long long X);


int main(){
    long long N, N_dash;
    long long pi;
    vector<vector<long long>> facts;
    long long ans = 0;
    std::cin >> N;

    for(long long i = 1; i <= N - 1; i++){
        pi = (long long)floor(((double)N-1.0)/(double)i);
        for(long long j = 1; j <= pi; j++){
            ans++;
        }        
    }

    std::cout << ans;
}

vector<vector<long long>> Factrization(long long X){
    vector<vector<long long>> factors = {};
    long long n_loop, a, b;

    n_loop = (long long)floor(sqrt((float)X));
    for(long long i =1; i <= n_loop; i++){
        if(X%i == 0){
            a = i;
            b = X/i;
            factors.push_back({a, b});
        }
    }
    return factors;
}

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl




typedef long long ll;
const ll mod = 1e9+7;
const int maxn = 1e6 + 5;
const int inf = 1e9;


int n;
int a[maxn];
int dp[maxn];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
    cin>>n;
    for (int i=0; i<n; i++) {
	cin>>a[i];
    }

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

    for (int i=1; i<n; i++) {
	if (i-1>=0) dp[i] = min(dp[i], abs(a[i]-a[i-1])+dp[i-1]);
	if (i-2>=0) dp[i] = min(dp[i], abs(a[i]-a[i-2])+dp[i-2]);
    }

    cout<<dp[n-1]<<endl;
    return 0;
}


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

using namespace std;

int main(){
	string s, t;
	int ss, st, min;
	cin >> s >> t;
	ss = s.size(), st = t.size(), min = st;
	for (int i = 0; i <= ss - st; i++){
		int tmp = 0;
		for (int j = 0; j < st && tmp < min; j++)
			if (s[i + j] != t[j]) 
				tmp += 1;
		if (tmp < min)
			min = tmp;
	}
	cout << min << '\n';
	return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <utility>
#define ff first
#define ss second

using namespace std;

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

    int n; cin >> n;
    pair<int, int> wrk[n]; for(auto &i : wrk) cin >> i.ss >> i.ff;
    sort(wrk, wrk + n);

    int tm = 0;
    for(int i = 0; i < n; ++i)
    {
        tm += wrk[i].ss;
        if(wrk[i].ff < tm) goto END;
    }

    cout << "Yes"; return 0;
END:
    cout << "No"; return 0;
}


Measured memory_bytes: 1792
// D - Line++
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int cnt[2000];

int main(){
	int N,X,Y; cin>>N>>X>>Y;
	X--,Y--;
	rp(i, 0, N){
		rp(j, i+1, N){
			int a = j-i;
			int b = abs(i-X) + abs(j-Y) + 1;
			int d = min({a, b}) - 1;
			cnt[d]++;
		}
	}
	rp(i, 0, N-1) cout<< cnt[i] <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

int main(){cout<<fixed<<setprecision(20);
		   int x;
           cin>>x;
           int ans=0;
           rep(i,1,x+1){
            rep(j,2,15){
             if(pow(i,j)<=x){
              chmax(ans,int(pow(i,j))); 
             }
              else break;      
            }
           }
                    cout<<ans<<endl;
}

Measured memory_bytes: 3968
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

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

fn main() {
    input! {
        n: usize,
        m: usize,
        ab: [(usize, usize); n],
    }
    let mut m = m;
    let mut ab = ab;
    ab.sort();
    let mut result = 0;
    for (ai, bi) in ab {
        let c = if bi > m { m } else { bi };
        m -= c;
        result += ai * c;
    }
    println!("{}", result);
}


Measured memory_bytes: 6396
#!/usr/bin/env python
import itertools
input_str = input()
A = input_str[0]
B = input_str[1]
C = input_str[2]
D = input_str[3]

ops = ['+', '-']
all_ops = list(itertools.product(A, ops, B, ops, C, ops, D))
for tmp in all_ops:
    result = eval(''.join(tmp))
    if result == 7:
        print(''.join(tmp) + "=7")
        break


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define pll pair<ll,ll>
#define vi vector < int >
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define s(x) scanf("%d",&x)
#define sll(x) scanf("%lld",&x)
#define pf(x) printf("%d\n",x)
#define pfl(x) printf("%lld\n",x)
#define flash ios_base::sync_with_stdio(false);cin.tie(0)
#define goog(x) cout << "Case #" << x << ": "
#define MAX5 200005
#define MAX6 2000005
#define MLOG 18
#define limit 1e18
#define mod 1000000007   
void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

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


int power(int x, int y, int p){
    int res = 1;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}


int dp[100][100];
void solve(){
    double n;
    cin >> n;
    double ans = (n/3)*(n/3)*(n/3);
    printf("%0.6lf", ans);
}

signed main(){  
//  freopen("ii.txt", "w", stdin);
    flash;
    int t = 1;
    // cin >> t;  
    for(int tc = 1; tc <= t; tc++){
    //goog(tc);
        solve();
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    int n;
    string s;
    cin >> n;
    
    if (n == 0) {
        cout << 0 << endl;
        return 0;
    }

    ll v = 1;
    while (n) {
        if (n % (2 * abs(v))) {
            s += '1';
            n -= v;
        } else {
            s += '0';
        }
        v *= -2;
    }
    
    reverse(ALL(s));
    cout << s << endl;
    
    return 0;
}

Measured memory_bytes: 256
H,W,K=map(int,input().split())
c=[str(input())for i in range(H)]
ans=0
for maskH in range(2**H):
    for maskW in range(2**W):
        black=0
        for i in range(H):
            for j in range(W):
                if ((maskH>>i)&1)==1:
                    continue
                if ((maskW>>j)&1)==1:
                    continue
                if c[i][j]=='#':
                    black+=1
        if black==K:
            ans+=1
print(ans)

Measured memory_bytes: 9156
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	string s; cin >> s;
	vi a(3);
	for (auto i : s) a[i - 'a']++;
	sort(ALL(a));
	if (a[2] - a[0] <= 1) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 512
while True:
  n, m = list(map(int, input().split()))
  if n==0:
    break

  a = [int(input()) for i in range(n)]
  b = [int(input()) for i in range(m)]
  sa = sum(a)
  sb = sum(b)
  a.sort()
  b.sort()

  ta, tb = 1e9, 1e9
  for i in range(n):
    for j in range(m):
      if (a[i]-b[j])*2==sa-sb:
        if ta+tb>a[i]+b[j]:
          ta, tb = a[i], b[j]

  if ta==1e9:
    print(-1)
  else:
    print(ta, tb)


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

int main() {
  
  int n;
  cin >> n;
  
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  
  sort(A.begin(), A.end());
  int K = A[n - 1];
  
  cout << K << " ";
  
  int a = -1, b = n - 2;
  
  while(b - a > 1) {
    int mid = (a + b) / 2;
    if (A[mid] > K/2) b = mid;
    else a = mid;
  }
  
  int r;
  
  if (A[b] - K/2 > K/2 - A[a]) r = A[a];
  else r = A[b];
  
  cout << r;
  
}

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

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

using namespace std;

int main()
{
    int n;
    while(cin >> n && n){

        int ans = 0;
        bool l = false,r = false,next = true;

        rep(i,n) {
            string s;
            cin >> s;

            if(s == "lu") {
                l = true;
                if(l && r && next) {
                    ans++;
                    next = false;
                }
            }
            else if(s == "ru") {
                r = true;
                if(l && r && next) {
                    ans++;
                    next = false;
                }
            }
            else if(s == "ld") {
                l = false;
                if(!l && !r && !next) {
                    ans++;
                    next = true;
                }
            }
            else if(s == "rd") {
                r = false;
                if(!l && !r && !next) {
                    ans++;
                    next = true;
                }
            }
        }

        cout << ans << endl;
    }

    return 0;
}

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

const int MAX = 100005;
const int MOD = 1000000007;

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

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

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

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    rep(i, N){
        cin >> A[i];
    }

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

    COMinit();

    long long ans = 0;
    rep(i, N){
        long long temp = COM(i, K - 1) - COM(N - i - 1, K - 1);
        if(temp < 0) temp += MOD;
        ans = (ans + temp * A[i]) % MOD;
        // cout << ans << endl;
    }

    if(ans < 0){
        ans += MOD;
    }
    cout << ans << endl;


}

Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
const int inf=1e5+5;
typedef long long ll;
string a,b,c;
int len1,len2;
int dp[inf];
int vis[inf];

int main()
{
    int n,k;
    cin>>n;
  cout<<3*n*n<<endl;
}


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

#define INF 100100100
#define MOD 1000000007

using namespace std;
using ll = long long;
using ull = unsigned long long ;
int main(int argc, char const* argv[]){
   ios::sync_with_stdio(false);
   cin.tie(0);

   int N;
   cin>>N;
   vector<int>A(N);
   for(int i=0;i<N;i++)cin>>A[i];

   bool flg;
   int sum=0;
   ull ans=0;
   for(int i=1;i<N;i++){
      if(A[i-1] == A[i])flg = true;
      else flg = false;
      if(flg){
         if(i==1)sum++;
         sum++;
         if(sum%2==0)ans++;
      }
      else{
         sum = 1;
      }
   }
   cout<<ans<<endl;
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  bool f = false;
  cin >> a >> b >> c;
  if (a==b && b==c && c==a) f = true;
  if (f) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

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

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

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll a,b;
	cin >> a >> b;
	if(a<b) cout << "a < b\n";
	else if(a>b) cout << "a > b\n";
	else cout << "a == b\n";
	return 0;
}


Measured memory_bytes: 3040
n, m = gets.split.map(&:to_i)

@edge = Array.new(n+1) {[]}
m.times do 
    a, b = gets.split.map(&:to_i)
    @edge[a] << b
    @edge[b] << a
end

@all = (1 << n + 1) - 2
@memo = 0

calc =->(now) {
    return 0 if @memo[now] == 1
    
    @memo |= 1 << now
    sum = 0
    @memo == @all ? sum = 1 : @edge[now].each {|e| sum += calc.(e)}
    @memo &= ~(1 << now)
    return sum
}

p calc.(1)

Measured memory_bytes: 14288
A,B = map(int,input().split())
c = 1
t = int(max(A,B)**0.5)

for i in range(2,t+2):
    k = 0
    while(A % i == 0 and B % i == 0):
        k = 1
        A = A//i
        B = B//i
    c += k

for i in range(2,int(A**0.5)+2):
    while(A % i == 0):
        A = A//i

for i in range(2,int(B**0.5)+2):
    while(B % i == 0):
        B = B//i

if A == B and A > t:
    c += 1

print(c)

Measured memory_bytes: 40300
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ATOrT solver = new ATOrT();
        solver.solve(1, in, out);
        out.close();
    }

    static class ATOrT {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            out.println(Math.min(a * n, b));
        }

    }
}



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

#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n+1);
    a[0] = 0;
    rep(i,1,n+1){
        cin >> a[i];
    }
    int cnt=0;
    int i=0;
    while(cnt != n+1){
        if(a[cnt] != i){
            a[cnt] = -1;
        }else{
            i++;
        }
        cnt++;
    }
    int ttt=0;
    rep(i,0,n+1){
        if(a[i] == -1) ttt++;
    }
    if(ttt == n){
        cout << -1 << endl;
    }else{
        cout << ttt << endl;
    }

}

Measured memory_bytes: 1024
void main()
{
    long n, x, y;
    rdVals(n, x, y);

    --x, --y;
    long[][] g = new long[][](n, n);
    foreach (i; 0 .. n-1)
    {
        foreach (j; i+1 .. n)
        {
            g[i][j] = g[j][i] = abs(i-j);
        }
    }

    g[x][y] = g[y][x] = 1;
    foreach (i; 0 .. n-1)
    {
        foreach (j; i+1 .. n)
        {
            g[i][j] = min(g[i][j], g[i][x]+g[x][y]+g[y][j]);
        }
    }

    long[] cnt = new long[n-1];
    foreach (i; 0 .. n-1)
    {
        foreach (j; i+1 .. n)
        {
            ++cnt[g[i][j]-1];
        }
    }

    foreach (c; cnt)
    {
        c.writeln;
    }
}

enum long mod = 10^^9 + 7;
enum long inf = 1L << 60;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;

Measured memory_bytes: 34300
#include<stdio.h>
#include <stdlib.h>



int main(){

	int i, j, P, Q, R;




	scanf("%d %d %d", &P, &Q, &R);

	if (P >= Q && P >= R){
		printf("%d\n", Q + R);
	}
	else if (Q >= P && Q >= R){
		printf("%d\n", P + R);
	}
	else if (R >= P && R >= Q){
		printf("%d\n", P + Q);
	}

	return 0;

}
    


Measured memory_bytes: 128
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

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

        int N = sc.nextInt();
        int[] A = new int[N];
        for (int i=0; i<N; i++) {
            A[i] = sc.nextInt();
        }

        System.out.println(solve2(N, A));
    }

    /**
     * https://www.hamayanhamayan.com/entry/2020/05/03/224417
     * @param N
     * @param A
     * @return
     */
    private static long solve2(int N, int[] A) {
        long count = 0;
        HashMap<Integer, Integer> map = new HashMap<>();

        // i+A[i] と i-A[i]を同時に更新・参照することで
        // i < j について i-A[i] == j+A[j] がチェックできる
        // (i > j のときは iがまだ未評価なので0となる
        for (int i=0; i<N; i++) {
            count += map.getOrDefault(i-A[i], 0);

            int val = map.getOrDefault(i+A[i], 0);
            map.put(i+A[i], val+1);
        }

        return count;
    }
}

Measured memory_bytes: 64112
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
//#define mod 1000000007
#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT {
	__INIT() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(15);
	}
}__init;


int main(void) {
	ll nana = 7;
	ll k,cnt = 1;
	cin >> k;
	rep(i, k+10) {
		if (nana%k == 0) break;
		nana = (nana * 10 + 7) % k;
		cnt++;
	}
	if (nana%k == 0) {
		cout << cnt << endl;
	}
	else {
		cout << -1 << endl;
	}
	return 0;
}


Measured memory_bytes: 3592
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

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


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

using namespace std;

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

  int cnt = 0;
	string a , b;
  cin >> a >> b;
  for(int i =0; i<a.size(); ++i) {
    if (a[i] != b[i]) cnt++;
  }
  cout << cnt;
}

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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

const string YES = "POSSIBLE";
const string NO = "IMPOSSIBLE";

int main(){
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    int mx = 0;
    rep(i, n) mx = max(mx, a[i]);
    if (k > mx) {
        cout << NO << endl;
        return 0;
    }
    rep(i, n) if (a[i] == k) {
        cout << YES << endl;
        return 0;
    }
    int s = a[0];
    rep1(i, n-1) s = gcd(s, a[i]);
    if (k%s==0) cout << YES << endl;
    else cout << NO << endl;
    return 0;
}


Measured memory_bytes: 3788
fn main() {
    let (n, w): (usize, usize) = (read::<usize>(), read::<usize>());
    let mut ww: Vec<usize> = vec![];
    let mut vv: Vec<usize> = vec![];
    for _ in 0..n {
        ww.push(read());
        vv.push(read());
    }
    // [そこまでの個数][そのときの価値]
    let mut dp: Vec<Vec<usize>> = vec![vec![std::usize::MAX / 2; 100001]; n + 1];
    dp[0][0] = 0;
    for i in 1..n + 1 {
        //　i-1を入れる入れない
        // jはval
        for j in 0..100001 {
            // 入れる
            if j + vv[i - 1] <= 100000 {
                dp[i][j + vv[i - 1]] = min(dp[i - 1][j] + ww[i - 1], dp[i][j + vv[i - 1]]);
            }
            //　入れない
            dp[i][j] = min(dp[i - 1][j], dp[i][j]);
        }
    }
    let mut ans = 0;
    for i in 0..100001 {
        if dp[n][i] <= w {
            ans = max(ans, i);
        }
    }
    println!("{}", ans);
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: isize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========


Measured memory_bytes: 106748
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
using namespace std;
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;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;

int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	
	int i,a[5],b[5],num;
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4];
	for(i=0;i<5;i++)b[i]=(10-a[i]%10)%10;
	int diff=0;
	for(i=0;i<5;i++){
		if(diff<b[i]){
			diff=max(diff,b[i]);
			num=i;
		}
	}
	ll ans=0;
	for(i=0;i<5;i++){
		if(i!=num){
			ans+=a[i];
			ans+=9;
			ans=ans/10*10;
		}
		else num=i;
	}
	ans+=a[num];
	fin(ans);
	
	
//////////////////////////////////////////////////////
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(void) {
	int A,B,C;
	cin >> A>>B>>C;
	if (B+C<=A) {
		cout << 0;
	}
	else {
		cout << C-(A-B);
	}
	return 0;
}

Measured memory_bytes: 256
/*
ID: barish21
LANG: C++14
TASK: test
*/

/****Author: Barish Namazov****/
#include <bits/stdc++.h>

using namespace std;

/***TEMPLATE***/
#define intt long long

#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

#define F first
#define S second
#define pb push_back

#define IO ios_base::sync_with_stdio(false);cin.tie();

const intt max1 = 11;
const intt max2 = 102;
const intt max3 = 1003;
const intt max4 = 10004;
const intt maxx = 100005;
const intt max6 = 1000006;
const intt max7 = 10000007;
const intt lg2 = 7;
const intt lg3 = 10;
const intt lg4 = 13;
const intt lg5 = 17;
const intt lg6 = 20;
const intt lg7 = 24;
const intt lg8 = 27;
const intt lg9 = 30;
const intt lg18 = 60;
const intt INF = 2LL * 1000000000;
/***************/

/***Additional Functions***/
intt powmod(intt a,intt b,intt mod){intt res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
intt gcd(intt a, intt b) { while(b) b ^= a ^= b ^= a %= b; return a;}
intt lcm(intt a,intt b){return a*b/gcd(a,b);}
intt is_prime(intt n){if(n==1)return 0;if(n==2)return 1;if(n%2==0)return 0;for(intt i=3;i<=sqrt(n);i+=2)if(n%i==0)return 0;return 1;}
intt is_integer(double n){if(floor(n)==ceil(n))return 1;return 0;}

intt sto_int(string s){stringstream ss(s);intt n;ss>>n;return n;}
string to_string(intt n){stringstream ss;ss<<n;string s=ss.str();return s;}
/**************************/

int main() {
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    IO;
    intt n;
    cin >> n;
    cout << "ABC" << n << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define nl '\n'
using namespace std;
using ll = long long;
using ld = long double;
/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- */



int main() {
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); srand(time(0));

  int n;
  cin >> n;
  int a[n+2];
  for(int i=1; i<=n; i++)
    cin >> a[i];
  a[0] = a[n+1] = 0;

  int d[n+2]; d[0] = 0;
  for(int i=1; i<=n + 1; i++) {
    d[i] = d[i-1] + abs(a[i-1] - a[i]);
  }

  for(int i=1; i<=n; i++) {
    cout << d[i-1] + d[n+1] - d[i+1] + abs(a[i-1] - a[i+1]) << nl;
  }

  return 0;
}

/* -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- -*- */


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

#define mp make_pair
#define pb push_back

using namespace std;

typedef int32_t i32;
typedef uint32_t u32;
typedef int64_t i64;
typedef uint64_t u64;
typedef pair<int,int> pii;
typedef vector<int> vi;

const int MAX_N = 200000;
int n;
int a[MAX_N];
int b[MAX_N];
int ma[MAX_N];
int mb[MAX_N];

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

  int r = 0;
  for (int i = 0; i < 29; i++) {
    int t = 1 << i;
    for (int j = 0; j < n; j++) {
      ma[j] = a[j] % (1 << (i+1));
      mb[j] = b[j] % (1 << (i+1));
    }
    sort(mb,mb+n);
    i64 c = 0;
    for (int j = 0; j < n; j++) {
      auto x = lower_bound(mb,mb+n,t-ma[j]);
      auto y = lower_bound(mb,mb+n,2*t-ma[j]);
      c += y - x;
      x = lower_bound(mb,mb+n,3*t-ma[j]);
      y = lower_bound(mb,mb+n,4*t-ma[j]);
      c += y - x;
    }
    if (c % 2 == 1) {
      r |= 1 << i;
    }
  }
  cout << r << endl;

  return 0;
}


Measured memory_bytes: 3328
use std::str::FromStr;
use std::io::*;
use utils::*;

pub fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(i.lock(), &mut o);
    stdout().write_all(&o).unwrap();
}

fn run<R: BufRead, W: Write>(i: R, o: &mut W) {
    let mut i = AtRead::from(i);
    let n = i.read::<usize>();
    let s = i.read::<usize>();

    let result = if let Some(r) = solve(n, s) {
        r.to_string()
    } else {
        "-1".to_string()
    };
    writeln!(o, "{}", result).unwrap();
}
fn solve(n: usize, s: usize) -> Option<usize> {
    fn f(b: usize, n: usize) -> usize {
        if n < b {
            n
        } else {
            n % b + f(b, n / b)
        }
    }
    let mut result = None;
    if n == s {
        result = Some(n + 1);
    }
    if n < s {
        return None;
    }

    let b_end = (n as f64).sqrt() as usize;

    for b in 2..b_end + 1 {
        if f(b, n) == s {
            return Some(b);
        }
    }

    for s1 in 1..s + 1 {
        let s0 = s - s1;
        let n1 = n - s0;
        let b = n1 / s1;
        if s1 >= b {
            break;
        }
        if n1 % s1 == 0 && s0 < b {
            result = Some(b);
        }
    }
    result
}

mod utils {
    use super::*;

    pub struct AtRead<R: BufRead> {
        r: R,
        s: String,
    }

    impl<R: BufRead> AtRead<R> {
        pub fn from(r: R) -> Self {
            AtRead {
                r: r,
                s: String::new(),
            }
        }
        pub fn read_line(&mut self) -> &str {
            self.s.clear();
            self.r.read_line(&mut self.s).unwrap();
            self.s.trim()
        }

        pub fn read<T: FromStr>(&mut self) -> T {
            self.read_line().parse().ok().unwrap()
        }
    }
}


Measured memory_bytes: 4352
fn solve(s: &[u8]) ->Option<(usize, usize)> {
    let n = s.len();
    for i in 0..n {
        if i + 1 < n && s[i] == s[i + 1] {
            return Some((i, i + 1));
        } else if i + 2 < n && s[i] == s[i + 2] {
            return Some((i, i + 2));
        }
    }
    None
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin = my::io::InputReader::new(stdin.lock());

    let s: String = stdin.read();
    let s = s.as_bytes();
    if let Some((a, b)) = solve(s) {
        println!("{} {}", a + 1, b + 1); // 1-based indexing
    } else {
        println!("-1 -1");
    }
}

#[allow(dead_code, unused_must_use)]
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 java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.stream.Collectors;
import java.util.stream.Stream;
 
public class Main {

  public static void main(String[] args) throws IOException {
    try ( BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ) {

      String[] lines = br.readLine().split(" ");
      int n = Integer.parseInt(lines[0]);
      int m = Integer.parseInt(lines[1]);
      int l = Integer.parseInt(lines[2]);
      long[][] mA = new long[n][m];
      long[][] mB = new long[m][l];
      long[][] mC = new long[n][l];

      for(int i = 0; i < n; i++ ) {
        lines = br.readLine().split(" ");
        mA[i] = Stream.of(lines)
                      .mapToLong(Long::parseLong)
                      .toArray();
      }
      for( int i = 0; i < m; i++ ) {
        lines = br.readLine().split(" ");
        mB[i] = Stream.of(lines)
                      .mapToLong(Long::parseLong)
                      .toArray();
      }

      for( int i = 0; i < n; i++ ) {
        for( int j = 0; j < l; j++ ){
          for( int k = 0; k < m; k++ )
          mC[i][j] += mA[i][k] * mB[k][j];
        }
      }

      System.out.println(
        Stream.of(mC)
              .parallel()
              .map( a -> ArrayToString(a) )
              .collect(Collectors.joining("\n"))
      );
    }
  }
  public static String ArrayToString(long[] a) {
      if (a == null)
          return "null";
      int iMax = a.length - 1;
      if (iMax == -1)
          return "[]";

      StringBuilder b = new StringBuilder();
      for (int i = 0; ; i++) {
          b.append(a[i]);
          if (i == iMax)
              return b.toString();
          b.append(" ");
      }
  }
}


Measured memory_bytes: 41556
#include<bits/stdc++.h>
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using namespace std;

int main(){
    int N;
    cin >> N;
    string B[12] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"};
    vector<string> ans;
    rep(i, N){
        if (i == 0) {
            ans.push_back("a");
        } else {
            int s = ans.size();
            rep(k, s) {
                string tmp = ans[k];
                ans[k] += B[0];
                int res = 0;
                for(int l = 0; l < ans[k].size(); l++) {
                    chmax(res, ans[k][l] - 'a');
                }
                REP(j,1, res+2) {
                    ans.push_back(tmp + B[j]);
                }
            }
        }

    }

    sort(ans.begin(), ans.end());
    for(auto s: ans) {
        cout << s << endl;
    }

}

Measured memory_bytes: 8692
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+:---test
3200
pink
---+/
/+---test
3199
pink
---+/

void main(string[] args) {
  const a = readln.chomp.to!long;
  const s = readln.chomp;

  (a >= 3200? s: "red").writeln;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define mx 400
#define pb push_back
ll mod = 1e9 + 7;
using namespace std;
ll arr[mx + 3];
ll dp[mx + 3][mx + 3];
ll inf = 1e18;
int main() {
	int n;
	cin >> n;

	for (int i = 1; i <= n; ++i)
		cin >> arr[i], arr[i] += arr[i - 1];

	for (int r = 1; r <= n; ++r)
		for (int l = r; l > 0; --l)
			if (l == r)
				dp[l][r] = 0;
			else {
				dp[l][r] = inf;
				for (int i = l; i < r; ++i)
					dp[l][r] = min(dp[l][r], dp[l][i] + dp[i + 1][r] + arr[r] - arr[l - 1]);
			}

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

Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
int a[100005],ans=0;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
for(int i=1;i<=n;i++)
{for(int j=i+1;j<=n;j++)
{ans+=a[i]*a[j];
}
}
cout<<ans<<endl;
	return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)

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


int n, a[2020];

int main(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	sort(a, a+n);
	
	i64 ans = 0;
	bool b[2020] = {0};
	for(int i = 0; i < n; i++){
		for(int j = i+1; j < n; j++){
			ans += lower_bound(a+j+1, a+n, a[i]+a[j]) - upper_bound(a+j+1, a+n, a[j] - a[i]);
		}
	}
	cout << ans << endl;
	
	return 0;
}

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

using namespace std;


int main(){
int a,b;
cin>>a>>b;
for(int i=1;i<=1001;i++){
    if((i*8)/100 == a && (i*10)/100==b){
        cout<<i; return 0;
    }
    
}

cout<<"-1";

  return 0;
}
 

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

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

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

    ll x;
    cin >> x;
    if (x <= 6)
    {
        cout << 1 << endl;
    }
    else
    {
        ll tmp = x % 11;
        if (tmp <= 6 && tmp >= 1)
        {
            cout << (x - tmp) / 11 * 2 + 1 << endl;
        }
        else if (tmp == 0)
        {
            cout << x * 2 / 11 << endl;
        }
        else
        {
            cout << (x - tmp) / 11 * 2 + 2 << endl;
        }
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int k = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int flag = 0;

		for(int i = a; i <= b; i++) {
			if(i % k == 0) {
				flag = 1;
				break;
			}
		}

		if(flag == 1) {
			System.out.println("OK");
		} else {
			System.out.println("NG");
		}

		sc.close();

	}

}


Measured memory_bytes: 35788
(n,s),a,b=$<.map{_1.split.map &:to_i}
b.reverse!
(z=0...n).map{|i|$*[v=a[i]]||=i;v!=b[i]||(s=v;n=i)}
s&&b=(t=[s])*(k=[$*[s],b[..n].count(s)].min)+(b-t)+t*=b.count(s)-k
puts z.any?{a[_1]==b[_1]}?:No:[:Yes,b]

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(T == 1){
			Console.WriteLine(K - 1);
			return;
		}
		int max = A.Max();
		int rest = K - max;
		Console.WriteLine(max - 1 > rest ? max - 1 - rest:0);
		
		
		
	}
	int K,T;
	int[] A;
	public Sol(){
		var d = ria();
		K = d[0]; T = d[1];
		A = ria();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main(){
    vector<int>v;
    int n;
    int a;
    for (int i = 0; i<9; i++){
        cin>>a;
        v.push_back(a);
    }
    cin>>n;
    set<int>s;
    for (int i = 0; i<n; i++){
        cin>>a;
        s.insert(a);
    }
    int b,c;
    for (int i = 0; i<9; i+=3){
        a = v[i];
        b = v[i+1];
        c = v[i+2];
        if (s.count(a) && s.count(b) && s.count(c)){
            cout<<"Yes";
            return 0;
        }
    }
    for (int i = 0; i<3; i++){
        a = v[i];
        b = v[i+3];
        c = v[i+6];
        if (s.count(a) && s.count(b) && s.count(c)){
            cout<<"Yes";
            return 0;
        }
    }
    a = v[0];
    b = v[4];
    c = v[8];
    if (s.count(a) && s.count(b) && s.count(c)){
        cout<<"Yes";
        return 0;
    }
    a = v[2];
    b = v[4];
    c = v[6];
    if (s.count(a) && s.count(b) && s.count(c)){
        cout<<"Yes";
        return 0;
    }
    cout<<"No";
    return 0;
}


Measured memory_bytes: 3628