akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

ll x[1234],y[1234],u[1234],v[1234];

int main(void){
	int n,i,j,m=31;
	ll p,q;
	bool ev = false;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> x[i] >> y[i];
	}
	for(i=1; i<n; ++i){
		if(abs(x[i-1]+y[i-1])%2 != abs(x[i]+y[i])%2){
			cout << "-1" << endl;
			return 0;
		}
	}
	if(!((x[i-1]+y[i-1])%2)){
		ev = true;
	}
	for(i=0; i<n; ++i){
		u[i] = x[i]+y[i];
		v[i] = x[i]-y[i];
		if(ev){
			--u[i];
			--v[i];
		}
	}
	cout << (ev?(m+1):m) << endl;
	for(i=0; i<m; ++i){
		cout << ((i)?" ":"") << (1ll<<i);
	}
	if(ev){
		cout << " 1";
	}
	cout << endl;
	for(i=0; i<n; ++i){
		p = ((1ll<<31)-1-u[i])/2;
		q = ((1ll<<31)-1-v[i])/2;
		for(j=0; j<m; ++j){
			if((p&(1<<j)) && (q&(1<<j))){
				cout << "L";
			}else if(p&(1<<j)){
				cout << "D";
			}else if(q&(1<<j)){
				cout << "U";
			}else{
				cout << "R";
			}
		}
		if(ev){
			cout << "R";
		}
		cout << endl;
	}
	return 0;
}


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

int compare_int(const void*a,const void*b){
    return *(int*)a - *(int*)b;
}
int main() {
    int n; cin >> n;
    string a; cin >> a;

    int ans = 0;
    for (int i = 0; i <= n - 3; i++) {
        if (a.substr(i, 3) == "ABC") ans += 1;
    }
    cout << ans << endl;
}


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

int main()
{
    int n;
    int r[200000];
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> r[i];

    int rmin = r[0];
    int ans = -r[0];
    for (int i = 1; i < n; ++i)
    {
        int a = r[i] - rmin;
        if (ans < a)
            ans = a;
        if (r[i] < rmin)
            rmin = r[i];
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 3844
// D - Powerful Discount Tickets
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rp(i,n) for(int i=0;i<(n);i++)

int main(){
	int N,M; cin>>N>>M;

	vector<int> A(N);
	vector<pair<int,int>> B;
	for(int i=0; i<N; ++i){
		 cin>>A[i];
		for(int a=A[i]; a>0; a>>=1)
			B.push_back(make_pair(a, i));
	}

	sort(B.rbegin(), B.rend());

	vector<int> counting(N);
	rp(i, min(M, (int)B.size())) counting[B[i].second]++;

	ll ans = 0;
	rp(i,N) ans += (ll)A[i]/(1<<counting[i]);
	cout<< ans <<endl;
}

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

const int maxn = 3005, mod = 1e9+7;
int N, dp[maxn][maxn], sum[maxn][maxn];
string s;

int main(){
    cin>>N>>s;
    
    dp[1][1] =1;
    sum[1][1] = 1;
    for(int i = 2; i <= N; i++){
        for(int j = 1; j<= i; j++){
            if(s[i-2] == '<')
                (dp[i][j] = sum[i-1][j-1])%=mod;
            else 
                (dp[i][j] = 
                    sum[i-1][i-1] - sum[i-1][j-1]+mod)%=mod;
        }
        for(int j = 1;j<=i; j++)(sum[i][j] = sum[i][j-1] + dp[i][j])%=mod;
    }
    cout<<sum[N][N]<<endl;
    
    return 0;
}



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

int main(){
    int n, m, x, y, i, c = 0;
    cin >> n >> m;
    int a[n+1] = {}, b[n+1];
    a[1] = 1;
    for(i=1; i<=n; i++){
        b[i] = 1;
    }
    for(i=0; i<m; i++){
        cin >> x >> y;
        b[x]--;
        b[y]++;
        if(a[x] == 1){
            a[y] = 1;
        }
        if(b[x] == 0){
            a[x] = 0;
        }
    }
    for(i=1; i<=n; i++){
        if(a[i] == 1){
            c++;
        }
    }
    cout << c;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if(!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if(t & 1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

int main() {
  ll n;
  string s;
  cin >> n >> s;
  vl c(26, 0);
  rep(i, n) c[s[i] - 'a']++;
  mint ans = 1;
  rep(i, 26) ans *= (c[i] + 1);
  ans -= 1;
  cout << ans << endl;
}

Measured memory_bytes: 3760
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    deque<char> dq;
    cin >> s;
    for(auto &u : s)
        dq.push_back(u);
    
    int n, op, type;
    bool is_inv = false;
    char c;
    cin >> n;
    while(n--){
        cin >> op;
        if(op == 1){
            is_inv = !is_inv;
        } else {
            cin >> type >> c;
            if(type == 1){
                if(is_inv == false){
                    dq.push_front(c);
                } else {
                    dq.push_back(c);
                }
            } else {
                if(is_inv == true){
                    dq.push_front(c);
                } else {
                    dq.push_back(c);
                }
                
            }
        }
    }
    string ans = "";
    if(is_inv == true){
        while(!dq.empty()){
            ans += dq.back();
            dq.pop_back();
        }
    } else {
        while(!dq.empty()){
            ans += dq.front();
            dq.pop_front();
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 4252
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <assert.h>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,a) for(ll i=ll(a-1);i>=0;--i)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}

const ll INF = 1e18;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll MOD3 = 1e6;
const ll EPS = 1e-10;
int sgn(const double a){
    return (a < -EPS ? -1 : (a > EPS ? +1 : 0));
}
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> tri;
typedef pair<long double,long double> point;
typedef complex<long double> Point;
const ll MAX = 3000;
constexpr ll nx[4] = {-1,0,1,0};
constexpr ll ny[4] = {0,1,0,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k;
    cin >> n >> k;
    vector<P> ran(k);
    ll l,r;
    rep(i,k){
        cin >> l >> r;
        ran[i] = P(l,r+1);
    }
    vector<ll> dp(2*n+1,0),ans(n+1,0);
    ans[0] = 1;
    rep(i,n){
        ans[i] += dp[i];
        rep(j,k){
            tie(l,r) = ran[j];
            (dp[i+l] += ans[i])%=MOD2;
            (dp[i+r] += MOD2-ans[i])%=MOD2;
        }
        (dp[i+1] += dp[i]+MOD2)%=MOD2;
    }
    PRINT(ans[n-1]);
}


Measured memory_bytes: 7944
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <time.h>
#define int long long
using namespace std;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int mypow(int x, int y) {
	if (y == 0)return 1;
	if (y % 2)return mypow(x, y - 1)*x;
	else return mypow(x, y / 2)*mypow(x, y / 2);
}
/*ライブラリゾーン！！！！！！！！！！！！！！！*/
int h, w;
char s[55][55];
int a[4] = { 0,1,0,-1 };
int b[4] = { 1,0,-1,0 };
signed main(){
	cin >> h >> w;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			bool f = false;
			if (s[i][j] == '.')continue;
			for (int k = 0; k < 4; k++) {
				if (i + a[k] >= h || i + a[k] < 0 || j + b[k] >= w || j + b[k] < 0)continue;
				if (s[i + a[k]][j + b[k]] == '#')f = true;
			}
			if (!f) {
				cout << "No" << endl;
				system("PAUSE");
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	system("PAUSE");
	return 0;
}


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

int main(void)
{
  int N, K;

  scanf("%d %d", &N, &K);

  long long sum = 0;
  for (int i = K; i <= N + 1; i++)
  {
    sum += (i * ((long long)N - i + 1) + 1) % 1000000007;
    sum %= 1000000007;
  }
  printf("%lld", sum);

  return 0;
}


Measured memory_bytes: 1728
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
//#define MOD 1000000007
#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

class DisjointSet{
    public:
        vector<ll> rank,p,siz;

        DisjointSet(){}
        DisjointSet(ll size){
            rank.resize(size,0);
            p.resize(size,0);
            siz.resize(size,1);
            rep(i,size) makeSet(i);
        }

        void makeSet(ll x){
            p[x] = x;
            rank[x] = 0;
        }

        bool same(ll x, ll y){
            return root(x) == root(y);
        }

    
        void unite(ll x, ll y){
            x = root(x);
            y = root(y);
            if(rank[x] > rank[y]){
                siz[x] += siz[y];
                p[y] = x;
            }
            else{
                siz[y] += siz[x];
                p[x] = y;
                if(rank[x] == rank[y]) rank[y]++;
            } 
        }
        ll root(ll x){
            if(x != p[x]){
                p[x] = root(p[x]);
            }
            return p[x];
        }

        ll size(ll x){
            return siz[root(x)];
        }

};

int main(){
    int N,M; cin >> N >> M;
    vector<int> A(M),B(M);
    rep(i,M){
        cin >> A[i] >> B[i];
        A[i]--; B[i]--;
    }
    vector<ll> ans(M);
    ans[M-1] = (ll)N*(N-1)/2;
    DisjointSet uf(N);
    for(int i = M-1; i >= 1; i--){
        if(!uf.same(A[i],B[i])){
            ans[i-1] = ans[i]-(ll)uf.size(A[i])*uf.size(B[i]);
            uf.unite(A[i],B[i]);
        }
        else ans[i-1] = ans[i];
    }
    rep(i,M) cout << ans[i] << endl;

}

    



Measured memory_bytes: 5248
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
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);
        long n = in.nextLong();
        if (n<7){
            System.out.println(1);
        }
        else {
            long mul = (long)(n/11);
            long cur = 2 *mul;
            long value = mul*11;
            while (value<n){
                value+=6;
                cur++;
                if (value<n){
                    value+=5;
                    cur++;
                }

            }
            System.out.println(cur);
        }
    }
}


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

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int mx = 1000000;
    int k, x;
    cin >> k >> x;
    for(int i = max(-mx, x - k + 1); i <= min(mx, x + k - 1); ++i) {
        cout << i << ' ';
    }
}


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



int main() {
    int N;
    cin>>N;
    vector<int> d(N);
    rep(i,N){cin>>d.at(i);}
    int ans=0;
    for(int i=0;i<N;i++){
        for(int j=i+1;j<N;j++){
            ans+=d.at(i)*d.at(j);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES cout<<"YES"<<'\n'
#define NO cout<<"NO"<<'\n'
#define Yes cout<<"Yes"<<'\n'
#define No cout<<"No"<<'\n'
#define yes cout<<"yes"<<'\n'
#define no cout<<"no"<<'\n'
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
int ABS(int a) {if(a<0) a = -a; return a;}
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数の個数*/int divisor_number(int n){auto p = prime_factor(n); int res = 1; for(auto x:p)res*=(x.second+1); return res;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

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

    int a,b; cin >> a >> b;
    out((a+b)%24);

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;
template <class T>
ostream &operator<<(ostream &s, vector<T> vec) {
    for (int i = 0; i < (int)vec.size(); ++i) {
        if (i > 0) {
            s << ' ';
        }
        s << vec[i];
    }
    return s << endl;
}

int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    ll ans = 0;
    sort(A.begin(), A.end(), greater<ll>());

    // cerr << A;

    while (A[0] - A[N - 1] >= N) {
        ll n = (A[0] - A[N - 1]) / N;
        ans += n;
        A[0] -= n * N;
        for (int i = 1; i < N; i++) {
            A[i] += n;
        }
        sort(A.begin(), A.end(), greater<ll>());
    }

    // cerr << A;

    ll num = A[N - 1] - (N - 1);
    if (num > 0) {
        for (int i = 0; i < N; i++) {
            A[i] -= num;
        }
        ans += num * N;
    }

    //cerr << A;

    while (1) {
        sort(A.begin(), A.end(), greater<ll>());
        if (A[0] <= N - 1) break;
        A[0] -= N;
        for (int i = 1; i < N; i++) {
            A[i]++;
        }
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10**7)


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    q, = read_h()
    rng = read_v(q, m=2)

    MAX = 100000

    # Sieve of Eratosthenes
    is_prime = [True] * MAX
    is_prime[0], is_prime[1] = False, False
    for i in range(MAX):
        if not is_prime[i]:
            continue
        for j in range(i * 2, MAX, i):
            is_prime[j] = False

    # Find 2017-like numbers
    a = [0] * (MAX + 1)
    for i in range(MAX + 1):
        if i % 2 == 0:
            continue
        if is_prime[i] and is_prime[(i + 1) // 2]:
            a[i] = 1

    # Calc cumulative sum
    s = [0] * (MAX + 1)
    for i in range(MAX):
        s[i + 1] = s[i] + a[i]

    # Print answers
    for l, r in rng:
        print(s[r + 1] - s[l])


if __name__ == '__main__':
    main()


Measured memory_bytes: 32768
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

int main(void){
	ll n,k,ans,p,q;
	cin >> n >> k;
	if(k%2){
		ans = 1ll;
		ans *= (n/k);
		ans *= (n/k);
		ans *= (n/k);
	}else{
		p = (n/k);
		q = (n/(k/2))-p;
		ans = p*p*p+q*q*q;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T> using treap = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
  {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
  {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
  {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...)); }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
template <class T, class S> ostream& operator<<(ostream& s, unordered_map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
  #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
  #define dump(...)
  #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

signed main() {
  int n, l; cin >> n >> l;
  int sum = 0;
  int mi = 1e10;
  REP (i, n) {
    sum += l + i;
    if (abs(mi) > abs(l + i)) mi = l + i;
  }
  cout << sum - mi << endl;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <map>
#include <set>
#include <vector>
#include <string.h>
#include <cmath>
#include <climits>
#include <queue>

using namespace std ;

int n ;

int a[300010] ;

long long pre[300010] , suf[300010] ;

priority_queue < int > qPre , qSuf ;

int main(){
    #define NAME "B"
    //freopen( NAME".inp" , "r" , stdin ) ; freopen( NAME".out" , "w" , stdout ) ;

    scanf( "%d" , &n ) ;

    for( int i = 1 ; i <= 3 * n ; ++ i ) scanf( "%d" , &a[i] ) ;

    for( int i = 1 ; i <= n ; ++ i ) pre[n] += 1ll * a[i] , qPre.push( -a[i] ) ;

    for( int i = n + 1 ; i <= 2 * n ; ++ i ){
        pre[i] = pre[i - 1] ; int value = -qPre.top() ;
        if( value < a[i] ) qPre.pop() ;
        else continue ;
        qPre.push(-a[i]) ; pre[i] -= 1ll * value ; pre[i] += 1ll * a[i] ;
    }

    for( int i = 3 * n ; i >= 2 * n + 1 ; -- i ) suf[2 * n + 1] += 1ll * a[i] , qSuf.push( a[i] ) ;

    for( int i = 2 * n ; i >= n + 1 ; -- i ){
        suf[i] = suf[i + 1] ; int value = qSuf.top() ;
        if( value > a[i] ) qSuf.pop() ;
        else continue ;
        qSuf.push(a[i]) ; suf[i] -= 1ll * value ; suf[i] += 1ll * a[i] ;
    }

    long long ans = -(long long)(4e18) ;

    for( int i = n ; i <= 2 * n ; ++ i ) {
        ans = max( ans , pre[i] - suf[i + 1] ) ;
    }

    printf( "%lld" , ans ) ;

    return 0 ;
}


Measured memory_bytes: 5112
#include<iostream>
#include<string>
using namespace std;
string s;
int main() {
	cin >> s;
	int a = s.find("C");
	if (a == -1)cout << "No" << endl;
	else {
		if (s.find("F", a) == -1)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	return 0;
}

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

int main() {
  int n, count = 0;
  cin >> n;
  int p[n];
  for (int i=0; i<n; i++) cin >> p[i];
  for (int i=0; i<n-2; i++) {
    if (p[i] < p[i+1] && p[i+1] < p[i+2]) count++;
    if (p[i] > p[i+1] && p[i+1] > p[i+2]) count++;
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int extgcd(int a, int b, int& x, int &y) {
    if (b == 0) { x = 1; y = 0; return a; }
    else {
        int g = extgcd(b, a%b, y, x);
        y -= a / b * x;
        return g;
    }
}

int mod_inv(int a, int m) {
    int x, y;
    extgcd(a, m, x, y);
    return x;
}

long long fact[100002], facti[100002];
const int M = 1000000007;

int ch(int n, int k) {
    // cout << n << ' ' << k << endl;
    if (n < 0 || k < 0 || k > n) return 0;
    return fact[n] * facti[k] % M * facti[n-k] % M;
}

int main() {
    int n; cin >> n;
    int L, R;
    int a[n+1];
    fill(a, a+n+1, -1);
    for (int i = 0; i <= n; i++) {
        int x; cin >> x;
        if (a[x] >= 0) { L = a[x]; R = n-i; } else a[x] = i;
    }
    fact[0] = 1; facti[0] = 1;
    for (int i = 1; i <= n+1; i++) {
        fact[i] = (fact[i-1] * i) % M;
        facti[i] = mod_inv(fact[i], M);
    }
    for (int k = 1; k <= n+1; k++)
        cout << ((ch(n+1, k) - ch(L+R, k-1)) % M + M) % M  << endl;
}


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

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)

using namespace std;

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

ll n, m, r;

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> n >> m;

	if (n == 1 || m == 1) cout << 1 << endl;
	else cout << (n * m + 1) / 2;

	return 0;
}


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

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int sim(int n, string s, int k) {
  vector<bool> sel(n);
  sel[k] = true;
  int now = k;
  int left = (s[now] == '<' ? true : false);
  int cnt = 1;
  int l = k-1, r = k+1;
  while(1) {
    if(left) {
      now = l;
      l--;
    } else {
      now = r;
      r++;
    }
    if(now == -1 || now == n) break;
    cnt++;
    left = (s[now] == '<' ? true : false);
  }
  // cout << endl;
  return cnt;
}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);
  int n; cin >> n;
  string s; cin >> s;
  if(n == 1) {
    cout << 1 << endl;
    return 0;
  }

  int l = 0, r = 0;
  for(int i=0;i<n;++i) {
    if(s[i] == '>') break;
    l++;
  }
  for(int i=n-1;i>=0;--i) {
    if(s[i] == '<') break;
    r++;
  }
  cout << max(n - l,n - r) << endl;
}



Measured memory_bytes: 3336
import sys
readline = sys.stdin.readline

# N個のスイッチのon/offの組み合わせを全て探索し、すべて点灯するものをカウント

N,M = map(int,readline().split())
lights = [None] * M
for i in range(M):
  lights[i] = list(map(int,readline().split()))[1:]
  
P = list(map(int,readline().split()))

ans = 0
for i in range(2 ** N):
  for j in range(len(lights)):
    # 電球jが点灯するかチェック
    cnt = 0
    for k in range(len(lights[j])):
      # スイッチを一つ一つ確認
      # onになっているか？
      if (i >> lights[j][k] - 1) & 1:
        # onになっている
        cnt += 1
    if cnt % 2 != P[j]:
      break
  else:
    ans += 1

print(ans)

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

int main() {
  string S,T;
  char c;
  c='a';
    cin>>S>>T;
  for(int i=0;i<26;i++){
    if(T==S+c){
      cout<<"Yes"<<endl;
      return 0;
    }
    c++;
  }
    
  cout<<"No"<<endl;
}


Measured memory_bytes: 3600
import java.util.Scanner;

public class Main{ 
        public static void main(String[] args){
                int i,j = 0;
                double c=0,d=0;
                double e[] = new double[1000];
                Scanner num = new Scanner(System.in);
                double a = num.nextDouble();
                double b = num.nextDouble();
                if(a>b){
                    c = a%b;
                    d = b;
                }else if(a==b){
                    System.out.printf("%.0f\n",a);
                    System.exit(0);
                }else{
                    c = b%a;
                    d = a;
                }
                for(i=1;i<=c;i++){
                    if(c%i==0){
                        e[j]=i;
                        j++;
                    }
                }
                for(i=j-1;i>0;i--){
                    if(d%e[i] == 0){
                        double yaku = e[i];
                        break;
                    }
                }
                System.out.printf("%.0f\n",e[i]);
        }
    }


Measured memory_bytes: 28300
while True:
    m, f, r = [int(_) for _ in input().split()]
    if m == f == r == -1:
        exit(0)
    
    if m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65:
        print("B")
    elif m + f >= 50:
        print("C")
    elif m + f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")




Measured memory_bytes: 5604
import java.util.Scanner;

//Interest Rates
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			int n = sc.nextInt();
			if(n==0)break;
			int y = sc.nextInt(), res = 0;
			double max = -1;
			for(int i=0;i<n;i++){
				int b = sc.nextInt(), r = sc.nextInt(), t = sc.nextInt();
				double x;
				if(t==1)x = 1+y*r/100.;
				else x = Math.pow(1+r/100., y);
				if(max < x){
					max = x; res = b;
				}
			}
			System.out.println(res);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
# import numpy as np

# aとbの最大公約数
def GCD(a,b):
    # ユークリッドの互除法
    if b == 0:
        return a
    else:
        return GCD(b,a % b)



k = int(input())
sum = 0
count = [0] * k

for i in range(1, k + 1):
    for j in range(1, k + 1):
        count[GCD(i, j) - 1] += 1

# print(count)
for i in range(1, k + 1):
    for j, n in enumerate(count):
        sum = sum + GCD(i, j + 1) * n
print(sum)

Measured memory_bytes: 9232
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int a=sc.nextInt();
    int b=sc.nextInt();
    int c=sc.nextInt();
    System.out.println(Math.min(a+b,Math.min(b+c,c+a)));
  }
}

Measured memory_bytes: 21844
// 基本テンプレート

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, M;
int cnt[100010];
bool in[100010];

signed main() {
    cin >> N >> M;
    rep(i,0,N) cnt[i] = 1;
    in[0] = true;
    rep(i,0,M) {
        int x, y; cin >> x >> y;
        x--; y--;
        if(in[x]) in[y] |= true;
        cnt[x]--; cnt[y]++;
        if(cnt[x] == 0) in[x] = false;
    }

    int ans = 0;
    rep(i,0,N) ans += (int)(in[i]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <queue>
#include <string>
using namespace std;
  
class Task {
public:
  void input() {
    cin >> name >> time;
  }
  char name[10];
  int time;
};
  
int main() {
  int n, q;
  queue<Task> tasks;
  
  cin >> n >> q;
  for (int i=0; i<n; i++) {
    auto task = Task();
    task.input();
    tasks.push(task);
  }
  
  int time = 0;
  
  while (!tasks.empty()) {
    auto current = tasks.front(); tasks.pop();
    if (current.time > q) {
      time += q;
      current.time -= q;
      tasks.push(current);
    } else {
      time += current.time;
      cout << current.name << ' ' << time << endl;
    }
  }
}

Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;

    if (k <= (n - 1) * (n - 2) / 2) {
        int m = n - 1 + (n - 1) * (n - 2) / 2 - k;

        cout << m << endl;
        for (int i = 0, cnt = 0; i < n; i++) {
            for (int j = i + 1; cnt < m && j < n; cnt++, j++) {
                cout << i + 1 << " " << j + 1 << endl;
            }
        }
    } else {
        cout << "-1" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string s1, s2;

int main() {

  while (1) {
    int count = 0;
    int n1 = 0;
    int n2 = 0;
    int error = 0;

    cin >> s1;
    if(s1 == ".") break;
    cin >> s2;

    if(s1 == s2) {
      cout << "IDENTICAL" << endl;
      continue;
    }

    while(1) {
      if(s1[n1] == '"' && s2[n2] == '"') {
        n1++; n2++;
        count = 0;
        while(1) {
          if (s1[n1] == '"' && s2[n2] == '"') {
            if(count > 0) error++;
            break;
          }
          if (s1[n1] != s2[n2]) count++;
          if(s1[n1] != '"') n1++;
          if(s2[n2] != '"') n2++;
        }
      }
      else if(s1[n1] != s2[n2]) {
        cout << "DIFFERENT" << endl;
        break;
      }
      if(n1 != s1.size()) n1++;
      if(n2 != s2.size()) n2++;
      if(n1 == s1.size() && n2 == s2.size())  {
        if (error >= 2 ) {
          cout << "DIFFERENT" << endl;
          break;
        }
        else {
          cout << "CLOSE" << endl;
          break;
        }
      }
    }
  }

  return 0;
}



Measured memory_bytes: 3184
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define ALL(a)  (a).begin(),(a).end()
#define MOD 1000000007
int main(){
    int N; cin >> N;
    int A[N+1]; rep(i,N+1) cin >> A[i];
    int B[N]; rep(i,N) cin >> B[i];

    long long int sum = 0; int tmp = 0;
    rep(i,N){
        sum += A[i] - max(A[i]-B[i]-tmp,0);
        tmp = min(A[i+1], max(B[i]+tmp-A[i],0));
      	//cout << sum << " " << tmp << endl;
    }
  	sum += min(A[N],tmp);
    cout << sum;

}


Measured memory_bytes: 1024
import java.math.BigInteger;
import java.util.Scanner;
class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n=sc.nextInt();
		for(int i=0;i<n;i++) {
			BigInteger a=sc.nextBigInteger();
			BigInteger b=sc.nextBigInteger();
			if(a.add(b).compareTo(new BigInteger ("99999999999999999999999999999999999999999999999999999999999999999999999999999999"))==1)System.out.println("overflow");
			else System.out.println(a.add(b));
		}
	}
	}






Measured memory_bytes: 26548
#include <iostream>

int main()
{
	int n, m, count[30] = { 0 };
	std::cin >> n >> m;
	
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < m; ++j)
		{
			char c;
			std::cin >> c;
			++count[c - 'a'];
		}
	}
	
	int g4 = 0, g2 = 0, g1 = 0;
	if (n % 2 == 1 && m % 2 == 1)
	{
		g1 = 1;
		g2 = n / 2 + m / 2;
	}
	else if (n % 2 == 1)
	{
		g2 = m / 2;
	}
	else if (m % 2 == 1)
	{
		g2 = n / 2;
	}
	
	g4 = (n / 2) * (m / 2);
	for (int i = 0; i < 26; ++i)
	{
		while (count[i] >= 4 && g4 >= 1)
		{
			count[i] -= 4;
			--g4;
		}
	}
	
	for (int i = 0; i < 26; ++i)
	{
		while (count[i] >= 2 && g2 >= 1)
		{
			count[i] -= 2;
			--g2;
		}
	}
	
	for (int i = 0; i < 26; ++i)
	{
		while (count[i] >= 1 && g1 >= 1)
		{
			--count[i];
			--g1;
		}
	}
	
	if (g4 == 0 && g2 == 0 && g1 == 0)
	{
		std::cout << "Yes";
	}
	else
	{
		std::cout << "No";
	}
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  private static final int INF = 1_000_000_005;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int W = sc.nextInt();
    int[] w = new int[N];
    int[] v = new int[N];
    for (int i = 0; i < N; i++) {
      w[i] = sc.nextInt();
      v[i] = sc.nextInt();
    }
    
    int vmax = 100001;
    int[][] dp = new int[N+1][vmax];
    for (int i = 0; i < N+1; i++) {
      for (int j = 0; j < vmax; j++) {
        dp[i][j] = INF;
      }
    }
    dp[0][0] = 0;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < vmax; j++) {
        if (dp[i][j]+w[i] <= W) {
          dp[i+1][j+v[i]] = Math.min(dp[i+1][j+v[i]], dp[i][j]+w[i]);
        }
        dp[i+1][j] = Math.min(dp[i+1][j], dp[i][j]);
      }
    }
    
    long ans = 0;
    for (int j = 0; j < vmax; j++) {
      if (dp[N][j] != INF) {
        ans = Math.max(ans, j);
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 83228
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    N,X,M = LI()

    d = [0] * (M+1)
    t = [0] * (M+1)

    aa = X
    i = 0
    s = 0
    while d[aa] == 0:
        i += 1
        d[aa] = i
        s += aa
        t[i] = s
        aa = (aa * aa) % M

    ans = 0
    if N <= i:
        ans = t[N]

    else:
        m = i - d[aa] + 1
        r = d[aa] - 1 + ((N - (d[aa]-1)) % m)

        ans = t[r]
        ans += (t[i] - t[d[aa]-1]) * ((N-(d[aa]-1)) // m)


    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 70436
#include <cassert>
//PXjUXeZStdX
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
// #include <boost/foreach.hpp>
// #include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
//#define INF 1e9
#define LINF (1LL<<40)
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};
typedef pair<int,int> P;

const long long MOD=1000000007LL;
bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)||islower(c));}
template<typename T> 
void print(vector<T> v){
    for(int i=0;i<v.size();i++){
        if(i)cout<<" ";
        cout<<v[i];
    }
    cout<<endl;
}
int INF=1e18;

template<typename T>
void printendl(vector<T> v){
    for(auto date:v)cout<<date<<endl;
}

template<typename T>
void printvv(vector<vector<T>> v){
    for(int i=0;i<v.size();i++){
        for(int j=0;j<v[i].size();j++){
            if(j)cout<<" ";
            cout<<v[i][j];
        }
        cout<<endl;
    }
}
int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    else return gcd(b,a%b);
}

struct Edge{
    int to,cost;
};

struct S{
    int time,money;
};

signed main (){
    int a;
    string s;
    cin>>a>>s;
    if(a>=3200)cout<<s<<endl;
    else cout<<"red"<<endl;
    


    
    
    
    
    


}
/*

*/



Measured memory_bytes: 888
#include <stdio.h>
int main(){
  int n,max = 0,cnt,j,ans = 1;
  scanf("%d",&n);
  for(int i = 1;i <= n;i++){
    cnt = 0;
    j = i;
    while(j % 2 < 1){
      cnt++;
      j /= 2;
    }
    if(max < cnt){
      max = cnt;
      ans = i;
    }
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int a = reader.nextInt();
        int b = reader.nextInt();
        if (a%2==1 && b%2==1) System.out.println("Odd");
        else System.out.println("Even");
    }

    // Read Class
    static class FS {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
    
        private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public int nextInt() {
            return (int)nextLong();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if(b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
    }
}



Measured memory_bytes: 23124
#include <cstdio>
	#include <iostream>
	using namespace std;
	#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
	#define rep(x,to) rep2(x,0,to)
	int n, a[105], b[105];

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

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

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	int counts = 0;
	rep(i,n){
		if(a[i]%2 == 1) counts++;
	}
	if(counts%2 == 0) cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 3784
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
const int maxn=30;
typedef struct
{
    int left;
    int right;
}Node ;
Node node[maxn];
int p[maxn];
int n;
void pre_order(int v)
{
    if(v==-1) return;
   printf(" %d",v);
   pre_order(node[v].left);
   pre_order(node[v].right);

}
void in_order(int v)
{
     if(v==-1) return;

   in_order(node[v].left);
    printf(" %d",v);
   in_order(node[v].right);
}
void post_order(int v)
{
 if(v==-1) return;

   post_order(node[v].left);
   post_order(node[v].right);
    printf(" %d",v);
}
int main()
{
//    freopen("in.txt","r",stdin);
    scanf("%d",&n);
    int id,left,right;
    for(int i=0;i<n;i++)
    {
        node[i].left=-1;
        node[i].right=-1;
        p[i]=-1;
    }
    for(int i=0;i<n;i++)
    {
        scanf("%d%d%d",&id,&left,&right);
        node[id].left=left;
        node[id].right=right;
        p[left]=id;
        p[right]=id;
    }
    int root=0;
    for(int i=0;i<n;i++)
    {
        if(p[i]==-1)
        {
            root=i;
            break;
        }
    }
    printf("Preorder\n");
    pre_order(root);
    printf("\n");
     printf("Inorder\n");
     in_order(root);
     printf("\n");
     printf("Postorder\n");
    post_order(root);
    printf("\n");
    return 0;
}

Measured memory_bytes: 3224
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		double x1 = sc.nextDouble();
		double y1 = sc.nextDouble();
		double x2 = sc.nextDouble();
		double y2 = sc.nextDouble();
		
		double ans = Math.sqrt((Math.pow((x2 - x1),2) +  Math.pow((y2 - y1),2)) );
		
		System.out.println(String.format("%.8f", ans));

		sc.close();
	}

}



Measured memory_bytes: 27952
#include<stdio.h>
int main() {
	int a = 0, b=0, c=0, cnt = 0;
		scanf("%d %d %d",&a,&b,&c);
		for (int i = a; i <= b; i++)
		{
			if (c%i == 0) cnt++;
		}
		printf("%d\n", cnt);
	return 0;
}

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

#ifndef DEBUG
#define DEBUG false
#endif

#define REP(t,i,a,b) for(t i = a; i < b; ++i)

typedef long long ll;

using std::cin;
using std::cout;
using std::endl;
using std::vector;

int main (void) {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << n*n*n << endl; 
    return 0;
}



Measured memory_bytes: 256