akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FOR(i,a,b)  for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n)    FOR(i,0,n)
#define RER(i,n)    FOR(i,0,(n+1))
#define pb          push_back
#define mp(a,b)     make_pair((a),(b))
#define mset(m,v)   memset(m,v,sizeof(m))
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
typedef vector<pair<ll, ll> > vpll;
typedef vector<string> vs;
typedef long double ld;
const double EPS    = 1e-10;
const int INF       = 1e+9;
const double PI     = acos(-1);


auto main() -> int
{
    int a, b, c, x;
    cin >> a >> b >> c >> x;

    int sum = 0;
    REP(i, a + 1) {
        REP(j, b + 1) {
            REP(k, c + 1) {
                if ( i * 500 + j * 100 + k * 50 == x ) {
                    ++sum;
                }
            }
        }
    }

    cout << sum << endl;

    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
using namespace std;

const int MAX_V = 1005;
const int MAXN = 105;
const long long INF_LL = (long long)1e16;

int w[MAXN];
int v[MAXN];
long long dp[MAXN * MAX_V];

int main(void) {
    int n, W;

    scanf(" %d %d", &n, &W);
    for (int i = 1; i <= n; i++) {
        scanf(" %d %d", &w[i], &v[i]);
    }

    for (int i = 1; i <= n * MAX_V; i++) {
        dp[i] = INF_LL;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = n * MAX_V; j >= v[i]; j--) {
            dp[j] = min(dp[j], dp[j - v[i]] + w[i]);
        }
    }

    long long ans = 0;
    for (int i = 1; i <= n * MAX_V; i++) {
        if (dp[i] <= W) ans = i;
    }
    printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 896
N, A, B, C = map(int,input().split())
ls = [int(input()) for i in range(N)]
def func(pos, a, b, c):return abs(a - A) + abs(b - B) + abs(c - C) - 30 + 10000 * max(0, 1 - a * b * c) if pos == N else min(func(pos + 1, a + ls[pos] * (i == 0), b + ls[pos] * (i == 1), c + ls[pos] * (i == 2)) + 10 * (i < 3) for i in range(4))
print(func(0, 0, 0, 0))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)


int main()
{
    IOS;
   //freopen("inputfile.txt","r",stdin);
  set <string>s;
  int n;cin>>n;
  while(n--)
  {
      string c;cin>>c;
      s.insert(c);
  }
  cout<<s.size()<<endl;
    return 0;
}
//<!...........ALHAMDULILLAH.............!!>>



Measured memory_bytes: 19220
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
using namespace std;
///手写栈
int S[1005],top;
void push(int x){
    S[++top] = x;
}
int pop(){
    top--;
    return S[top+1];
}
int main()
{
    string s;
    top = 0;
    int a,b;
    while(cin >> s){
           // cout << s[0];
        if(s == "+"){
            a = pop();
            b = pop();
            push(a + b);
        }else if(s == "*"){
            b = pop();
            a = pop();
            push(a * b);
        }else if(s == "-"){
            b = pop();
            a = pop();
            push(a - b);
        }else{
            ///将字符转换为相应的数字放入栈中

            push(atoi(&s[0]));
        }
    }

  //  cin >> s;
//    cout << atoi(s);
   printf("%d\n",pop());
    return 0;
}



Measured memory_bytes: 3288
import copy
T = [[int(x) for  x in input().split()] for i in range(10)]

def E(ID):
#    if len(ID)!=4:
    #    print(len(ID))
    ret = 0
    for d in ID:
        d  =int(d)
        ret = T[ret][d]
    return ret

def solve(ID):
    e = E(ID)
    for i in range(4):
        for j in range(10):
            kari = copy.deepcopy(ID)
            if kari[i] == str(j):
                continue
            kari[i] = str(j)
            if T[E(kari)][e]==0:
                return 1
    for i in range(10):
        if T[E(ID)][i] == 0 and i!=e:
            return 1
    for i in range(3):
        kari = copy.deepcopy(ID)
        if kari[i] == kari[i+1]:
            continue
        kari[i],kari[i+1] =kari[i+1],kari[i]
        if T[E(kari)][e]==0:
            return 1
    if T[E(ID[:3]+[str(e)])][int(ID[3])]==0 and int(ID[3])!=e:

        return 1
    #print(ID ,e)
    return 0
ans = 0
for i in range(10000):
    ID  =[j for j in str(i)]
    ID = ['0']*(4-len(ID)) + ID
    ans += solve(ID)

print(ans)




Measured memory_bytes: 6348
#include <stdio.h>

int main()
{
	// 変数定義
	int iN;
	int iX;
	int iAns;				// 合計がxとなる3数の組み合わせの数
	int iNum1, iNum2, iNum3;	// 足し合わせる3数(iNum1 > iNum2 > iNum3)

	// nとxがともに0になるまで繰り返す
	while (1)
	{
		// 入力：n、x
		scanf("%d %d", &iN, &iX);
		if (iN == 0 && iX == 0) {
			break;
		}

		// 3数のうち最大の数字を選ぶ
		iAns = 0;
		for (iNum1 = 1; iNum1 <= iN; iNum1++)
		{
			// 3数のうち2番目に大きい数字を選ぶ
			for (iNum2 = iNum1 + 1; iNum2 <= iN; iNum2++)
			{
				// 3数のうち最小の数字を選ぶ
				for (iNum3 = iNum2 + 1; iNum3 <= iN; iNum3++)
				{
					if (iNum1 + iNum2 + iNum3 == iX)
					{
						iAns++;
					}
				}
			}
		}

		// 出力：合計xとなる3数の組み合わせの数
		printf("%d\n", iAns);
	}

	return 0;
}


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

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)
#define rep1(i,n) rep(i,1,n+1)
#define repR(i,s,n) for(ll i = (n-1); i >= (s); i--)
#define repR0(i,n) repR(i,0,n)
#define repR1(i,n) repR(i,1,n+1)

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;
#define fcout cout << fixed << setprecision(18)

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

  vector<int> countA(26, 0);
  vector<int> countB(26, 0);
  rep0(i, N) {
    countA[S[i] - 'a']++;
  }
  int ans = 0, temp = 0;
  repR0(i, N) {
    int t = (S[i] - 'a');
    if (countA[t] == 1 && countB[t] > 0) {
      temp--;
    } else if (countA[t] > 1 && countB[t] == 0) {
      temp++;
    }
    countA[t]--;
    countB[t]++;
    ans = max(ans, temp);
  }
  cout << ans << BR;
  return 0;
}

Measured memory_bytes: 256
S=input()
pre=int(S[:2])
post=int(S[2:])
if 1<=pre<=12:
    if 1<=post<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1<=post<=12:
        print('YYMM')
    else:
        print('NA')

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

int main(void){
  int n;
  cin >> n;

  if (n % 2){
    cout << (n - 1) * (n - 3) / 2 + n - 1 << endl;
    for (int i = 1; i <= n; i++){
      for (int j = i + 1; j <= n; j++){
        if (i + j != n)
          cout << i << " " << j << endl;
      }
    }
  }
  else {
    cout << (n - 2) * n / 2 << endl;
    for (int i = 1; i <= n; i++){
      for (int j = i + 1; j <= n; j++){
        if (i + j != n + 1)
          cout << i << " " << j << endl;
      }
    }
  }



  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define repn(i,a,b) for (int i = a; i >=b ;i--)
#define MOD 1000000007


int main(){
ios::sync_with_stdio(0);
cin.tie(0);
    ll x;cin>>x;
    ll t=0,ans=100;
    while(ans<x){
        ans+=ans/100;
        t++;
    }
    cout<<t;
return 0;
}

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

#define V vector
typedef long long ll;
typedef unsigned long long ull;

typedef V<int> vi;
typedef V<ll> vll;
typedef V<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define f(i,a) for(int i = 0 ; i < a ; i++)
#define fll(i,a) for(ll i = 1 ; i <= a ;i++)
#define forab(i,a,b) for(int i = a ; i < b ; i++)
#define prec(x) cout<<fixed<<setprecision(x)
#define ff first
#define ss second
#define INF 1000000000

#define pb push_back
#define mp make_pair
#define numberofdigits(x) floor(log10(x)) + 1

long long binpow(long long a, long long b) {
	long long res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a;
		a = a * a;
		b >>= 1;
	}
	return res;
}



void solve()
{
	ll a;
	double b;

	cin >> a >> b;

	ll c = 100 * b + 0.5;

	ll ans = (a * c) / 100;

	cout << ans << "\n";
}



int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);


	int t = 1;
	//cin >> t;


	while (t--)
	{
		solve();
	}
	return 0;
}

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

#define endl '\n'
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << ends << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

////////////////////////////////////////////////////////////////////

const int N = 2e5 + 5;

int A[N];
map<int, bool> M;

int main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	int n, ans = 0; cin >> n;
	for (int i = 0; i < n; i++) cin >> A[i], M[A[i]] = i & 1;
	sort(A, A + n);
	for (int i = 0; i < n; i++) ans += M[A[i]] ^ (i & 1);
	cout << ans / 2 << endl;

	return 0;
}


Measured memory_bytes: 5376
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

n = int(input())
AB = [[0,0] for _ in range(n)]
A = [0]*n
B = [0]*n
for i in range(n):
    a,b = map(int,input().split())
    AB[i] = [a,b]
    A[i] = a
    B[i] = b
A.sort()
B.sort()

if n%2 == 1:
    print(B[n//2] - A[n//2] + 1)
else:
    print((B[n//2]+B[n//2-1])-(A[n//2]+A[n//2-1])+1)



Measured memory_bytes: 42988
#include <iostream>
#include <string>
using namespace std;
using llong = long long;

int main() {
		string s;
		llong y, m, d;

		while (cin >> s, s == "HEISEI") {
				cin >> y >> m >> d;

				if (y > 31 || (y >= 31 && m >= 5)) {
						printf("? %lld %lld %lld\n", y - 30, m, d);
				}
				else {
						printf("HEISEI %lld %lld %lld\n", y, m, d);
				}
		}
}



Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(){
    ll N;
    cin >> N;
    vector<ll> dp(21000000);

    for (int i = 0; i < 21000000; i++) dp[i] = INF;

    dp[0] = 0;

    for (ll i = 1; i<=N; i++){
      for (ll j = 1; j<=i; j*=6){
        chmin(dp[i], dp[i - j] + 1);
      }
      for (ll k = 1; k<=i; k*=9){
        chmin(dp[i], dp[i - k] + 1);
      }
    }
    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 167456
#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair

using namespace std;

const int N=2e5+5;
const int mod=1e9+7;
int n,m,a,b;

int Power(int x,int n)
{
    if(n==0) return 1;
    if(n==1) return x;
    if(n%2) return Power(x,n-1)*x%mod;
    int tmp=Power(x,n/2);
    return tmp*tmp%mod;
}

int calc(int k)
{
    int ret=1;
    for(int i=n-k+1;i<=n;i++) ret=ret*i%mod;
    for(int i=1;i<=k;i++) ret=ret*Power(i,mod-2)%mod;
    return ret;
}

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>a>>b;
    int total=Power(2,n)-1;
    cout<<(total-calc(a)-calc(b)+mod*2)%mod;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	string s; cin >> s;
	bool erfolg = regex_match(s, regex("(dream(er)?|eraser?)*"));
    if( erfolg ) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 40960
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long double ld;

const ld PI = 3.1415926535897;

int main() {FIN
	
	int r;
	cin >> r;
	cout << fixed << setprecision(12) << 2.0 * PI * r << "\n";
	return 0;
}


Measured memory_bytes: 3804
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL

typedef struct node{
 struct node *right;
 struct node *left;
  struct node *parent;
  int key;
}*Node;
 
Node root;
void insert(int);
void inorder(Node);
void preorder(Node);
int main(){
  int n, i, x;
  char S[20];
  scanf("%d", &n);
    
  for ( i = 0; i < n; i++ ){
    scanf("%s", S);
    
      if ( S[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( S[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
    
  return 0;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  while(x!=NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else{
      x = x->right;
    }
  }
  z->parent= y;
  if(y==NIL){
    root = z;
  }
  else if(z->key<y->key){
    y->left =z;
  }
  else{
    y->right =z;
  }
}
  
void inorder(Node A){
  if(A != NIL){
    inorder(A->left);
    printf(" %d",A->key);
    inorder(A->right);
  }
}
  
void preorder(Node A){
  if(A!=NIL){
    printf(" %d",A->key);
    preorder(A->left);
    preorder(A->right);
  }
}

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

#define int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

const int MOD = 1e9+7;

int fastpow(int n, int p){
	int res = 1;
	while(p){
		if(p&1) res = (res * n) % MOD;
		n = (n * n) % MOD;
		p>>=1;
	}
	return res;
}

void solve(){
	int sum = 0;
	int n;
	cin >> n;
	int a[n];
	for(auto &x : a) cin >> x;
	for(auto x : a) sum = (sum + x)%MOD;
	int ans = 0;
	for(auto x : a){
		ans = (ans + (sum-x)*x%MOD+MOD)%MOD;
	}
	cout << ans*fastpow(2,MOD-2)%MOD << "\n";
}

signed main(){
	fastio
	int t = 1;
	//cin >> t;
	while(t--) solve();
}

Measured memory_bytes: 5204
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int n;
    cin >> n;
    int countans = 0;
    for (int i = 1; i <= n; i++){
        int count = 0;
        for (int j = 1; j <= i; j++){
            if (i%j==0) count++;
        }
        if (count == 8 && i%2==1) countans++;
    }
    cout << countans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int count = 1;
		for(int i = 0; i < n; i++) {
			if(count > k) {
				count += k;
			} else {
				count *= 2;
			}
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 22996
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long output = sc.nextLong();
		long f = (long)0;
		for(long i = 1;i<=output;i++)
		{
			if(i%3!=0&&i%5!=0)f+=i;
		}
		System.out.println(f);

	}
}

Measured memory_bytes: 35656
# -*- coding: utf-8 -*-
s = input()

if 1 <= int(s[0:2]) <= 12:
    if 1 <= int(s[2:4]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= int(s[2:4]) <= 12:
        print("YYMM")
    else:
        print("NA")


Measured memory_bytes: 2940
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&n)

	s := bufio.NewScanner(os.Stdin)
	s.Scan()

	var count, min int
	slice := strings.Split(s.Text(), " ")
	for i, v := range slice {
		count = 0
		num, _ := strconv.Atoi(v)
		for num%2 == 0 {
			num /= 2
			count++
		}
		if i == 0 {
			min = count
		} else if min > count {
			min = count
		}
	}
	fmt.Println(min)
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
 
using namespace std;
 
struct Node {
    int key;
    Node *parent,*left,*right;
};
 
Node *root,*NIL;
 
void insert(int k) {
    Node *y=NIL;
    Node *x=root;
    Node *z;
 
    z=new Node;
    z->key=k;
    z->left=NIL;
    z->right=NIL;
    while(x!=NIL) {
        y=x;
        if(z->key < x->key) {
            x=x->left;
        }
        else {
            x=x->right;
        }
    }
 
    z->parent=y;
    if(y==NIL) {
        root=z;
    }
    else {
        if(z->key<y->key) y->left=z;
        else y->right=z;
    }
}
 
Node* find(Node *u,int k) {
    while(u!=NIL&&k!=u->key) {
        if(k<u->key) u=u->left;
        else u=u->right;
         
    }
    return u;
}
 
void inorder(Node *u) {
    if(u==NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node *u) {
    if(u==NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}
 
int main() {
    int n,x;
    string com;
 
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>com;
        if(com=="insert") {
            cin>>x;
            insert(x);
        }
        else if(com=="print") {
            inorder(root);
            cout<<endl;
            preorder(root);
            cout<<endl;
        }
        else if(com=="find") {
            cin>>x;
            if(find(root,x)!=NIL) cout<<"yes"<<endl;
            else cout<<"no"<<endl;
 
        }
    }
 
    return 0;
 
}


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

using namespace std;

const int N = 100005;

int h[N], dp[N];

int n;

int main() {

	cin >> n;

	for (int i = 1; i <= n; i ++) {
		cin >> h[i];
	}

	dp[1] = 0;
	dp[2] = abs(h[2] - h[1]);

	for (int i = 3; i <= n; i ++) {
		dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]));
	}

	cout << dp[n] << '\n';
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>

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

using namespace std;

int w[1005][1005];
int main()
{
	string s[1005];
	int n;
	while(cin >> n && n)
	{
		memset(w,0,sizeof(w));
		rep(i,n)
		{
			cin >> s[i];
		}

		rep(i,n)
		{
			rep(j,n)
			{
				if(s[i][j] == '*') w[i][j] = 0;
				else w[i][j] = 1;
			}
		}

		int ans = 0;
		REP(i,1,n)
		{
			REP(j,1,n)
			{
				if(s[i][j] == '*')
				{
					w[i][j] = 0;
				}
				else
				{
					w[i][j] = min(w[i-1][j-1],min(w[i-1][j],w[i][j-1])) + 1;
					ans = max(ans,w[i][j]);
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 6208
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

vector<ll> divisors(ll n) {
    vector<ll> v;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            v.push_back(i);
            if (i * i != n) {
                v.push_back(n / i);
            }
        }
    }
    return v;
}

void solve() {
    int n;
    cin >> n;
    int ans = 0;
    REP1(i, n) {
        auto x = divisors(i);
        if (sz(x) == 8) ans++;
        i++;
    }
    cout << ans << endl;
}


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

#define INF (1<<30)
int x[105], l[105], f[105], d[105], ud[105], v[105];

double up(int n)
{
	return 1.0*l[n]/f[n];
}

double down(int n)
{
	return 1.0*l[n]/d[n];
}

double dp[105][1250];

int main()
{
	cout << setiosflags(ios::fixed) << setprecision(10);
	
	int N,M,K;
	while(cin >> N >> M >> K, (N||M||K))
	{
		v[0]=INF;
		K+=100;

		x[N]=INF;
		
		memset(dp,0,sizeof(dp));
		
		for(int i=0; i<N; i++)
		{
			cin >> x[i] >> l[i] >> f[i] >> d[i] >> ud[i];
			x[i]+=100;
		}
		for(int i=1; i<=M; i++)
			cin >> v[i];	
		
		for(int i=0; i<=K+100; i++)
			dp[0][i]=0;
		
		for(int i=0; i<N; i++)
		{
			if(ud[i]==0) dp[0][x[i]]=-INF;
		}
			
		for(int i=1; i<=M; i++)
		{
			int g=0;
			for(int j=100-i+2; j<=K+102; j++)
			{
				double tmp = dp[i-1][j+1];
				if(x[g+1]==j+1)
				{
					if(ud[g+1]==0) tmp-=up(g+1);
					if(ud[g+1]==1) tmp-=down(g+1);
				}

				if(x[g]!=j)
				{
					dp[i][j]=max(dp[i][j-1] + 1.0/v[i], tmp);
				}
				else
				{

					if(ud[g]==0) 
					{
						dp[i][j]=max(dp[i][j-1]+1.0/v[i], max(dp[i-1][j]+down(g), tmp));
						dp[i][j]+=up(g);
					}
					if(ud[g]==1) 
					{
						dp[i][j]=max(dp[i][j-1]+1.0/v[i], max(dp[i-1][j]+  up(g), tmp));
						dp[i][j]+=down(g);
					}
					
					g++;
				}
				
			}
		}
		
		cout << dp[M][K] << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const ll MOD = 1000000007;

int main() {
    int a, b, cnt = 1;
    cin >> a >> b;
    if (b == 1) {
        cout << 0 << endl;
        return 0;
    }
    int c = a-1;
    while (a < b) {
        cnt++;
        a += c;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <utility>
using namespace std;

int main()
{
    int n,i;
    cin >> n;
    vector<int> a(n);
    for(i = 0;i < n;++i){
        cin >> a.at(i);
    }
    int ans = a.at(0);
    int temp1,temp2;
    for(i = 1;i < n;++i){
        if(ans < a.at(i)){
            temp1 = a.at(i);
            temp2 = ans;
        }else{
            temp1 = ans;
            temp2 = a.at(i);
        }
        int temp3 = temp1%temp2;
        while(temp3){
            temp1 = temp2;
            temp2 = temp3;
            temp3 = temp1%temp2;
        }
        ans = temp2;
    }
    cout << ans << endl;
    return 0;
}

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

struct two {
  int first;
  int second;
};

int main() {
  //迷路入力
  int H, W;
  cin >> H >> W;
  vector<vector<char>> maze(H, vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> maze.at(i).at(j);
    }
  }
  //既存の黒を数える
  int alblack = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (maze.at(i).at(j) == '#') {
        alblack++;
      }
    }
  }
  //経路探索
  two org = {-1, -1};
  vector<vector<bool>> checked(H, vector<bool>(W, 0));
  vector<vector<two>> root(H, vector<two>(W, org)); 
  queue<two> Q;
  checked.at(0).at(0) = 1;
  two start = {0, 0};
  Q.push(start);
  while (Q.size() != 0) {
    int i = Q.front().first;
    int j = Q.front().second;
    if ((i == H-1) && (j == W-1)) {
      int count = 1;
      two now = {H-1, W-1};
      while ((now.first != 0) || (now.second != 0)) {
        now = root.at(now.first).at(now.second);
        count++;
      }
      cout << H*W - alblack - count << endl;
      return 0;
    }
    if (j+1 < W) {
      if ((checked.at(i).at(j+1) == 0) && (maze.at(i).at(j+1) == '.')) {
        checked.at(i).at(j+1) = 1;
        two cur = {i, j+1};
        two fr = {i, j};
        Q.push(cur);
        root.at(i).at(j+1) = fr;
      }
    }
    if (i+1 < H) {
      if ((checked.at(i+1).at(j) == 0) && (maze.at(i+1).at(j) == '.')) {
        checked.at(i+1).at(j) = 1;
        two cur = {i+1, j};
        two fr = {i, j};
        Q.push(cur);
        root.at(i+1).at(j) = fr;
      }
    }
    if (j-1 >= 0) {
      if ((checked.at(i).at(j-1) == 0) && (maze.at(i).at(j-1) == '.')) {
        checked.at(i).at(j-1) = 1;
        two cur = {i, j-1};
        two fr = {i, j};
        Q.push(cur);
        root.at(i).at(j-1) = fr;
      }
    }
    if (i-1 >= 0) {
      if ((checked.at(i-1).at(j) == 0) && (maze.at(i-1).at(j) == '.')) {
        checked.at(i-1).at(j) = 1;
        two cur = {i-1, j};
        two fr = {i, j};
        Q.push(cur);
        root.at(i-1).at(j) = fr;
      }
    }
    Q.pop();
  }
  cout << -1 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int> E[100010];
int p[100010];
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= m; ++i) {
		int u, v;
		cin >> u >> v;
		E[u].push_back(v);
		E[v].push_back(u);
	}
	queue<int> q;
	q.push(1);
	while(q.empty() == false) {
		int u = q.front();
		q.pop();
		for (int v : E[u]) {
			if (p[v] == 0) {
				p[v] = u;
				q.push(v);
			}
		}
	}
	for (int i = 2; i <= n; ++i) {
		if (p[i] == 0) {
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	for (int i = 2; i <= n; ++i) {
		cout << p[i] << '\n';
	}
}	

Measured memory_bytes: 10584
#include<iostream>

using namespace std;

struct Shape{
  int h,w;
  bool operator < (const Shape& s) const {
    int dA = h*h+w*w;
    int dB = s.h*s.h+s.w*s.w;
    if(dA != dB) return dA < dB;
    return h < s.h;
  }
};

const int MAX = 501;

int main(){
  int h,w;
  while(cin >> h >> w && h+w){
    Shape A = (Shape){h,w};
    Shape ans = (Shape){MAX,MAX};

    for(int i = 1; i < MAX; i++)
      for(int j = i+1; j < MAX; j++){
	Shape tmp = (Shape){i,j};
	if(A < tmp && tmp < ans) ans = tmp;
      }
    cout << ans.h << " " << ans.w << endl;
  }
  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <string>
using namespace std;
int main()
{
  int a,b;
  string c[50],d[50];
  cin>>a;
  cin>>b;
  int flag;
  for(int i=0;i<a;i++)cin>>c[i];
  for(int i=0;i<b;i++)cin>>d[i];

for(int i=0;i<=a-b;i++){
  for(int j=0;j<=a-b;j++){
    flag=0;
    for(int k=0;k<b;k++){
      if(c[i+k].substr(j,b)==d[k])flag++;
    }
    if(flag==b){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
}
  cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
using System.Globalization;
using static System.Console;
using static System.Math;


namespace templete
{
    class abc96_c
    {
        static void Main(string[] args)
        {
            int[] input = ReadLine().Split().Select(int.Parse).ToArray();
            int x = input[0];
            int y = input[1];
            string[] canvas = new string[x];

            for(int i=0; i<x; i++)
            {
                canvas[i] = Console.ReadLine();
            }

            for(int i=0; i<x; i++)
            {
                for(int j=0; j<y; j++)
                {
                    if(canvas[i][j] == '#')
                    {
                        if(!((i != 0 && canvas[i-1][j] == '#') || ( i != x-1 && canvas[i+1][j] == '#') || (j != 0 && canvas[i][j-1] == '#') || (j != y-1 && canvas[i][j+1] == '#')))
                        {
                            WriteLine("No");
                            return;
                        }
                    }
                }
            }
            WriteLine("Yes");
        }
    }
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define contains(c, i) ((c).find(i) != (c).end())
#define present(i, c) (find(all(c), i) != (c).end())

#define rep(i, n) for(int i = 0; i < n; i++)
#define repa(i, b, e) for(int i = (b)-((b)>(e)); i != (e)-((b)>(e)); i += 1-2*((b)>(e)))

#define dbg(x) cerr << #x << " = " << x << endl;
#define dbgall(x) cerr << #x << " = "; for(auto i_ : x) cerr << i_ << " "; cerr << endl;
#define debug(args...) { string s_(#args); replace(all(s_), ',', ' '); stringstream ss_(s_); istream_iterator<string> it_(ss_); cerr_(it_, args); }
void cerr_(istream_iterator<string> it) { (void) it; }
template<class T, class... Args> void cerr_(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; cerr_(++it, args...); }

template<class T, class S>  ostream& operator<<(ostream& os, const pair<T, S>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, const set<T> &s) { os << '{'; string sep; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<class T, class S> ostream& operator<<(ostream &os, const map<T, S> &m) { os << '{'; string sep; for (const auto &x : m) os << sep << x, sep = ", "; return os << '}'; }
template<class T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }

//=========================

void run_test() {
	int n; cin >> n;
	cout << n * n * n << endl;
}

//=========================

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//int _t = 1, __t; cin >> __t; while(_t <= __t) { cout << "Case #" << _t++ << ": "; run_test(); }
	// int _t; cin >> _t; while(_t--) run_test();
	run_test();
	return 0;	
}


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

int main()
{
ll n , m ;
cin >> n >> m ;
if(n!=0)ans+=n*(n-1);
if(m!=0)ans+=m*(m-1);
cout << ans/2 << endl;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll N, Z, W;
    cin >> N >> Z >> W;
    vector<ll> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }   
    if(N == 1){
        printf("%d\n", abs(W - A[0]));
        return 0;
    }
    W -= A[N-1]; W = abs(W);
    A[N-2] -= A[N-1]; A[N-2] = abs(A[N-2]);
        
    if(W > A[N-2]){
        printf("%lld\n", W);
    }
    else{
        printf("%d\n", A[N-2]);
    }

}

Measured memory_bytes: 3724
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> ok_query[15],ng_query[15];
int main(){
  ll n;
  cin>>n;
  for(int i=1;i<=n;i++){
    ll a;
    cin>>a;
    for(int j=0;j<a;j++){
      ll x,y;
      cin>>x>>y;
      if(y==0){
        ng_query[i].push_back(x);
      }
      else{
        ok_query[i].push_back(x);
      }
    }
  }
/*  for(int i=1;i<=n;i++){
    for(int j=0;j<ok_query[i].size();j++) cout<<ok_query[i][j]<<" ";
    cout<<endl;
  }
  for(int i=1;i<=n;i++){
    for(int j=0;j<ng_query[i].size();j++) cout<<ng_query[i][j]<<" ";
    cout<<endl;
  } */
  ll ans=0;
  for(int b=0;b<(1<<n);b++){
    ll i=b*2;
    bool f=true;
    ll kans=0;
    for(int j=1;j<=n;j++){
      if(((i>>j)&1)==1){
  //      cout<<j<<" ";
        kans++;
        for(int k=0;k<ok_query[j].size();k++){
          ll ok_p=ok_query[j][k];
          if(((i>>ok_p)&1)==0) f=false;
        }
        for(int k=0;k<ng_query[j].size();k++){
          ll ng_p=ng_query[j][k];
          if(((i>>ng_p)&1)==1) f=false;
        }
      }
    }
  //  cout<<"/"<<i<<" "<<kans<<endl;
    if(f) ans=max(ans,kans);
  }
  cout<<ans<<endl;
}


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

int main()
{
	int N, M;
	cin >> N >> M;
	vector<vector<int>> cnt(N + 1, vector<int>(M));
	for (int i = 0; i < N; i++) {
		int t;
		cin >> t; t--;
		cnt[i + 1] = cnt[i];
		cnt[i + 1][t]++;
	}
	vector<int> dp(1 << M, N);
	dp[0] = 0;
	for (int i = 0; i < (1 << M); i++) {
		int sum = 0;
		for (int j = 0; j < M; j++) {
			if (i & (1 << j)) {
				sum += cnt[N][j];
			}
		}
		for (int j = 0; j < M; j++) {
			if ((i & (1 << j)) == 0) {
				int dis = cnt[N][j] - (cnt[sum + cnt[N][j]][j] - cnt[sum][j]);
				dp[i | (1 << j)] = min(dp[i | (1 << j)], dp[i] + dis);
			}
		}
	}
	cout << dp.back() << endl;
	return 0;
}



Measured memory_bytes: 18728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  string s;
  cin >> s;
  int k;
  cin >> k;
  vector<int> cnt(26, 0);
  set<string> st;
  for(int i=0;i<26;i++) {
    bool flag = false;
    for(int j=0;j<s.size();j++) {
      if(s[j] == char(i+'a')) {
        string si = "";
        si += char(i+'a');
        st.insert(si);
        for(int m=j+1;m<min<int>(j+6, s.size());m++) {
          si += s[m];
          st.insert(si);
        }
      }
    }

    if(st.size() >= k) {
      flag = true;
      break;
    }
    if(flag)
      break;
  }

  auto itr = st.begin();
  for(int i=0;i<k-1;i++) {
    itr++;
  }
  cout <<  *itr << endl;
}


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

const int mod = 1000000007;
//const int mod = 998244353;
const int INF = 1001001001;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};

struct mint {
  ll x;
  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, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main()
{
    int n;
    cin >> n;
    vector<int> t(n);
    rep(i, 0, n) cin >> t[i];
    int m;
    cin >> m;
    vector<int> p(m), x(m);
    rep(i, 0, m){
         cin >> p[i] >> x[i];
        p[i]--;
    }
    
    int sum = 0;
    rep(i, 0, n) sum += t[i];
    rep(i, 0, m){
        cout << sum - t[p[i]] + x[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3624
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<numeric>
#include<map>
using namespace std;

#define R(i,s,n) for(int i=s;i<n;i++)
#define D(i,n,s) for(int i=n-1;i>=s;i--)
typedef pair<int,int> P;

vector<char> c;
int n;

int main() {
  while(cin >> n && n != 0){
    vector<int> alfa(26,0);
    c.clear();
    c.resize(n);
    R(i,0,n){
      cin >> c[i];
    }

    int nokori=n;
    int d=0;
    char win;
    R(i,0,n){
      alfa[c[i]-'A']++;
      nokori--;
      int max=0,max2=0,maxalfa=0;
      R(i,0,26){
        if(alfa[i]>max){
          max2=max;
          max=alfa[i];
          maxalfa=i;
        }else if(alfa[i]>max2){
          max2=alfa[i];
        }
      }
      if(max>max2+nokori){
        d=i+1;
        win = maxalfa+'A';
        break;
      }
    }

    if(d!=0){
      cout << win << " " << d << endl;
    }else{
      cout << "TIE" << endl;
    }
    /*
    R(i,0,26){
      cout << alfa[i];
    }
    cout << endl;
    */
  }
  return 0;
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
#ifdef __mr__
    #include "prettyprint.hpp"
#else
    #define endl                    '\n'
#endif
#define len(x)                      (uint)(x).size()
#define int                         int32_t
#define uint                        uint32_t
#define ulong                       uint64_t
#define long                        int64_t
#define maxof(x)                    numeric_limits<x>::max()
#define minof(x)                    numeric_limits<x>::min()
using namespace std;
const ulong mod = 1000000007ul;

int main(int argc, char const *argv[]) {
    #ifndef __mr__
        ios::sync_with_stdio(0);cin.tie(0);
    #endif
    int h, w;
    cin >> h >> w;
    vector<string> pic(h);
    for (int i = 0; i < h; ++i) {
        cin >> pic[i];
    }
//    vector<vector<char>> cpic(2*h, vector<char>(w));
    for (int i = 0; i < 2 * h; ++i) {
        for (int j = 0; j < w; ++j) {
            cout << pic[i / 2][j];
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 256
N = int(input())
S = [input() for _ in range(N)]

d = {}
for s in S:
  s = "".join(sorted(s))
  if s in d:
    d[s] += 1
  else:
    d[s] = 1

ans = 0
for v in d.values():
  ans += v*(v-1)//2
print(ans)

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

 int main()
     {
  int a,b,c;
  cin>>a>>b;
  c=a+b;
  if(c<24)
    cout<<c;
    else if(c==24)
        cout<<0;

  else cout<<c-24;


   return 0;
     }


Measured memory_bytes: 3584
import scala.io.Source

object Main{
  def main(args: Array[String]){
    val lines =
      for{
      in <- Source.stdin.getLines.toList
    }yield in.toString

    val point1 =
      lines.tail.map(_.toString.split(" ").toList).map{
        case x if(x(0).compare(x(1)) == 0) => 1
        case x if(x(0).compare(x(1)) > 0 ) => 3
        case _ => 0
      }.sum

    val point2 =
      lines.tail.map(_.toString.split(" ").toList).map{
        case x if(x(0).compare(x(1)) < 0 ) => 3
        case x if(x(0).compare(x(1)) == 0) => 1
        case _ => 0
      }.sum

    println(point1 + " " + point2)
  }
}

Measured memory_bytes: 46616
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define MP(a, b) make_pair(a, b)

int main()
{
	int N;
	while (cin >> N, N) {
		vector<pair<double, string>> vp;
		string name;
		int p, a, b, c, d, e, f, s, m;
		REP(i, 0, N) {
			cin >> name >> p >> a >> b >> c >> d >> e >> f >> s >> m;

			int sum = f*s*m, time = 0;
			double income;
			time += (a + b + c);
			time += ((d + e)*m);

			income = 1.0 * (sum - p) / time;

			vp.push_back(MP(-income, name));
		}

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

		REP(i, 0, vp.size()) {
			cout << vp[i].second << endl;
		}
		cout << "#" << endl;
	}
	return 0;
}

Measured memory_bytes: 3208
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        
        Scanner scan = new Scanner(System.in);

        String S = scan.next();
        String T = scan.next();
        int A = scan.nextInt();
        int B = scan.nextInt();
        String U = scan.next();
        if(S.equals(U)) A=A-1;
        else B=B-1;
        System.out.printf("%d %d",A,B);

    }
}

Measured memory_bytes: 23764
// aarsh01rsh@gmail.com
// Aarsh Sharma
#include<bits/stdc++.h>
using namespace std;

string to_string(string s) {
  return '"' + s + '"';
}
string to_string(char ch) {
  string s(1, ch);
  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...);
}

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

#define f(i, x, n) for (int i = x; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

typedef long long int ll;
#define int ll
typedef pair<ll, ll> pll;
typedef vector<vector<ll>> matrix;
typedef vector<ll> vll;

const ll mod = 1e9 + 7;
const ll inf = LLONG_MAX;
const ll N = 1e5 + 10;

int32_t main() {
  fast_io();

  int a; cin >> a;
  string s; cin >> s;
  if (a < 3200) cout << "red";
  else cout << s;

  return 0;
}

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

class Program
{
    static void Main()
    {
        List<int> sums = new List<int>();
        
        while (true)
        {
            try
            {
                int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                sums.Add(input[0] + input[1]);
                
            }
            catch
            {
                break;
                
            }
            
        }
        var Sums_Length = sums.Select(a => a.ToString().Length);
        foreach (var sum_length in Sums_Length)
        {
            Console.WriteLine(sum_length);
        }
            
    }
}


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

ans = abs(abs(x)-abs(y))

if x*y>0:
    if y>x:
        ans += 0
    else:
        ans += 2
elif x*y<0:
    if y>x:
        ans += 1
    else:
        ans += 1
else:
    if y>x:
        ans += 0
    else:
        ans += 1

print(ans)

Measured memory_bytes: 38384
MOD = 10 ** 9 + 7

H, W = map(int, input().split())
a = [input() for _ in range(H)]

dp = [[0] * (W + 1) for _ in range(H + 1)]
dp[1][1] = 1

for r in range(1, H + 1):
    for c in range(1, W + 1):
        if r == 1 and c == 1:
            continue
        if a[r - 1][c - 1] == '#':
            continue
        else:
            dp[r][c] = (dp[r - 1][c] + dp[r][c - 1]) % MOD
print(dp[H][W])


Measured memory_bytes: 43700
#include <stdio.h>

int main(void){
    int i,n,x;
    fscanf(stdin,"%d",&n);
    for(i=1;i<=n;i++){
        x=i;
        if(x%3==0){
            printf(" %d",i);
            continue;
        }
        do{
         if(x%10==3){
             printf(" %d",i);
             break;
         }
         x/=10;
    }while(x);
}
printf("\n");
return 0;
}


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

using namespace std;

int main(){
  int msp[200000]={}; msp[0]=6;
  int ms[300000]={}; ms[0]=6;
  int i,j,tmp=1;
  for(i=0;ms[i]<300000;++i){
    msp[tmp] = ms[i + 1] = ms[i] + ((i % 2) ? 5 : 2);
    for(j=0;msp[j]<=ms[i+1]/2;++j){
      if(ms[i+1]%msp[j]==0) {
	tmp--;
	break;
      }
    }
    tmp++;
  }
  
  int n;
  while(cin >> n && n != 1){
    cout << n <<":";
    for(i=0;msp[i]<=n;++i){
      if(n%msp[i]==0) cout << " " << msp[i];
    }
    cout <<endl;
  }

  
  return 0;
} 



Measured memory_bytes: 3864
<?php
  list($n) = explode(" ", trim(fgets(STDIN)));

  $len=strlen($n);
  $x=intval($n);

  $s=0;
  for($i=0;$i<$len;$i++){
    $s += $x % 10;
    $x = intdiv($x, 10);
  }
  if($n % $s == 0) echo "Yes";
  else echo "No";

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

using namespace std;

typedef long long ll;

int const N = 100 * 1000 + 16;

int n;
ll a[N], b[N];

int main() {
  scanf("%d",&n);
  for(int i = 1; i <= n; ++i)
    scanf("%lld%lld", a+i, b+i);

  ll d = 0;
  for(int i = n; i > 0; --i) {
    ll x = a[i] + d;
    ll y = b[i];

    if(y != 1 && x != 0 && x % y != 0)
      d += y - x % y;
  }

  printf("%lld\n", d);
}

Measured memory_bytes: 1920
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int r;
	cin >> r;
	cout << 3 * r * r << endl;
}

Measured memory_bytes: 256
row1 = map(int, raw_input().split())
row2 = map(int, raw_input().split())
row3 = map(int, raw_input().split())

n = input()

state1 = [0,0,0]
state2 = [0,0,0]
state3 = [0,0,0]

for i in range(n):
    x = input()
    if x in row1:
        xId = row1.index(x)
        state1[xId] = 1
    if x in row2:
        xId = row2.index(x)
        state2[xId] = 1
    if x in row3:
        xId = row3.index(x)
        state3[xId] = 1

ans = "No"


if state1[0] == state1[1] == state1[2] == 1:
    ans = "Yes"
if state2[0] == state2[1] == state2[2] == 1:
    ans = "Yes"
if state3[0] == state3[1] == state3[2] == 1:
    ans = "Yes"
if state1[0] == state2[0] == state3[0] == 1:
    ans = "Yes"
if state1[1] == state2[1] == state3[1] == 1:
    ans = "Yes"
if state1[2] == state2[2] == state3[2] == 1:
    ans = "Yes"
if state1[0] == state2[1] == state3[2] == 1:
    ans = "Yes"
if state1[2] == state2[1] == state3[0] == 1:
    ans = "Yes"
print ans

Measured memory_bytes: 2696