akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
//	freopen("data.in", "r", stdin);
//	freopen("data.out", "w", stdout);
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	long long a, tmp;
	cin >> a;
	stringstream ss1, ss2;
	string s1, s2;
	ss1 << a;
	ss1 >> s1;
	long long res = (long long) s1.length();
	long long mx = -1;
	map<long long , bool>mp;
	for (long long i = 1;; i++) {
		tmp = a / i;
		if(mp[tmp])break;
		ss1.clear(), ss2.clear();
		s1.clear(), s2.clear();
		ss1 << tmp;
		ss1 >> s1;
		ss2 << i;
		ss2 >> s2;
		mx = max((long long) s1.length(), (long long) s2.length());
//		cout << i << ' ' << tmp << endl;
		if (res > mx && a % i == 0) {
			res = mx;
		}
		mp[tmp]=true;
//		else if(res != mx) break;
	}
	cout << res;
}



Measured memory_bytes: 7552
// lcmとかはg++ -std=c++17 default.cppみたいなかんじで
//vector<vector<ll>> piyo(tate,vector<ll> (yoko));

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1000000000
#define ll long long
#define ln cout<<endl;
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

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

    ll maxi=0,f=0,mini=INF,sum=0;
    string str1,str2;
    ll h,w;
    ll n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> c(n);
    rep(i,n) cin>>a[i];
    rep(i,n) cin>>b[i];
    for(ll i=1;i<=n;i++){
        c[i-1]=i;
       // cout<<c[i-1]<<" ";
    }
    do{
            f=1;
        rep(i,n){
            if(b[i]!=c[i]){
                f=0;
            }

        }
                    if(f==1){
                h=sum;
            }
        f=1;
        rep(i,n){
            if(a[i]!=c[i]){
                f=0;
            }

        }
                    if(f==1){
                w=sum;
            }
        sum++;
    }while (std::next_permutation(c.begin(), c.end()));

    cout<<abs(w-h);


    return 0;
}


Measured memory_bytes: 256
// Problem : C - Peaks
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

    
/*
CODED BY               
**************
DARSHAN JAIN
darshanjain31
**************
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define endl '\n'
#define MOD 1000000007
using namespace std;
vector<ll> v[100000];
int main()
{
	fast;
		ll n,k;
		cin>>n>>k;
		ll h[n+5];
		for(int i=1;i<=n;i++)
		{
			cin>>h[i];
		}
		
		while(k--)
		{
			ll x,y;
			cin>>x>>y;
			v[x].pb(y);
			v[y].pb(x);	
		}
		
		ll count=0;
		for(int i=1;i<=n;i++)
		{
			bool flag=true;
			for(int j=0;j<v[i].size();j++)
			{
				//cout<<h[i]<<"  "<<h[v[i][j]]<<endl;
				if(h[i]<=h[v[i][j]])
				{flag=false;break;}
			}		
			if(flag==true)
			count++;
		}
		cout<<count<<endl;
}






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

using namespace std;

int main() {
	
	int n; cin >> n;
	int d[n];
	for (int i = 0; i < n; i++) {cin >> d[i];}
	sort(d, d+n);
	cout << d[n/2] - d[n/2 - 1];
	return 0;
}

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

using namespace std;

int n;
long long a[100010];

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    long long last = a[0];

    vector<long long> h = { 0, 0 };

    int streak = 0;

    for (int i = 1; i < n; i++) {
        if (a[i] == last) {
            streak++;
            if (h.back() != a[i]) {
                h.push_back(a[i]);
            } else if (streak % 2 == 0) {
                h.push_back(a[i]);
            }
        } else {
            streak = 1;
        }
        last = a[i];
    }

    int size = h.size();
    cout << h[size - 1] * h[size - 2] << endl;
}


Measured memory_bytes: 1660
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int H = stdIn.nextInt();
			int W = stdIn.nextInt();
			if(H == 0 && W == 0)
				break;
			for (int i=0; i<H; i++) {
				for (int j=0; j<W; j++) {
					if (i==0 || i==H-1 || j==0 || j==W-1) {
						System.out.print("#");
					}else{
						System.out.print(".");
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 24668
using System;
class Program
{
    public static void Main()
    {
        char[] alp = "abcdefghijklmnopqrstuvwxyz".ToCharArray();
        char[] s = Console.ReadLine().ToCharArray();
        char[] t = Console.ReadLine().ToCharArray();
        Array.Sort(s);
        Array.Sort(t);
        Array.Reverse(t);
        bool f = false;
        for (int i = 0; i < s.Length; i++)
        {
            try
            {
                if (Array.IndexOf(alp, s[i]) < (Array.IndexOf(alp, t[i])))
                {
                    f = true;
                    break;
                }
                else if (Array.IndexOf(alp, s[i]) > (Array.IndexOf(alp, t[i])))
                {
                    break;
                }
                else if (Array.IndexOf(alp, s[i]) == (Array.IndexOf(alp, t[i])) && i == s.Length - 1 && s.Length < t.Length)
                {
                    f = true;
                    break;
                }
            }
            catch (IndexOutOfRangeException)
            {
                break;
            }
        }
        Console.WriteLine(f ? "Yes" : "No");
    }
}

Measured memory_bytes: 13396
// Template by [thunder_blade]
// IIIT ALLAHABAD
// includes :)

#include <bits/stdc++.h>
#include <ext/rope> 
using namespace __gnu_cxx;
using namespace std;
#define TEST  int test_case; cin>>test_case; while(test_case--)
#define all(v) (v).begin(),(v).end()
#define fi  first
#define se  second
#define pb push_back
#define mp make_pair
#define ll long long int
#define SPEED ios_base::sync_with_stdio(false);  cin.tie(0);  cout.tie(0);
#define pi(x) printf("%d\n",x)
#define pl(x) printf("%lld\n",x)
#define pf(x) printf("%f\n",x)
#define ps(x) printf("%s\n",x)
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define sf(x) scanf("%f",&x)
#define ss(x) scanf("%s",x)
#define pis(x) printf("%d ",x)
#define pls(x) printf("%lld ",x)
#define pfs(x) printf("%f ",x)
#define pss(x) printf("%s ",x)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007

const int INF = (int)1e8;
const int N = 500005;

int main()
{
    int a,b,c;
    si(a), si(b), si(c);
    int num = a*100 + b*10 +c;

    if(num%4 == 0){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s)
{
    return '"' + s + '"';
}

string to_string(const char *s)
{
    return to_string((string)s);
}

string to_string(bool b)
{
    return (b ? "true" : "false");
}

string to_string(vector<bool> v)
{
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v)
{
    string res = "";
    for (size_t i = 0; i < N; i++)
    {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v)
{
    bool first = true;
    string res = "{";
    for (const auto &x : v)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p)
{
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << to_string(H);
    debug_out(T...);
}

typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair
#define fst first
#define snd second
#define fr(i, a, b) for(int i=a; i<b; i++)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    char a; cin >> a; cout << char(a+1) << endl;
}


Measured memory_bytes: 256
A=[]
m=[[0,0,0],[0,0,0],[0,0,0]]

for i in range(3):
    A.append(list(map(int,input().split())))
N=int(input())
def add(n):
    for i in range(3):
        if n in A[i]:
            m[i][A[i].index(n)]=1

def check():
    for i in m:
        if i == [1,1,1]:
            return True
    for i in range(3):
        if m[0][i]+m[1][i]+m[2][i]==3:
            return True
    if m[0][0]+m[1][1]+m[2][2]==3:
        return True
    if m[2][0]+m[1][1]+m[0][2]==3:
        return True
    return False

for i in range(N):
    inp=int(input())
    add(inp)
    if check():
        print("Yes")
        exit()
print("No")

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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e13;
const int mod = 1e9+7;
#define ll long long

signed main() {
   int n,m;
   cin >> n>>m;
   vector<int> l(m);
   vector<int> r(m);
   int lll = 0;
   int rrr = n; 
   rep(i,m) {
       cin >> l[i] >>r[i];
       lll = max(l[i],lll);
       rrr = min(r[i],rrr);
   }
   //cout << rrr  << endl;
   int tmp = 0;
   int ans =max(tmp, rrr-lll+1); 
   cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4824
import java.util.Scanner;

public class Main
{
	public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long a = s.nextLong();
        long b = s.nextLong();
        long rep = a * (n/(a+b)) + (n%(a+b) > a ? a : n%(a+b));
        System.out.println(rep);
	}
}

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

int dp[5010][5010];

int main() {
    int N;
    string S;
    cin >> N >> S;

    int ans = 0;
    for (int i=N-1; i>=0; --i) {
        for (int j=N-1; j>i; --j) {
            if (S[i] == S[j]) dp[i][j] = max(dp[i][j], dp[i+1][j+1] + 1);
            ans = max(ans, min(dp[i][j], j-i));
        }
    }

    cout << ans << endl;
}


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

int Y, M, D;

int calc(int y, int m, int d) {
    int res = 0;
    for (int i = 1; i < y; i++) {
        if (i % 3 == 0) res += 10 * 20;
        else res += 5 * 20 + 5 * 19;
    }
    if (y % 3 == 0) {
        res += (m - 1) * 20;
    } else {
        for (int i = 1; i < m; i++) {
            if (i % 2 == 1) res += 20;
            else res += 19;
        }
    }
    res += d;
    return res;
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> Y >> M >> D;
        cout << calc(1000, 1, 1) - calc(Y, M, D) << endl;
    }
}


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

int main()
{

    int N;
    scanf("%d",&N);
    int T[N];
    int i;
    int j;
    int dai=0;
    int sum=0;
    for (i=0;i<N;i++)
    {
        scanf("%d",&T[i]);
    }
    for (i=0;i<N-1;i++)
    {
        for(j=i+1;j<N;j++)
        {
            dai = T[i]*T[j];
            sum+=dai;
            dai = 0;
        }
    }
    printf("%d",sum);
    return 0;
}


Measured memory_bytes: 1724
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(double x){
  printf("%.15f",x);
}
int N;
int V[50];
int main(){
  double res;
  int i;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<(N);Lj4PdHRW++){
      rd(V[Lj4PdHRW]);
    }
  }
  sort(V, V+N);
  res = V[0];
  for(i=(1);i<(N);i++){
    res = (res + V[i]) / 2;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190818-1

// --- original code ---
// int N, V[50];
// {
//   int i;
//   double res;
//   rd(N,V(N));
//   sort(V, V+N);
//   res = V[0];
//   rep(i,1,N) res = (res + V[i]) / 2;
//   wt(res);
// }


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
#define int ll
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef RUS_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1>
inline istream & operator >> (istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();



signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef RUS_HOME
    freopen("input", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}




void smain() {

    string s;
    cin>>s;
    cout<<s[0]<<s[1]<<s[2];



}

Measured memory_bytes: 3564
N, M = map(int, input().split())
MOD = 10**9 + 7
s = list(map(int, input().split()))
t = list(map(int, input().split()))

dp = [[0 for i in range(M+1)] for j in range(N+1)]
for j in range(M):
    dp[1][j + 1] = dp[1][j] + 1 if s[0] == t[j] else dp[1][j]

for i in range(N):
    dp[i + 1][1] = dp[i][1] + 1 if t[0] == s[i] else dp[i][1]

for i in range(1, N):
    for j in range(1, M):
        if s[i] == t[j]:
            dp[i + 1][j + 1] = (dp[i][j + 1] + dp[i + 1][j] + 1)%MOD
        else:
            dp[i + 1][j + 1] = (dp[i][j+1] + dp[i+1][j] - dp[i][j])%MOD
    
print((dp[N][M] + 1)%MOD)


Measured memory_bytes: 74716
#include<stdio.h>

int main(void){
    int a,b,c,d,e,f;
    scanf("%d%d%d",&a,&b,&c);
    if(a > b)   d = a,e = b,a = e,b = d;
    if(a > c)   d = a,e = b,f = c,a = f,b = d,c = e;
    if(b > c)   d = b,e = c,b = e,c = d;
    printf("%d %d %d\n",a,b,c);
    return 0;
}


Measured memory_bytes: 1988
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
for _ in range(min(K, 42)):
    B = [0]*N
    for i in range(N):
        left = max(0, i-A[i])
        right = min(N-1, i+A[i])
        B[left] += 1
        if right+1 <= N-1:
            B[right+1] -= 1
    for i in range(N-1):
        B[i+1] += B[i]
    A = B[:]
print(*A)

Measured memory_bytes: 170920
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

double dot(double x1, double y1, double x2, double y2){
    return (x1 * x2) + (y1 * y2);
}

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

    if(a > 0 && b > 0){
        println("Positive");
        stop;
    }

    if(a < 0 && b > 0){
        println("Zero");
        stop;
    }

    if(a < 0 && b < 0){
        int d = abs(a - b) + 1;

        if(d % 2 == 0){
            println("Positive");
        }else{
            println("Negative");
        }

        stop;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define RFOR(i, a, b) for(int i = a; i >= b; --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
const int INF = 1e9;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
int main() {
    int N;
    map<string, vector<int>> r;
    vector<pair<int, int>> t;
    cin >> N;
    vector<string> s(N);

    int p[N];
    REP(i, N) {
        string s_tmp;
        cin >> s_tmp >> p[i];
        s[i] = s_tmp;
        r[s_tmp].push_back(p[i]);
        t.push_back(make_pair(p[i], i));
    }
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    REP(i, s.size()) {
        sort(r[s[i]].rbegin(), r[s[i]].rend());
    }

    REP(i, s.size()) {
        REP(j, r[s[i]].size()) {
            REP(k, t.size()) {
                if(t[k].first == r[s[i]][j]) {
                    cout << t[k].second + 1 << endl;
                    break;
                }
            }
        }
    }
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int c = Integer.parseInt(sc.next());
    if(a == b){
      System.out.println(c);
    }
    if(b == c){
      System.out.println(a);
    }
    if(a == c){
      System.out.println(b);
    }
  }
}

Measured memory_bytes: 21972
n=int(input())
y=[]
for i in range(1,round(n**0.5)+1):
    if n%i==0:
        y.append(i)
        y.append(n//i)
ans=0
for i in y: 
    if i>1 and n//(i-1)==n%(i-1):
        ans+=(i-1)
print(ans)

Measured memory_bytes: 40172
#include<bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s)
{
    return '"' + s + '"';
}

string to_string(const char *s)
{
    return to_string((string)s);
}

string to_string(bool b)
{
    return (b ? "true" : "false");
}

string to_string(vector<bool> v)
{
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v)
{
    string res = "";
    for (size_t i = 0; i < N; i++)
    {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v)
{
    bool first = true;
    string res = "{";
    for (const auto &x : v)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p)
{
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << to_string(H);
    debug_out(T...);
}

typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair
#define fst first
#define snd second
#define fr(i, a, b) for(int i=a; i<b; i++)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
   int x, y, z; cin >> x >> y >> z;
  cout << z << " "  << x << " " << y << endl;
}



Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
ans = 0
k = True

while k:
	for i in range(len(A)):
		if A[i] % 2 == 1:
			k = False
			break

	if k:
		ans += 1
		for i in range(len(A)):
			A[i] = A[i] / 2

print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define chmax(x,y) x = max(x,y)

 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int> > VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;
typedef vector<LL> VL;
typedef vector<vector<long long>> VVLL;
typedef vector<set<int>> VSI;
const int MOD = 1e9+7;
const int INF = 1e9;
const LL LINF = 1e18;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}


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

    int k = 0;
    int ans = 0;
    bool flag = false;
    rep(i,3) {
        if(s[i] == 'R') {
            k++;
            continue;
        } else {
            ans = max(k,ans);
            k = 0;
        }
    }
    ans = max(ans,k);
    cout << ans << endl;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define poly vector<int>
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define mem(a) memset((a),0,sizeof(a))
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}

const int N=2010,M=100005,inf=2e9+5;
int nedge=1,son[N],nextt[M],ed[M],cost[M],dist[N],di[M];
bool vis[N];
int last[N],que[N],laedge[N];
bool spfa(int s,int t,int n){
    for (int i=1;i<=n;i++) {dist[i]=-inf;last[i]=laedge[i]=vis[i]=que[i-1]=0;}
    int tot=1,l=0,r=0; que[0]=s; vis[s]=true; dist[s]=0;
    while (tot) {
        int k=que[l];
        vis[k]=false;
        if (++l==n) l=0;
        tot--; 
        for(int i=son[k];i;i=nextt[i]){
            if(di[i]>0&&dist[ed[i]]<(ll)dist[k]+cost[i]){
                dist[ed[i]]=dist[k]+cost[i]; laedge[ed[i]]=i; last[ed[i]]=k;
                if(vis[ed[i]]==0) {
                    if(++r==n)r=0;
                    que[r]=ed[i]; tot++; vis[ed[i]]=true;
                }
            }
        }
    }
    return last[t]>0;
}
ll costflow(int s,int t,int n){
	ll sum=0,cost=0;
    while(spfa(s,t,n)){
        int mmin=inf; 
        for(int i=t;last[i];i=last[i]){mmin=min(mmin,di[laedge[i]]);}
        sum+=mmin; 
        cost+=(ll)dist[t]*mmin; 
        for(int i=t;last[i];i=last[i]){
            di[laedge[i]]-=mmin;
            di[laedge[i]^1]+=mmin;
        }
    }
    return cost;
}
inline void aedge(int a,int b,int c,int d){
    nextt[++nedge]=son[a]; son[a]=nedge; ed[nedge]=b; di[nedge]=c; cost[nedge]=d;
}
inline void ins(int a,int b,int c,int d){
    aedge(a,b,c,d); aedge(b,a,0,-d);
    //cout<<a<<" "<<b<<" "<<c<<" "<<d<<" fjzzq"<<endl;
}
const int X[4]={1,-1,1,-1},Y[4]={1,1,-1,-1};
int main(){
	int n=read(),s=2*n+5,t=2*n+6;
	For(i,1,n){
		int x=read(),y=read(),c=read();
		ins(s,i,c,0);
		For(j,0,3)ins(i,2*n+j+1,c,x*X[j]+y*Y[j]);
	}
	For(i,1,n){
		int x=read(),y=read(),c=read();
		ins(i+n,t,c,0);
		For(j,0,3)ins(2*n+j+1,i+n,c,-x*X[j]-y*Y[j]);
	}
	cout<<costflow(s,t,t)<<endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll dp[405][405];
int n;
vector<ll> a;
 
int main(){
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);cout.tie(NULL);
	cin>>n;
	a.resize(n); 
  	ll sum[n];
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
     	if(i>0) sum[i]=sum[i-1]+a[i];
     	else sum[i]=a[i];
	}
  	for(int i=n-1; i>=0; i--){
      for(int j=i; j<n; j++){
        if(i==j) dp[i][j]=0;
        else{
          ll s;
          dp[i][j]=1e18;
          if(i>0) s=sum[j]-sum[i-1];
          else s=sum[j];
          for(int k=i; k<j; k++){
            dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+s);
          }
        }
      }
    }
  	cout<<dp[0][n-1]<<endl;
  	
	return 0;
}

Measured memory_bytes: 1536
from itertools import*
n=int(input())
a=[[s for s in input().split()]for _ in range(n)]
for k in range(n):
 b=a[k];b[3],b[4]=b[4],b[3]
def f():
 for d,e in combinations(a,2):
  for p in([0,1,2,3,4,5],[1,5,2,0,4,3],[2,1,5,3,0,4],[3,0,2,5,4,1],[4,1,0,3,5,2],[5,1,4,3,2,0]):
   f=[d[k]for k in p]
   if f[0]==e[0]and f[5]==e[5]:
    f=f[1:5]*2
    for k in range(4):
     if f[k:k+4]==e[1:5]:return'No'
 return'Yes'
print(f())


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

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

void test_case() {
  int n, t;
  cin >> n >> t;
  vector<int> T(n + 1), C(n + 1);
  int best = INT_MAX;
  for (int i = 1; i <= n; ++i) {
    cin >> C[i] >> T[i];
    if (T[i] <= t) {
      best = min(best, C[i]);
    }
  }
  if (best == INT_MAX) {
    cout << "TLE\n";
  } else {
    cout << best << "\n";
  }
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  test_case();
  return 0;
}


Measured memory_bytes: 256
require 'prime'

ps = Prime.take_while {|q| q <= 1_000_000 }
loop do
  n = gets.to_i
  break if n.zero?
  p n.times.map {
    p, m = gets.split.map(&:to_i)
    a, b = p - m, p + m + 1
    ((0...ps.size).bsearch {|i| ps[i] >= b } || ps.size) - ((0...ps.size).bsearch {|i| ps[i] >= a } || ps.size) - 1
  }.inject 0, :+
end

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

using namespace std;
using ll = long long;
using ld = long double;
using p = pair<int, int>;
using Graph = vector<vector<int>>;
#define rep(i,n)  for(int i = 0; i < n ; i++)
int dx[4]{ -1,0,1,0 };
int dy[4]{ 0,1,0,-1 };

vector<ll> enumDivorsor(ll n) {
	vector<ll> res;
	for (ll i = 1; i*i <= n; i++)
	{
		if (n % i != 0) { continue; }
		res.push_back(i);
		if (i * i != n) { res.push_back(n / i); }
	}
  return res;
}
int main()
{
	ll n;
	cin >> n;
	int ans = 0;
	for  (ll x : enumDivorsor(n))
	{
		if (x == 1) { continue; }
		ll tmp = n;
		while (tmp %x == 0)
		{
			tmp /= x;
		}
		tmp %= x;
		if (tmp == 1) { ans++; }
	}
	ans += enumDivorsor(n - 1).size() - 1;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << setprecision(9);

	string S;
	cin >> S;
	vector<int> c[26];
	for(int i=0; i<26; i++) c[i].push_back(-1);
	for(int i=0; i<S.size(); i++){
		c[S[i]-'a'].push_back(i);
	}
	int m = INT_MAX;
	for(int i=0; i<26; i++){
		c[i].push_back(S.size());
		int tmp = 0;
		for(int j=1; j<c[i].size(); j++){
			tmp = max(tmp, c[i][j]-c[i][j-1]);

		}
		m = min(m, tmp);
	}
	cout << m-1 << endl;

	return 0;
}


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

int countDigit(long long int n) 
{ 
    return floor(log10(n) + 1); 
} 
int main(){
    long long int t;
    cin>>t;
int count=0;
for(int i=1;i<=t;i++){
    if(countDigit(i)%2==1){
        count++;
    }
}
cout<<count<<endl;

}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <numeric>
#include <string>
#include <cassert>

using namespace std;

int main() {
  int N, L;
  cin >> N >> L;
  vector<int> A(N);
  int total = 0;
  for (int i = 0; i < N; ++i) {
    A[i] = L + (i + 1) - 1;
    total += A[i];
  }
  int minv = abs(A[0]);
  int mini = 0;
  for (int i = 0; i < N; ++i) {
    if (abs(A[i]) < minv) {
      minv = abs(A[i]);
      mini = i;
    }
  }
  cout << total - A[mini] << endl;
  return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func contain7(n int) bool {
	return strings.Contains(strconv.Itoa(n), "7")
}

func main() {

	var n int
	_, err := fmt.Scan(&n)

	if err != nil {
		fmt.Println(err)
	}

	if contain7(n) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 1820
#include<stdio.h>
int a[10000000],n;
 
int binarysearch(int key)
{
    int left=0;
    int right=n;
    int mid;
    while(left<right)
    {
        mid=(left+right)/2;
        if(key==a[mid]) return 1;
        else if(key<a[mid]) right=mid;
        else left=mid+1;
    }
    return 0;
}
int main()
{
    int i,q,k,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    scanf("%d",&q);
    for(i=0;i<q;i++)
    {
        scanf("%d",&k);
        if(binarysearch(k)) sum++;
    }
    printf("%d\n",sum);
    return 0;
}




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

int main()
{
    ll ans = 0;
    ll x = 0;
    cin >> x;
    ans += (x / 500) * 1000;
    x = x % 500;
    if (x != 0)
    {
        ans += (x / 5) * 5;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
//AOJ 0100
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
using namespace std;
#define MAX_N 100
 
unsigned long long int a[4001] = {0}, b, i, j, k, ans, n;
char str[1000];
 
int sort(const void *a, const void *b){
  return *(int*)a - *(int*)b;
}
 
int main(){
  while(scanf("%lld", &n) != 0){
    if(n == 0) return 0;
    ans = 0;
    for(i = 0; i < 4001; i++)
      a[i] = 0;
    for(i = 0; i < n; i++){
      scanf("%lld %lld %lld", &b, &k, &j);
      if(a[b] >= 1000000) continue;
      a[b] += k * j;
      if(a[b] >= 1000000){
    printf("%lld\n", b);
    ans++;
      }
    }
    if(ans == 0) printf("NA\n");
  }
  return 0;
}

Measured memory_bytes: 2616
#include <iostream>
#include <vector>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define ll long long

const int N = 1e5+11;
int n, k, a[N], res, d[N], p[N], bio[N];
vector <int> ls[N];
set <pair <int, int> > s;

void dfs (int x, int mama, int dubina) {
	p[x] = mama;
	d[x] = dubina;
	if (ls[x].size() == 1) {
		s.insert(mp(-dubina, x));
	}
	for (int i=0;i<ls[x].size();i++) {
		if (ls[x][i] == mama) continue;
		dfs (ls[x][i], x, dubina+1);
	}
}

void gore (int x, int kol) {
	if (bio[x]) return;
	bio[x] = 1;
	if (kol == 0) {
		s.insert(mp(-d[p[x]], p[x]));
		res++;
		return;
	}
	gore (p[x], kol-1);
}

int main() {
	cin >> n >> k;
	for (int i=0;i<n;i++) {
		scanf ("%d", &a[i]);
		a[i]--;
		if (i != 0) {
			ls[i].pb(a[i]);
			ls[a[i]].pb(i);
		}
	}
	if (a[0] != 0) res++;
	dfs (0, 0, 0);
	while (!s.empty()) {
		int x = s.begin()->ss;
		int depth = -s.begin()->ff;
		if (depth <= k) break;
		gore(x, k-1);
		s.erase(s.begin());
	}
	cout << res;
	return 0;
}

Measured memory_bytes: 15104
#include<bits/stdc++.h>
#define int long long
#define LL long long
#define clr(x,i) memset(x,i,sizeof(x))
using namespace std;
const int N=1005,INF=1e9;
inline void read(int &d)
{
    d=0;char ch=getchar();
    while(ch<'0'||ch>'9')ch=getchar();
    while(ch>='0'&&ch<='9'){d=d*10+ch-'0';ch=getchar();}
}
struct Edge{
    int to,nex,cap;
}edge[N<<3];
int n,m,head[N],tot,s,t,a[N];
queue<int> que;
inline void Add(int u,int v,int c)
{
    edge[++tot].to=v;edge[tot].nex=head[u];edge[tot].cap=c;head[u]=tot;
    edge[++tot].to=u;edge[tot].nex=head[v];edge[tot].cap=0;head[v]=tot;
}
int dist[N],cur[N];
int dfs(int u,int maxf)
{
    if(u==t||!maxf)return maxf;
    int ret=0;
    for(int &i=cur[u];i;i=edge[i].nex)
    {
//      cur[u]=i;
        int v=edge[i].to,cap=edge[i].cap;
        if(dist[v]==dist[u]+1&&cap>0){
            int flow=dfs(v,min(maxf-ret,cap));
            edge[i].cap-=flow;
            edge[i^1].cap+=flow;
            ret+=flow;
			if(ret==maxf) break;
        }
    }
//  if(!cur[u]) cur[u]=head[u];
    if(!ret) dist[u]=-1;
    return ret;
}
bool bfs()
{
    clr(dist,60);dist[s]=0;que.push(s);
    while(!que.empty())
    {
        int u=que.front();que.pop();
        for(int i=head[u];i;i=edge[i].nex)
        {
            int v=edge[i].to,cap=edge[i].cap;
            if(dist[v]>INF&&cap>0){
                dist[v]=dist[u]+1;
                que.push(v);
            }
        }
    }
    return dist[t]<INF;
}
int dinic()
{
    int ret=0,flow;
    while(bfs()){
        for(int i=s;i<=t;i++)cur[i]=head[i];
        while(flow=dfs(s,INF))
          ret+=flow;
    }
    return ret;
}
signed main()
{
	ios::sync_with_stdio(0);
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    s=0; t=n+1; tot=1;
    for(int i=1;i<=n;i++){
    	for(int j=i+1;j<=n;j++)
    	  if(j%i==0) Add(j,i,(LL)1e16);
    }
    LL sum=0;
    for(int i=1;i<=n;i++)
      if(a[i]>0) Add(s,i,a[i]),sum+=a[i];
        else Add(i,t,-a[i]);
    printf("%lld\n",sum-dinic());
    return 0;
}


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

int main() {
  int s;
  cin >> s;
  int mae = s/100;
  int ushiro = s%100;
  bool mb = false;
  bool ub = false;
  
  if (1 <= mae && mae <= 12){
    mb = true;
  }
  if (1 <= ushiro && ushiro <= 12){
    ub = true;
  }
  
  if (mb == true && ub == true){
    cout << "AMBIGUOUS" << endl;
  }
  if (mb == true && ub == false){
    cout << "MMYY" << endl;
  }
  if (mb == false && ub == true){
    cout << "YYMM" << endl;
  }
  if (mb == false && ub == false){
    cout << "NA" << endl;
  }

}


Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#define NOT_FOUND -1

int linearSearch(int);

int n,*S,q,*T;
int main(){
  int C=0,i,j,key;
  scanf("%d",&n);
  S=(int *)malloc(sizeof(int)*n);
  for(i=0;i<n;i++) scanf("%d",&S[i]);
  
  scanf("%d",&q);
  T=(int *)malloc(sizeof(int)*q);
  for(i=0;i<q;i++) scanf("%d",&T[i]);

  

  while(j!=q){
    key=T[j];
    if(linearSearch(key)!=NOT_FOUND) C++;
    j++;
  }
  
  printf("%d\n",C);
  return 0;
}

int linearSearch(int key){
  int i=0;
  S[n]=key;
  while(S[i]!=key){
    i++;
    if(i==n) return NOT_FOUND;
  }
  return i;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define PI acos(-1)
#define eq(x,y) (fabs((x)-(y)) < eps)
#define debug(x) cerr<<x<<endl;
#define endl "\n"
#define pb push_back
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
const int nmax=1e5+10;
const int eps=1e-8;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout.precision(10);
    //cout<<fixed;
    //cout.tie(NULL);
    int a;
    cin>>a;
    string s;
    cin>>s;

    if(a<3200)
        cout<<"red"<<endl;
    else
        cout<<s<<endl;

    return 0;
}


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

#define _p(...) (void)printf(__VA_ARGS__)
#define forr(x,arr) for(auto&& x:arr)
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) _rep3(i,0,n)
#define _rep3(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2,)(__VA_ARGS__)
#define _rrep2(i,n) _rrep3(i,0,n)
#define _rrep3(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2,)(__VA_ARGS__)
#define ALL(x) (x).begin(), (x).end()
#define BIT(n) (1LL<<(n))
#define SZ(x) ((int)(x).size())
#define fst first
#define snd second
typedef long long ll;
typedef vector<int> vi;typedef vector<vi> vvi;typedef pair<int,int> pii;typedef vector<pii> vpii;

ll N, S;

template <typename T> vector<T> divisors(T n) {
  vector<T> ret;
  for (T i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

bool check(ll b) {
  ll s = 0;
  ll n = N;
  while (n) {
    s += n % b;
    n /= b;
  }
  return s == S;
}

void Main() {
  scanf("%lld%lld", &N, &S);

  if (S == N) {
    _p("%lld\n", N+1);
    return;
  }

  int sqn = sqrt(N);

  // sqrt(N) までは全通り試す
  rep(b, 2, sqn+1) {
    if (check(b)) {
      _p("%d\n", b);
      return;
    }
  }

  ll ans = 1e18;

  auto ds = divisors(N-S);
  forr(p, ds) {
    ll b = (N-S)/p + 1;
    if (check(b)) {
      ans = min(ans, b);
    }
  }

  if (ans == 1e18) puts("-1");
  else _p("%lld\n", ans);
}
int main() { cin.tie(0); ios::sync_with_stdio(false); Main(); return 0; }


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
constexpr int MOD = 1e9+7, MX = 2e6+5;
int k, n, m;
char s[1000005];
ll e = 1, e2 = 1, iv[MX], ans;
ll exp(ll b, ll n){
	ll res = 1;
	for(; n; n/=2,(b*=b)%=MOD) if(n%2) (res *= b) %= MOD;
	return res;
}
int main(){
	scanf("%d\n%s", &k, s);
	n = strlen(s) + k;
	rep(i,n) (e *= i+1) %= MOD;
	iv[n] = exp(e, MOD-2);
	for(int i=n; i; i--) iv[i-1] = iv[i] * i % MOD;
	rep(i,k+1){
		ans += e * iv[n-i] % MOD * iv[i] % MOD * e2 % MOD;
		(e2 *= 25) %= MOD;
	}
	printf("%lld\n", ans % MOD);
}

Measured memory_bytes: 20368
n = int(input(""))
v = input("").split(" ")
for i in range(n):
    v[i] = int(v[i])
v.sort()
while len(v) != 1:
    new_value = (v[0] + v[1]) / 2
    v.append(new_value)
    v.remove(v[0])
    v.remove(v[0])
    v.sort()

print(v[0])

Measured memory_bytes: 3060
#素因数分解
def soinsu_bunkai(m):
    pf={}

    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:
        pf[m]=1
    return pf

# 組み合わせの総数 p=10**9+7 で割ったあまりを求める Satoooh Blog 2020/02/27 4分 
"""n<10**7 , p は素数"""
def cmb(n, r, p):

    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p



# 初期入力
from collections import Counter
import sys
input = sys.stdin.readline  #文字列では使わない
mod =10**9 +7
p =mod
N,M = map(int, input().split())
a =soinsu_bunkai(M)
ans =1

n = 10 **5 +100  # n は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

#mod p における n の逆元の計算
for i in range(2, n + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

for i in a.values():
    x =cmb(N +i -1,i,mod)
    ans *=x
print(ans %mod)

Measured memory_bytes: 21276
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Main {
    public long solve(int W, List<Integer> values, List<Integer> weights)  {
        int[] dp = new int[W + 1];
        for (int i = 1; i <= values.size(); ++i) {
            for (int j = W; j >= 0; --j) {
                int w = weights.get(i - 1);
                int v = values.get(i - 1);
                if (j - w >= 0) {
                    dp[j] = Math.max(dp[j], dp[j - w] + v);
                }
            }
        }
        return dp[W];
    }
 
    private static List<Integer> transform(int num) {
        List<Integer> ret = new ArrayList<>();
        int ele = 1;
        while (num - ele + 1 > 0) {
            ret.add(ele);
            ele = ele * 2;
        }
        int lst = ret.size() - 1;
        ret.set(lst, num - ret.get(lst) + 1);
        return ret;
    }
 
    private static final Pattern SPLIT = Pattern.compile("\\s");
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<Integer> weights = new ArrayList<>();
        List<Integer> values = new ArrayList<>();
        List<Integer> nums = new ArrayList<>();
        List<Integer> NW = Stream.of(SPLIT.split(scanner.nextLine())).map(Integer::valueOf)
                                 .collect(Collectors.toList());
        final int N = NW.get(0);
        final int W = NW.get(1);
        for (int i = 0; i < N; ++i) {
            List<Integer> collect = Stream.of(SPLIT.split(scanner.nextLine())).map(Integer::valueOf)
                                          .collect(Collectors.toList());
            values.add(collect.get(0));
            weights.add(collect.get(1));
            nums.add(collect.get(2));
        }
 
        {
            List<Integer> newWeights = new ArrayList<>();
            List<Integer> newValues = new ArrayList<>();
            List<List<Integer>> numsList = nums.stream().map(Main::transform).collect(Collectors.toList());
            for (int i = 0; i < numsList.size(); ++i) {
                int w = weights.get(i);
                int v = values.get(i);
                newWeights.addAll(numsList.get(i).stream().map(ele -> ele * w).collect(Collectors.toList()));
                newValues.addAll(numsList.get(i).stream().map(ele -> ele * v).collect(Collectors.toList()));
            }
            System.out.println(new Main().solve(W, newValues, newWeights));
        }
    }
}

Measured memory_bytes: 33572
import numpy as np

MOD=1000000007

n,k=map(int,input().split())
k=min(k,n-1)
fac=np.zeros((n+1)).astype(np.int64)
invfac=np.zeros((n+1)).astype(np.int64)
inv=np.zeros((n+1)).astype(np.int64)

invfac[0]=fac[0]=invfac[1]=fac[1]=inv[1]=1
for i in range(2,n+1):
    fac[i]=(fac[i-1]*i)%MOD
    inv[i]=(-inv[MOD%i]*(MOD//i))%MOD
    invfac[i]=(invfac[i-1]*inv[i])%MOD
def nCr(n,r):
    return ((fac[n]*invfac[r]%MOD)*invfac[n-r])%MOD
def nHr(n,r):
    return nCr(n+r-1,r)
    
print(np.sum(nCr(n,np.arange(k+1))*nHr(n-np.arange(k+1), np.arange(k+1))%MOD)%MOD)


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

using namespace std;

int main()
{
    vector<int> a(3);
    int k, ans = 0;
    for (int i = 0; i < 3; ++i) {
        cin >> a[i];
    }
    cin >> k;
    for (int i = 0; i < k; ++i) {
        auto it = max_element(a.begin(), a.end());
        *it *= 2;
    }

    for (auto n : a) ans += n;
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
static const ll maxLL = (ll)1 << 62;
const int mod=1000000007,INF=1001001001;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

//#define int ll

string t;
pair<char,char> pc[100010];
signed main(){
    cin>>t;
    if(t.size()==2 && t[0]==t[1]){
        cout<<1<<" "<<2<<endl;
        return 0;
    }
    pc[2]=pair<char,char>(t[0],t[1]);
    rep(i,2,t.size()){
        if(pc[i].fi==t[i]||pc[i].se==t[i]||pc[i].fi==pc[i].se){
            cout<<i-1<<" "<<i+1<<endl;
            return 0;
        }
        pc[i+1]=pair<char,char>(pc[i].se,t[i]);
    }
    cout<<"-1"<<" "<<"-1"<<endl;
    return 0;
}

Measured memory_bytes: 640