akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    { 
        static void Main(string[] args)
        {
            //[summary]A - Still TBD
            if (IsHeisei())
            {
                Console.WriteLine("Heisei");
            }
            else
            {
                Console.WriteLine("TBD");
            }
        }

        static bool IsHeisei()
        {
            string s = Console.ReadLine();
            var array = s.Split('/');

            int month = int.Parse(array[1]);
            int day = int.Parse(array[2]);

            if (month > 4)
            {
                return false;
            }
            else if (month == 4)
            {
                if (day == 31)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
        }
    }
}

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

Measured memory_bytes: 596
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define INF I64_MAX
#define MOD 1000000007


void solve(void)
{ 
  char a;
  cin>>a;
  if((a == 'a')||(a == 'e')||(a == 'i')||(a == 'o')||(a == 'u'))
  {
    cout<<"vowel"<<endl;
  }
  else
  {
    cout<<"consonant"<<endl;
  }
  
  
  return;
  
}



int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // std::cout << std::fixed;
  // std::cout << std::setprecision(8);

  solve();

 
  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
    int n;
    cin >> n;
    map<string,int> mp;
    int Max = 1;
    for(int i = 0;i < n;i++)
    {
        string s;
        cin >> s;
        if(mp.find(s) == mp.end())
        {
            mp.insert(make_pair(s,1));
        }
        else
        {
            mp[s]++;
            if(mp[s] > Max)
            {
                Max = mp[s];
            }
        }
    }
    auto itr = mp.begin();
    while(itr != mp.end())
    {
        if(itr -> second == Max)
        {
            cout << itr -> first << "\n";
        }
        itr++;
    }

    return 0;
}

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

int main(){
  int x; cin>>x;
  cout << 10-(x/200);
}

Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		int num1 = in.nextInt(); 
		int num2 = in.nextInt();
		
		int product = num1 * num2; 
		
		if ( (product & 1) == 0)  {
			System.out.println("Even");
		}
		
		else {
			System.out.println("Odd"); 
		}
	}

}


Measured memory_bytes: 21844
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

ll N;

void input() {
    cin >> N;
//        N = 999999999;
}

ll solve() {
    ll count = 0;
    
    vector<int> three_dec(10, 0);
    auto ten_dec = [&three_dec]() {
        ll num = 0;
        int map[4] = {0, 3, 5, 7};
        for (int i = 0; i < 10; i++) {
            num += map[three_dec[i]] * pow(10, i);
        }
        return num;
    };
    function<void(size_t)> increment = [&](size_t i) {
        if (three_dec[i] == 3) {
            increment(i + 1);
            three_dec[i] = 1;
        } else {
            three_dec[i]++;
        }
    };
    three_dec[0] = 1;
    for (; ten_dec() <= N; increment(0)) {
        bool clear[3] = {false, false, false};
        int i = 9;
        while (three_dec[i] == 0) i--;
        for (; i >= 0; i--) {
            clear[three_dec[i] - 1] = true;
        }
        if (clear[0] && clear[1] && clear[2]) {
            count++;
        }
    }
    
    
    return count;
}


int main() {
    input();
    cout << solve() << endl;;
    
    return 0;
}



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

long long h;

long long rec(long long cnt){
	if(cnt == 1) return 1;
	else if(cnt == 0) return 0;
	else return rec(cnt / 2) * 2LL + 1LL;
}

int main(){
	cin >> h;
	cout << rec(h) << "\n";
	return 0;
}


Measured memory_bytes: 256
//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
int main(){
	int a[1000]={0};
	for(int i=0;i<4;i++){
		int x;
		cin>>x;
		a[x]++;
	}
	for(int i=1;i<=1;i++){
		if(a[4]==1&&a[7]==1&&a[9]==1&&a[1]==1);
		else return cout<<"NO",0;
	}
	cout<<"YES";
}

Measured memory_bytes: 256
/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.

*/
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;

int mod = 1000000007;
ll dp[100005];
const ll INF = 1e18;

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

bool sortbyval(const pair<string, int> &a,
               const pair<string, int> &b){
    return (a.second < b.second);
}


int main(){

 int N, p;
  string s;
  cin >> N;

  vector<pair<pair<string, int>, int>> reset(N);
 for(auto i = 0; i < N; i++) {
    cin>>s>>p;

    reset.at(i).first.first = s;
    reset.at(i).first.second = -p;  //intentionally using the minus sign so that the
    // functions will sort the elements in the greatner ness order

    reset.at(i).second = i+1;
 }

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

 for(auto i : reset) {
    cout << i.second << endl;
  }

return 0;
}


Measured memory_bytes: 3648
import java.util.*;

public class Main{
    public static void main(String [] args){
            Scanner sc = new Scanner(System.in);
            
            int a = sc.nextInt();
            int b = sc.nextInt();
            
            if((a*b)%2 == 0) System.out.println("Even");
            else System.out.println("Odd");
    }
}
            

Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;

int binpow(int a, int b) {
	int res = 1;
	while (b) {
		if (b & 1) res = 1LL * res * a % MOD;
		a = 1LL * a * a % MOD;
		b >>= 1;
	}
	return res;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	cout << (0LL + binpow(10, n) - 2 * binpow(9, n) + binpow(8, n) + 2 * MOD) % MOD << "\n";
	return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int main(){
int num;cin>>num;
if(num>=0 && num<=999){
int x = num;
int counter = 1;
while(true){
    if(x<10)
        break;
    x = x/10;
    counter+=1;
}
int a[counter];
for(int i=counter-1 ; i>=0 ; i--){
    a[i]=num%10;
    num /= 10;
}
if(a[counter-1]==2 || a[counter-1]==4 || a[counter-1]==5 || a[counter-1]==7 || a[counter-1]==9)
    cout<<"hon"<<endl;
else if(a[counter-1]==0 || a[counter-1]==1 || a[counter-1]==6 || a[counter-1]==8)
    cout<<"pon"<<endl;
else if(a[counter-1]==3)
    cout<<"bon"<<endl;}
return 0;}


Measured memory_bytes: 3600
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    val a = sc.nextInt()
    val b = sc.nextInt()
    var ans = 0
    for (i in 1..n) {
        val sum = i.toString().map { it.toString().toInt() }.sum()
        if (sum in a..b) ans += i
    }
    println(ans)
}

fun main(args: Array<String>) {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}

Measured memory_bytes: 35060
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rep1(i,n) for(int i=1;i<=int(n);i++)
#define per(i,n) for(int i=int(n)-1;i>=0;i--)
#define per1(i,n) for(int i=int(n);i>0;i--)
#define foreach(i,n) for(auto &&i:n)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define GSORT(x) sort(all(x), greater<int>())
#define REV(x) reverse(all(x))
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define LOWitr(x, n) lower_bound(all(x), n)
#define UPRitr(x, n) upper_bound(all(x), n)
#define cii(x) int x;cin >> x
#define cill(x) LL x;cin >> x
#define cis(x) string x;cin >> x
#define co(x) cout << x << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define truecheck assert
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef long long int64;
template<class T,class U>bool chmax(T &a, const U &b) { if (a<b) { a=b; return true; } return false; }
template<class T,class U>bool chmin(T &a, const U &b) { if (b<a) { a=b; return true; } return false; }
const int INF = 1e9, MOD = 1e9 + 7;
const LL LLINF = 1e16;

int main() {
    fastcin();
    cout << fixed << setprecision(10);
    cii(a);
    cii(b);
    int ans = 0;
    if (a >= 6 && a <= 12){
        ans = b / 2;
    }else if(a >= 13){
        ans = b;
    }
    co(ans);
    return 0;
}

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

int main(){
    ll n;
    cin>>n;
    ll count=0,sum=0,mn=INT_MAX;
    while(n--){
        ll x;
        cin>>x;
        sum+=abs(x);
        if(x<0)count++;
        x=abs(x);
        mn=min(mn,x);
    }
    //this is hacked not the actual solution
    if(count%2==1)sum-=2*mn;
    cout<<sum;
}

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

int main() {
	int totalPassed = 0;
	int oPassed = 0;

	int n, a, b;
	string s;
	cin >> n >> a >> b;
	getline(cin, s);
	getline(cin, s);

	for (int i = 0; i < n; i++) {
		bool passed = false;
		if (s[i] == 'a') {
			if (totalPassed < a + b) {
				totalPassed++;
				passed = true;
			}
		}
		else if (s[i] == 'b') {
			if (totalPassed < a + b && oPassed < b) {
				totalPassed++;
				oPassed++;
				passed = true;
			}
		}
		if (passed) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

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

  ll n, m;
  // cin >> n >> m;
  scanf("%lld%lld", &n, &m);

  vector<P> c(m);
  rep(i, m) {
    // cin >> c[i].first >> c[i].second;
    scanf("%lld%lld", &c[i].first, &c[i].second);
  }

  map<ll, vll> pref_map;
  rep(i, m) {
    pref_map[c[i].first].push_back(c[i].second);
  }

  map<ll, map<ll, ll>> ans_map;
  FORm(it, pref_map) {
    sort(all(it->second));
    ll i = 1;
    FORm(v, it->second) {
      ans_map[it->first][*v] = i++;
    }
  }

  rep(i, m) {
    // auto &l = pref_map[c[i].first];
    // ll city_num = distance(l.begin(), find(all(l), c[i].second)) + 1;
    ll city_num = ans_map[c[i].first][c[i].second];

    printf("%06d%06d\n", (int)c[i].first, (int)city_num);
  }

  return 0;
}


Measured memory_bytes: 29568
import math
import queue

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a):
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def main():
    n = int(input())
    ans = n*(n-1)//2
    print(ans)
    return

if __name__ == '__main__':
    main()

Measured memory_bytes: 3952
N = gets.to_i
check = Hash.new(0)
arr = gets.split.map do |ar|
  check[ar.to_i] += 1
end
pre = check.select{|x,y| y >= 2}.sort_by{|x,y|-x}
# p pre
# binding.pry
if pre.empty? || pre.size == 1 && pre[0] == 2
  puts 0
elsif pre[0][1] >= 4
  puts pre[0][0] ** 2
elsif pre[0][1] >= 2
  puts pre[0][0] * pre[1][0]
end

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n,d,x;
    cin>>n>>d>>x;
    int ans=x+n,D=d-1;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        ans+=D/a;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=1e5+10;
const int mod=1e9+7;
ll dp[maxn][14];
char s[maxn];

int main()
{
    scanf("%s",s+1);
    int len=strlen(s+1);
    dp[0][0]=1;
    for(int i=1;i<=len;i++){
        if(s[i]=='?'){
            for(int j=0;j<13;j++){
                for(int k=0;k<=9;k++){
                    dp[i][(j*10+k)%13]=(dp[i-1][j]+dp[i][(j*10+k)%13])%mod;
                }
            }
        }
        else{
            for(int j=0;j<13;j++)
            dp[i][(j*10+s[i]-'0')%13]=(dp[i-1][j]+dp[i][(j*10+s[i]-'0')%13])%mod;
        }
    }
    printf("%lld\n",dp[len][5]);
}


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

int main() {
  	int A, B, C;
  	cin >> A >> B;
    C = A+B;
  	if (A%3==0 || B%3==0 || C%3==0){
    	cout << "Possible" << endl;
    }
  	else {
    	cout << "Impossible" << endl;
    }
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
	int h,w,a,b;
	cin >> h >> w >> a >> b;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			int x = ((i < b)^(j < a));
			cout << x;
		}
		cout << '\n';
	}	
}

Measured memory_bytes: 1280
N = int(input())
a = map(int, input().split())
memo = [0,0,0]
for i in a:
    if i%4 == 0:
        memo[2] += 1
    elif i%2 == 0:
        memo[1] += 1
    else: memo[0] += 1
 
if memo[2]*2+1 >= N or memo[2]*2 + memo[1] >= N:
    print('Yes')
else:print('No')

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

#define pq priority_queue
#define mp make_pair
#define cauto const auto &

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define clr(ar, val) memset(ar, val, sizeof(ar))

int main() {
  int n;
  int a = 0, b = 0, ab = 0, ba = 0, adv = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < s.size() - 1; j++) {
      if (s[j] == 'A' && s[j + 1] == 'B') {
        ab++;
      }
    }
    if (s[0] == 'B') {
      b++;
    }
    if (s[s.size() - 1] == 'A') {
      a++;
    }
    if (s[0] == 'B' && s[s.size() - 1] == 'A') {
      ba++;
    }
  }
  a -= ba;
  b -= ba;
  if (ba == 0)
    cout << ab + min(a, b) << endl;
  else {
    int ans = ab + ba - 1;
    if (a > 0) {
      ans += 1;
      a--;
    }
    if (b > 0) {
      ans += 1;
      b--;
    }
    ans += min(a, b);
    cout << ans << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

string dfs(string s, ll n) {
    if (n == 0) return s;
    s += (char)((n - 1)% 26 + 'a');
    n = (n - (n - 1)%26) / 26;
    return dfs(s, n);
}

int main() {
    ll n;
    cin >> n;
    string ans = dfs("", n);
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main() {
  int N, H;
  cin >> N >> H;
  int amax = 0;
  vector<int> b(N);
  int a;
  for (int i = 0; i < N; ++i) {
    cin >> a >> b[i];
    amax = max(a, amax);
  }
  sort(b.rbegin(), b.rend());
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    if (b[i] > amax && H > 0) {
      H -= b[i];
      ans++;
    } else {
      break;
    }
  }
  if (H > 0) {
    ans += ceil((double) H / amax);
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 640
// Vicfred
// https://atcoder.jp/contests/abc162/tasks/abc162_d
// math
import std.conv;
import std.stdio;
import std.string;

void main() {
    int n = readln.chomp.to!int;
    string s = readln.chomp;

    long[char] rgb;
    rgb['R'] = 0L;
    rgb['G'] = 0L;
    rgb['B'] = 0L;

    foreach(ch; s)
        rgb[ch] += 1L;

    long first = rgb['R']*rgb['G']*rgb['B'];

    if(first == 0L) {
        "0".writeln;
        return;
    }

    long not_second = 0L;

    for(int i = 0; i < n; i++) {
        for(int j = i+1; j < n; j++) {
            int k = 2*j - i;

            if(k > s.length-1)
                continue;

            if(s[i] == s[j] || s[i] == s[k] || s[j] == s[k])
                continue;

            not_second += 1L;
        }
    }

    writefln("%s", first-not_second);
}



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

int main() {
  int n, cnt;
  cnt = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if((i + 1) % 2 == 1 && a[i] % 2 == 1) cnt++;
  }
  cout << cnt;
  
}

    

Measured memory_bytes: 3620
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;

int combinations(int n, int s, int p = 9)
{
	if (n == 0 && s == 0)
		return 1;
	else if (n == 0 && s != 0)
		return 0;

	if (p < 0)
		return 0;

	int res = 0;
	for (int i = p; i >= 0; --i)
		res += combinations(n-1, s-i, i-1);

	return res;
}
int main()
{
	int n, s;
	while (true)
	{
		scanf("%d %d", &n, &s);
		if (s == 0 && n == 0)
			break;

		printf("%d\n", combinations(n, s));
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = (1e9)+7;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}


int main(){
  fastIO();
  vector<string>ways;
  string mask = "+++";
  string temp = mask;
  int pos = 2;
  string s;
  cin>>s;
  int A=s[0]-48,B=s[1]-48,C=s[2]-48,D=s[3]-48;
  for(int i=0;i<=3;i++){
  	temp=mask;
  	while(next_permutation(mask.begin(),mask.end())){
  		ways.push_back(mask);
  	}
  	ways.push_back(mask);
  	mask=temp;
  	mask[pos]='-';
  	pos--;
  }
  for(int i=0;i<ways.size();i++){
  	string t = ways[i];
  	for(int j=0;j<3;j++){
  		int test = 0;
  		if(t[0]=='-'){
  			test+=(A-B);
  		}else{
  			test+=(A+B);
  		}
  		if(t[1]=='-'){
  			test-=C;
  		}else{
  			test+=C;
  		}
  		if(t[2]=='-'){
  			test-=D;
  		}else{
  			test+=D;
  		}
  		if(test==7){
  			cout<<A<<t[0]<<B<<t[1]<<C<<t[2]<<D<<"=7"<<endl;
  			return 0;
  		}
  	}
  }
}


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

namespace A
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var n = int.Parse(Console.ReadLine());
            Console.WriteLine(n * n * n);
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,start,end) for(int i=start; i<=end; i++)
#define repd(i,start,end) for(int i=start; i>=end; i--)
#define pb push_back
#define mod 1e9+7
#define all(x) x.begin(),x.end()
void solve() {
	ll n,x,t,b,c;
	cin>>n>>x>>t;
	if(n%x==0)
	{
	    b=(n/x)*t;
	    cout<<b<<endl;
	}
	else
	{
	    c=((n/x)+1)*t;
	    cout<<c<<endl;
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cout.tie(0); cin.tie(0); 
	cout<<fixed;
	cout<<setprecision(10);
	 {
		solve();
	}
}


Measured memory_bytes: 3632
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=998244353
input=lambda:sys.stdin.readline().rstrip()

class modfact(object):
    def __init__(self,n):
        fact=[1]*(n+1); invfact=[1]*(n+1)
        for i in range(1,n+1): fact[i]=i*fact[i-1]%MOD
        invfact[n]=pow(fact[n],MOD-2,MOD)
        for i in range(n-1,-1,-1): invfact[i]=invfact[i+1]*(i+1)%MOD
        self.__fact=fact; self.__invfact=invfact

    def inv(self,n):
        assert(n>0)
        return self.__fact[n-1]*self.__invfact[n]%MOD

    def fact(self,n):
        return self.__fact[n]

    def invfact(self,n):
        return self.__invfact[n]

    def comb(self,n,k):
        if(k<0 or n<k): return 0
        return self.__fact[n]*self.__invfact[k]*self.__invfact[n-k]%MOD

    def perm(self,n,k):
        if(k<0 or n<k): return 0
        self.__fact[n]*self.__invfact[k]%MOD

def prime(n):
    if n<=1: return []
    S=[1]*(n+1)
    S[0]=0; S[1]=0
    for i in range(2,n):
        if(S[i]==0): continue
        for j in range(2*i,n+1,i): S[j]=0
    return [p for p in range(n+1) if(S[p])]

def resolve():
    n=int(input())
    A=list(map(int,input().split()))
    V=max(A)
    C=[0]*(V+1)
    for a in A: C[a]+=1

    P=prime(V)
    W=[1]*(V+1)
    for p in P:
        for i in range(p,V+1,p):
            W[i]*=(1-p)
    mf=modfact(V)
    for i in range(1,V+1):
        W[i]=(W[i]*mf.inv(i))%MOD

    ans=0
    for d in range(1,V+1):
        s=0 # 和(後に2乗する)
        t=0 # 2乗の和
        for i in range(d,V+1,d):
            s+=i*C[i]%MOD
            t+=(i**2)*C[i]%MOD
        ans+=(W[d]*(s**2-t))%MOD*mf.inv(2)%MOD
    print(ans%MOD)
resolve()

Measured memory_bytes: 116352
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    class AtCodeeeeeeeeeeeeeeeeeeeer
    {
        static void Main(string[] args)
        {
            int[] s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int A = s[0];
            int B = s[1];
            int C = s[2];
            int ans = 0;
            if (B/A>C)
            {
                Console.WriteLine(C);
            }
            else
            {
                Console.WriteLine(B / A);
            }
        }
    }
}


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

int main() {
  string n;
  cin >> n;
  
  int N = n.size();
  int sum = 0;
  for(int i = 0; i < N; i++){
    int num = (int)n.at(i) - 48;
    sum += num;
  }
  
  if(sum % 9 == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 3732
#include <stdio.h>

int main(void){
    int N,K,count = 1;
    
    scanf("%d %d",&N,&K);
    
    if(N == K) printf("%d\n",1);
    else{
        while(K++ < N){
            count++;
        }
        printf("%d\n",count);
    }
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using vin=vector<int>;
const int inf=1e9+7;
const ll INF=1e18;
vector<vin> g;
vector<int> seen;
int n,m;
bool go(int x){
  if(x==0){
  
  for(auto v :g[x]){
     if (go(v)){
       return true;
     }
    
  }
    return false;
  }//if
  else {
    	for(auto v:g[x]){
            if(v==n-1) return true;
    
    	}
  }
  
  
  return false;
}

int main() {
  
  cin>>n>>m;
  
  /////////
  bool ans=true;
  g.resize(n);
  seen.assign(n,-1);
  vin a(m),b(m);
  rep(i,m) {
    
    cin>>a[i]>>b[i];
    a[i]--;
    b[i]--;
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  ans=go(0);
  
  if(ans) cout<<"POSSIBLE"<<endl;
  else cout<<"IMPOSSIBLE"<<endl;
}

Measured memory_bytes: 14320
import sys
from collections import defaultdict

N, M = map(int, input().split())

is_ac = [False] * N
wa = [0] * N

for i in range(M):
    p, S = input().split()
    n = int(p) - 1
    if not is_ac[n] and S == "AC":
        is_ac[n] = True
    if not is_ac[n] and S == "WA":
        wa[n] += 1

cnt_ac = is_ac.count(True)
cnt_wa = 0
for i in range(N):
    if is_ac[i]:
        cnt_wa += wa[i]
print(cnt_ac, cnt_wa)


Measured memory_bytes: 10684
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

class Main {
    int N;
    string s;
    void input() { cin >> N >> s; }
    void output() {
        string sw = "SW";
        REP(bit, 1 << 2) {
            vector<int> v;
            REP(i, 2) { v.emplace_back(bit >> i & 1); }
            FOR(i, 1, N) {
                if (v[i] == 0) {
                    if (s[i] == 'o') {
                        v.emplace_back(v[i - 1]);
                    } else {
                        v.emplace_back(!v[i - 1]);
                    }
                } else {
                    if (s[i] == 'o') {
                        v.emplace_back(!v[i - 1]);
                    } else {
                        v.emplace_back(v[i - 1]);
                    }
                }
            }
            if (v.front() == v.back()) {
                if (v[0] == 0) {
                    if (s[0] == 'o') {
                        if (v[N - 1] != v[1]) continue;
                    } else {
                        if (v[N - 1] == v[1]) continue;
                    }
                } else {
                    if (s[0] == 'o') {
                        if (v[N - 1] == v[1]) continue;
                    } else {
                        if (v[N - 1] != v[1]) continue;
                    }
                }
                REP(i, N) { cout << sw[v[i]]; }
                cout << endl;
                return;
            }
        }
        cout << -1 << endl;
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


Measured memory_bytes: 4200
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;


int main() {
  int N;
  cin >> N;
  map<int, int> p;
  for(int i=0;i<N;i++){
    int n;
    cin >> n;
    if (p.count(n))
      p[n] += 1;
    else
      p[n] = 1;
  }
  
  int Q;
  cin >> Q;
  LL sum = 0;
  for (auto q : p) {
    auto k = q.first;
    auto v = q.second;
    sum += k*v;
  }
  for(int i=0;i<Q;i++){
    LL a,b;
    cin >> a >> b;
    if (p.count(a)){
      sum += (b-a)*p[a];
      p[b] += p[a];
      p[a] = 0;
    }  
    
    cout << sum <<endl;
  }  
  return 0;
}


Measured memory_bytes: 7456
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#define nmax_def 110000
#define Cmax_def 2200
#define mod 998244353
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main() {
	ll N;
	cin >> N;
	vl D(nmax_def, 0);
	ll ans = 1;
	rep(i, N) {
		int a;
		cin >> a;
		if (i == 0 && a != 0)
			ans = 0;
		if (i != 0 && a == 0)
			ans = 0;
		D[a]++;
	}
	rep(i, nmax_def) {
		if (i == 0)
			continue;
		rep(j, D[i]) {
			ans *= D[i-1];
			ans %= mod;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1152
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
				int n = scan.nextInt();
				if(n == 0){
					break;
				}
				int[] vis = new int[7];
				for(int i = 0;i < n;i++){
					int t = scan.nextInt();
					if(t >= 60){
						vis[6]++;
					}else if(t >= 50){
						vis[5]++;
					}else if(t >= 40){
						vis[4]++;
					}else if(t >= 30){
						vis[3]++;
					}else if(t >= 20){
						vis[2]++;
					}else if(t >= 10){
						vis[1]++;
					}else{
						vis[0]++;
					}
				}
				for(int i = 0;i < 7;i++){
					System.out.println(vis[i]);
				}
		}
	}
}

Measured memory_bytes: 209844
#include<stdio.h>
int main(){
    int x;
    scanf("%d",&x);
    if(x>=400&&x<=599)printf("8\n");
    else if(x>=600&&x<=799)printf("7\n");
    else if(x>=800&&x<=999)printf("6\n");
    else if(x>=1000&&x<=1199)printf("5\n");
    else if(x>=1200&&x<=1399)printf("4\n");
    else if(x>=1400&&x<=1599)printf("3\n");
    else if(x>=1600&&x<=1799)printf("2\n");
    else printf("1\n");
    return 0;
}

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

int main()
{
    string s;
    cin >> s;
    if (s[1] != s[2]) {
        cout << "No" << endl;
    } else {
        if (s[0] == s[1] || s[2] == s[3]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}


Measured memory_bytes: 256
def kaijou(n):
  sum = 0
  for i in range(n):
    sum += i
  return sum

num = int(input())

alplist = []

for i in range(num):
  alplist.append(sorted(input()))
alplist.sort()
tmp = []
count = 1
sum = 0
for _alplist in alplist:
  if tmp == _alplist:
    count += 1
  else:
    sum += kaijou(count)
    count = 1
    tmp = _alplist
sum += kaijou(count)
print(sum)

Measured memory_bytes: 24652
in1=gets.chomp.split(" ").map(&:to_i)
in2=gets.chomp.split(" ").map(&:to_i)
n=in1[0]
x=in1[1]
array=[]
pos=0
count=0
for i in 0..n do #座標の配列を用意
 array.push(pos)
 if i<n
  pos=pos+in2[i]
 end
end
for j in 0...array.size do
 if array[j]<=x #何回跳ねるかカウント
  count=count+1
 end
end
puts count

Measured memory_bytes: 1788
N=int(input())
A=list(map(int, input().split()))

ans = 0

A.sort()

for i in range(N):
    for j in range(i+1,N):
        if A[i]==A[j]:
            continue
        for k in range(j+1,N):
            if A[i]==A[k] or A[j]==A[k]:
                continue
            if A[i]+A[j]>A[k]:
                ans+=1
                #print(i,j,k)
            else:
                break

print(ans)

Measured memory_bytes: 9196
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    if(n%500==0&&n>=500)cout<<(n/500)*1000<<endl;
    else
    {
        long long x=n/500;
        long long y=(n%500)/5;
        cout<<x*1000+5*y<<endl;
    }
}


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

public class Main {
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int n = fs.nextInt();
        int[] ans = new int[n];
        for(int i=0; i<n; i++) ans[fs.nextInt()-1] = i+1;
        
        for(int i:ans) {
            System.out.print(i);
            System.out.print(" ");
        }
    }
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
 
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 43696
using System;
using System.Collections.Generic;
using System.Linq;
 
class MainClass {
  public static void Main (string[] args) {
    //入力3
    var A = Console.ReadLine();
    var B = Console.ReadLine();
    var list = new List<string>(){A, B};
    
    if(A == B){ Console.WriteLine("EQUAL"); return;}

    if(A.Length < B.Length) {
      Console.WriteLine("LESS"); 
      return;
    }else if(A.Length > B.Length) {
      Console.WriteLine("GREATER"); 
      return;
    }else{
      if(list.OrderBy(x => x).First() == A){
        Console.WriteLine("LESS"); 
      }else{
        Console.WriteLine("GREATER"); 
      }
    }
  }
}


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;

const ll INF = 1001001001;


int main() {

    int n, k;
    cin >> n >> k;
    vector<int> a(n);

    rep(i, n)cin >> a[i];
    ll sum = 0;
    rep(i, n) sum += a[i];

    set<ll> candidates;
    for (int i = 1; i * i <= sum; i++) {
        if (sum % i != 0) continue;
        candidates.insert(i);
        candidates.insert(sum / i);
    }

    ll ans = 1;
    for (ll x : candidates) {
        ll need;
        {
            vector<ll> r(n);
            rep(i, n) r[i] = a[i] % x;
            sort(r.begin(), r.end());
            ll rsum = 0;
            rep(i, n)rsum += x - r[i];
            ll lsum = 0;
            need = INF;
            rep(i, n) {
                lsum += r[i];
                rsum -= x - r[i];
                need = min(need, max(lsum, rsum));
            }
        }
        if (need <= k) {
            ans = max(ans, x);
        }
    }

    cout << ans << endl;

}


Measured memory_bytes: 256
using System;

namespace _0027
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var inputs = Console.ReadLine().Split(' ');
                if (inputs[0] == "0")
                {
                    break;
                }

                DateTime dayTime = new DateTime(2004, int.Parse(inputs[0]), int.Parse(inputs[1]));
                Console.WriteLine(dayTime.DayOfWeek);
            }
        }
    }
}

Measured memory_bytes: 5840
import math

N, D = map(int,input().split())
A = [[0]*D]*N

for i in range(N):
  A[i]=list(map(int, input().split()))

cnt = 0
for i in range(N-1):
  
  for j in range(i+1,N):
    tmp = 0
    for m in range(D):
      tmp = tmp + (A[i][m]-A[j][m])**2
    if (math.sqrt(tmp)).is_integer():
      cnt += 1

print(cnt)

Measured memory_bytes: 3064
W,H,N=map(int,input().split())

li=[[1 for w in range(W)] for h in range(H)]

for n in range(N):
  X,Y,a=map(int,input().split())
  if a==1:
    for y in range(H):
      for x in range(X):
        li[y][x]=0
  elif a==3:
    for y in range(Y):
      for x in range(W):
        li[y][x]=0
  elif a==2:
    for y in range(H):
      for x in range(X,W):
        li[y][x]=0
  else:
    for y in range(Y,H):
      for x in range(W):
        li[y][x]=0

ans=sum(x.count(1) for x in li)

print(ans)


Measured memory_bytes: 3064
#include <stdio.h>

int main(void)
{
	int a, b;
	scanf("%d%d", &a, &b);

	if (a < b)
		while(b-- > 0) {
			printf("%d", a);
		}
	else
		while(a-- > 0) {
			printf("%d", b);
		}
	return 0;
}

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

using namespace std;

#define int long long
#define FR first
#define SC second
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

typedef pair<int, int> P;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

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

  string s;
  cin >> s;
  replace(all(s), ',', ' ');
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String s = scan.next();
    char[] c = s.toCharArray();
    int ans = 0;
    for (char ch: c) {
      if (ch == '1') {
        ans++;
      }
    }
    System.out.println(ans);
  }
}

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

int main(){
	int cu[28];
	int Ans[2];
	for(int i = 0;i<28;i++){
		cin>>cu[i];
	}
	sort(cu,cu+28);
	int coun = 0;
	int coun_2 = 0;
	for(int i = 1;i<=30;i++){
		if(cu[coun]!=i){
			Ans[coun_2] = i;
			coun_2++;
		}
		else{
			coun++;
		}
	}
	cout<<Ans[0]<<endl;
	cout<<Ans[1]<<endl;
}

Measured memory_bytes: 3112
from bisect import bisect_left
A, B, Q = map(int, input().split())
S = sorted([int(input()) for i in range(A)])
T = sorted([int(input()) for i in range(B)])
X = [int(input()) for i in range(Q)]


for x in X:
  s_index = bisect_left(S, x)
  s_left = S[s_index - 1] if s_index > 0 else None
  s_right = S[s_index] if s_index < A else None
  t_index = bisect_left(T, x)
  t_left = T[t_index - 1] if t_index > 0 else None
  t_right = T[t_index] if t_index < B else None

  ans = float("inf")

  sl = [s_left, s_right]
  tl = [t_left, t_right]

  for s in sl:
    if not s: continue
    for t in tl:
      if not t: continue
      ans = min(ans, abs(x-s) + abs(t-s))

  for t in tl:
    if not t: continue
    for s in sl:
      if not s: continue
      ans = min(ans, abs(x-t) + abs(t-s)) 

  print(ans)

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

int main() {
    ll N;
    cin >> N;
    vector<string> S(N);
    for (ll i=0; i<N; i++) {
        cin >> S[i];
    }
    vector<ll> ans(4,0);
    for (ll i=0; i<N; i++) {
        if (S[i]=="AC") {
            ans[0]++;
        }
        else if (S[i]=="WA") {
            ans[1]++;
        }
        else if (S[i]=="TLE") {
            ans[2]++;
        }
        else {
            ans[3]++;
        }
    }
    vector<vector<string>> format(4,vector<string> (2));
    format[0][0] = "AC";
    format[1][0] = "WA";
    format[2][0] = "TLE";
    format[3][0] = "RE";
    for (int i=0; i<4; i++) {
        format[i][1] = " x ";
    }

    for (int i=0; i<4; i++) {
        cout << format[i][0] << format[i][1] << ans[i] << endl;
    }
}

Measured memory_bytes: 6428
def main():
    n = int(input())
    a = int(n / 1.08)
    b = a + 1
    if int(a * 1.08) == n:
        print(a)
    elif int(b * 1.08) == n:
        print(b)
    else:
        print(':(')


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <vector>
 
using namespace std;
 
int euler_phi(int n) {
  int ret = n;
 
  for(int i=2; i*i<=n; i++) {
    if(n % i == 0) {
      ret -= ret/i;
      while(n % i == 0) n /= i;
    }
  }
  if(n > 1) ret -= ret/n;
   
  return ret;
}
 
int main() {
  int n;
  cin >> n;
   
  cout << euler_phi(n) << endl;
   
  return 0;
}

Measured memory_bytes: 1164
#include<stdio.h>
int main(void){
    int x,y,z,i,count=0;
    scanf("%d%d%d",&x,&y,&z);
    for(i=x;i<y+1;i++){
        if(z%i==0){
            count++;
        }
    }
    printf("%d\n",count);
    return 0;
}

Measured memory_bytes: 596
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin>>n;
  
  int A[4][14];
  rep(i,4){
    rep(j,14) A[i][j]=0;
  }
  
  char c;
  int x;
  rep(i,n){
    cin>>c>>x;
    if(c=='S') A[0][x]=1;
    else if(c=='H') A[1][x]=1;
    else if(c=='C') A[2][x]=1;
    else A[3][x]=1;
  }
  
  string s="SHCD";
  rep(i,4){
    for(int j=1;j<=13;j++){
      if(A[i][j]!=1) cout<<s[i]<<" "<<j<<endl;
    }
  }
  
  return 0;
}


Measured memory_bytes: 3216
#include <stdio.h>

int main(void)
{
	int all;
	int book[9];
	int price;
	int i;
	
	while (1){
		scanf("%d", &all);
		if (all == 0){
			break;
		}
		
		price = all;
		for (i = 0; i < 9; i++){
			scanf("%d", &book[i]);
			price -= book[i];
		}
		
		printf("%d\n", price);
	}
	return (0);
}

Measured memory_bytes: 596
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n = int(input())
#a = [int(i) for i in read().split()]

a = [i**5 for i in range(1000)]
for i in range(1000):
    for j in range(i+1,1000):
        if a[j]-a[i] == n:
            print(j,i)
            exit()
        if a[j]+a[i] == n:
            print(j,-i)
            exit()



Measured memory_bytes: 9192
while True:
    aopb = input()
    a, op, b = aopb.split()
    a, b = int(a), int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(int(a / b))


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

#define MAX 1100
#define INF (1<<29)
#define EPS 1e-9

struct Point{
  int x, y, id;
};

vector<Point> bill;
double dist[MAX][MAX];

int V;

void init(){
  bill.clear();
  for(int i = 0 ; i < MAX ; i++){
    for(int j = 0 ; j < MAX ; j++){
      dist[i][j] = INF;
      if(i == j) dist[i][j] = 0;
    }
  }
}

int prev[MAX];
void dijkstra(int s){
  int d[MAX];
  bool used[MAX];
  for(int i = 0 ; i < MAX ; i++){
    d[i] = INF;
    used[i] = false;
    prev[i] = -1;
  }
  //fill(d, d+MAX, INF);
  //fill(used, used+MAX, false);
  //fill(prev, prev+MAX, -1);
  d[s] = 0;
  
  while(true){
    int v = -1;
    for(int u = 0 ; u < V ; u++){
      if(!used[u] && (v == -1 || d[u] < d[v])) v = u;
    }
    if(v == -1) break;
    used[v] = true;
    
    for(int u = 0 ; u < V ; u++){
      if(d[u] > d[v] + dist[v][u]){
	d[u] = d[v] + dist[v][u];
	prev[u] = v;
      }
    }
  }
}

vector<int> get_path(int t){
  vector<int> path;
  for(; t != -1 ; t = prev[t]) path.push_back(t);
  reverse(path.begin(), path.end());
  return path;
}

double getDist(int from, int to){
  double ret = sqrt(( ((bill[from].x - bill[to].x)*(bill[from].x - bill[to].x)) +
			     ((bill[from].y - bill[to].y)*(bill[from].y - bill[to].y)) ) );
  return ret;
}
  
int main(){
  while(cin >> V, V){
    bill.clear();
    init();
    //Point p;
    int B[MAX], X[MAX], Y[MAX];
    for(int i = 0 ; i < V ; i++){
      cin >> B[i] >> X[i] >> Y[i];
      B[i]--;
      //cin >> p.id >> p.x >> p.y;
      //p.id--;
      //bill.push_back(p);
    }
    
    for(int i = 0 ; i < V ; i++){
      for(int j = i ; j < V ; j++){
	if(i == j) continue;
	double d = sqrt( (X[i]-X[j])*(X[i]-X[j]) + (Y[i]-Y[j])*(Y[i]-Y[j]) );
	//double distance = getDist(bill[i].id, bill[j].id);
	//if(dis >= 50 + EPS) continue;
	//if(distance <= 50.0 + EPS){
	//dist[bill[i].id][bill[j].id] = dist[bill[j].id][bill[i].id] = distance;
	if(d <= 50.0){
	  dist[B[i]][B[j]] = dist[B[j]][B[i]] = d;
      }
      }
    }
    int m;    
    cin >> m;
    int s, g;
    for(int cs = 0 ; cs < m ; cs++){
      cin >> s >> g;
      s--, g--;
      dijkstra(s);
      vector<int> ans_path;
      ans_path = get_path(g);
      if(ans_path.size() <= 1) cout << "NA" << endl;
      else{
	for(int i = 0 ; i < (int)ans_path.size() ; i++){
	  if(i == (int)ans_path.size()-1) cout << ans_path[i]+1 << endl;
	  else cout << ans_path[i]+1 << ' ';
	}
      }
      ans_path.clear();
    } 
  }
  return 0;
}

Measured memory_bytes: 10692
#include <iostream>
#include<string>
#include<cctype>
#include<algorithm>
using namespace std;

int main() {
	int coun,p;
	string x;
	char y[100000];
	cin >> x;
	coun = x.size();
	p = 0;
	for (int w = 0; w < coun; ++w) {
		if (p == 0) {
			p = 1;
			cout << x[w];
		}
		else if (p == 1) {
			p = 0;
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 512