akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int, S: "List[str]"):
    S1, S2 = S
    prev = 0
    counter = 1
    i = 0
    while i<N:
        if S1[i] == S2[i]:
            if prev == 0:
                counter *= 3
            elif prev == 1:
                counter *= 2
            prev = 1
            i += 1
        else:
            if i > 0:
                if S1[i-1] == S1[i] and S2[i-1] == S2[i-1]:
                    i += 1
                    prev = 2
                    continue
            if prev == 0:
                counter *= 6
            elif prev == 1:
                counter *= 2
            elif prev == 2:
                counter *= 3
            prev = 2
            i += 1
        counter %= MOD
    print(counter)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(2)]  # type: "List[str]"
    solve(N, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int n;
  cin >> n;
  while(n--) {
    string s;
    cin >> s;
    int f=0;
    if (s.substr(0,2) == ">'") {
      int i=2, j1=0,j2=0;
      for (;i<s.length() && s[i]=='='; i++) j1++;
      if (i<s.length() && s[i++] == '#') {
        for (;i<s.length() && s[i]=='='; i++) j2++;
        if (j1>0 && j1==j2 && i<s.length() && s[i] == '~') {
          cout << "A";
          f++;
        }  
      }
    } else if (s.substr(0,2) == ">^") {
      int i = 2;
      for (;i<s.length()-1 && s.substr(i,2) == "Q="; i+=2) ;
      if (i>2 && s.substr(i,2) == "~~") {
        cout << "B";
        f++;
      }
    }
    if (f==0)
      cout << "NA";
    cout << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) a.begin(),a.end()
typedef complex<double> Point;
typedef pair<Point, Point> Line;
typedef vector<Point> VP;
const double EPS = 1e-9;
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)

vector<Line> tangentLines(Point a, double ar, Point b, double br) {
  vector<Line> ls;
  double d = abs(b-a);
  rep (i,2) {
    double sin = (ar - (1-i*2)*br) / d;
    if (!LE(sin*sin, 1)) break;
    double cos = sqrt(max(1 - sin*sin, 0.0));
    rep (j,2) {
      Point n = (b-a) * Point(sin, (1-j*2)*cos) / d;
      ls.push_back(Line(a + ar*n, b + (1-i*2)*br*n));
      if (cos < EPS) break;  // ??????????????\?????????????????????????????????????????????????????????
    }
  }
  return ls;
}

namespace std {
  bool operator<(const Point a, const Point b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
}

int main(void){
    double c1x,c1y,c1r,c2x,c2y,c2r;
    cin>>c1x>>c1y>>c1r>>c2x>>c2y>>c2r;
    vector<Line> ls = tangentLines(Point(c1x,c1y),c1r,Point(c2x,c2y),c2r);
    VP ps;
    for(auto l : ls){
        ps.push_back(l.first);
        ps.push_back(l.second);
    }
    sort(all(ps));
    ps.erase(unique(all(ps)),ps.end());

    for(auto p : ps){
        if(abs(abs(p-Point(c1x,c1y))-c1r)<EPS){
            printf("%.9f %.9f\n",p.X,p.Y );
        }
    }
    return 0;
}

Measured memory_bytes: 3360
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;

int main()
{
    int a,b,c,d;
    char z[4];
    for(int i = 0; i < 4; i++) cin >> z[i]; 
    a = z[0]-'0',b = z[1]-'0',c = z[2]-'0',d = z[3]-'0';

    for(int i = 0; i < 2; i++){
        for(int j = 0; j < 2; j++){
            for(int k = 0; k < 2; k++){
                int ans = 0;
                ans += a + (i % 2 ? b : -b) + (j % 2 ? c : -c) + (k % 2 ? d : -d);
                if(ans == 7){
                    cout << a << (i % 2 ? '+' : '-') << b << (j % 2 ? '+' : '-')
                         << c << (k % 2 ? '+' : '-') << d << "=7" << endl;
                    return 0;
                }
            }
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSR(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int n,p[5005];
ll dp[5005][5005],A,B;

int main(){
	cin>>n>>A>>B;
	for(int i=1;i<=n;i++) cin>>p[i];
	rep(i,5005)rep(j,5005) dp[i][j] = 1e18;
	dp[0][0] = 0;
	for(int i=1;i<=n;i++){
		for(int j=0;j<i;j++){
			if(dp[i-1][j] > 1e17) continue;
			if(p[j] < p[i]){
				dp[i][i] = min(dp[i-1][j],dp[i][i]);
			}
			if(p[j] < p[i]){
				dp[i][j] = min(dp[i-1][j]+A,dp[i][j]);
			}
			if(p[j] > p[i]){
				dp[i][j] = min(dp[i-1][j]+B,dp[i][j]);
			}
		}
	}
	ll ans = 1e18;
	for(int i=0;i<5005;i++) ans = min(ans,dp[n][i]);
	cout << ans << endl;
}

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

int main() {
  long N;
  cin >> N;
  vector<long> A(N);
  for (long i = 0; i < N; i++) cin >> A.at(i);
  long mx = A.at(0);
  long ans = 0;
  for (long i = 1; i < N; i++) {
    ans += max(0L, mx - A.at(i));
    mx = max(mx, A.at(i));
  }
  cout << ans << "\n";
}

Measured memory_bytes: 4744
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int A, B;
    cin >> A >> B;

    int outlet = 1, plug;
    for(plug=0;;plug++){
        if(outlet >= B)
            break;
        outlet--;
        outlet += A;
    }

    cout << plug << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimization ("Ofast")
#pragma GCC optimization ("unroll-loops")
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
 
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;
}
constexpr int mod = 1e9+7;
constexpr long long inf = 3e18;

signed main(){
	cin.tie(0);ios::sync_with_stdio(false);
	string S;cin>>S;
	if(S.back()=='s')S+="es";
	else S+="s";
	cout<<S<<"\n";
}

Measured memory_bytes: 3608
#include <iostream>
#include <bitset>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>

using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vec2bool vector<vector<bool>>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s >= 0;s--)

int main()
{
	ll n, k, ans = 0;
	string s;
	bool flag = false;

	cin >> n >> k;

	vecll a(n);
	vecbool check(n, false);
	vecbool check2(n, false);

	forll(i, 0, n)
		cin >> a[i];

	ll buf1, buf2, point = 1, count = 0, fin, start;

	while (!flag)
	{
		count++;
		check[point - 1] = true;
		point = a[point - 1];
		if (check[point - 1])
		{
			flag = true;
			buf1 = count;
		}
	}
	count = 0;
	flag = false;
	start = point;
	while (!flag)
	{
		count++;
		check2[point - 1] = true;
		point = a[point - 1];
		if (check2[point - 1])
		{
			flag = true;
			buf2 = count;
		}
	}
	if (k < buf1)
	{
		fin = k;

		point = 1;
		forll(i, 0, fin)
		{
			point = a[point - 1];
		}
	}
	else
	{
		fin = (k - buf1) % buf2;

		point = start;
		forll(i, 0, fin)
		{
			point = a[point - 1];
		}
	}

	cout << point;

}


Measured memory_bytes: 4816
while True:
  H, W = map(int, raw_input().split())
  if H == 0 and W == 0:
    break
  for i in range(H):
    if i%2 == 0:
      if W%2 == 0:
        print "#."*(W/2)
      else:
        print "#."*(W/2) + "#"
    else:
      if W%2 == 0:
        print ".#"*(W/2)
      else:
        print ".#"*(W/2) + "."
  print ""

Measured memory_bytes: 6444
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	int n;
	int i,j;
	while(scanf("%d",&n),n)
	{
		char* data = (char*)malloc(sizeof(char)*101);
		char* tmp = (char*)malloc(sizeof(char)*201);
		scanf("%s",data);
		for(i = 0;i < n;i++)
		{
			int length = 0;
			char old = data[0];
			int count = 1;
			for(j = 1;j <= strlen(data);j++)
			{
				if(data[j] == old)
				{
					count++;
				}
				else
				{
					length += sprintf(tmp+length,"%d%c",count,old);
					old = data[j];
					count = 1;
				}
			}
			tmp[length]='\0';
			data = realloc(data,sizeof(char)*(length+1));
			data = strcpy(data,tmp);
			tmp = realloc(tmp,sizeof(char)*(2*length+1));
		}
		printf("%s\n",data);
	}
	return 0;
}

Measured memory_bytes: 552
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
const ll mod = 1e9+7;
#define INFL 0x3f3f3f3f3f3f3f3fLL
 
//-------------------------<MATH>-------------------------------------------------------//
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll expo(ll base,ll pow){ll ans = 1;
   while(pow!=0){if(pow&1==1){ans = ans*base;ans = ans%mod;}
   base *= base;base%=mod;pow/=2;}return ans;}
ll inv(ll x){return expo(x,mod-2);}
ll mult_mod(ll a , ll b){a = a%mod; b = b%mod;
ll c = (a * b)%mod;
//cout << a << " " << b << endl;
return c;}
ll add_mod(ll a , ll b){a = (a + mod)%mod;b = (b + mod)%mod;ll c = (a + b)%mod;return c;}
ll fac[(int)(5e5 + 5)] , inv_fac[(int)(5e5 + 5)];
void precomp_factorial(int M){fac[0] = 1;for(int i = 1 ; i <= M ; i++) fac[i] = mult_mod(i , fac[i - 1]);
    inv_fac[M] = inv(fac[M]);for(int i = M - 1 ; i >= 0 ; i--) inv_fac[i] = mult_mod(i + 1 , inv_fac[i + 1]);}
ll nCk(ll n , ll k){ll ans = fac[n];ans = mult_mod(ans , inv_fac[n - k]);ans = mult_mod(ans , inv_fac[k]);return ans;}
int lo[(int)(1e3 + 6)];
void sieve(int M){for(int i = 2 ; i < M ; i++){ if(lo[i]) continue; for(int j = i ; j < M ; j += i)lo[j] = i;}}
int max_expo_prime_n_fac(ll N , int prime){int ress = 0;while(N){ress += (N/prime);N /= prime;}return ress;}
//-------------------------</MATH>-------------------------------------------------------//
 
//-------------------------<STRING>-------------------------------------------------------//
string get_prefix(string x , int MAX){return x.substr(0 , min((int)x.size() , MAX));}
string get_suffix(string x,int MAX){int dn=1;for(int i=x.size()-1;i>=0;i--){if(dn==MAX)return x.substr(i);dn++;}return x;}
string convert_to_binary(int x,int len) {string ans=""; while(x){if(x&1){ans='1'+ans;}
    else{ans ='0'+ans;}x/=2;}int k = ans.size();while(k < len){ans = '0' + ans;k++;}return ans;}
//-------------------------</STRING>-------------------------------------------------------//
 
ull llrand() {ull r = 0;for(int i = 0; i < 5; ++i){r = (r << 15)|(rand() & 0x7FFF);}return r & 0xFFFFFFFFFFFFFFFFULL;}
int dx[8] = {1 , 0 , -1 , 0 , 1 , -1 , -1 , 1};    // last 4 diagonal
int dy[8] = {0 , 1 , 0 , -1 , 1 , 1 , -1 , -1};
 
const int SZ = 2345678;


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

    if(k%2 == 0){
        cout << -1;
        return 0;
    }

    int cur = 1, rem = 7%k;
    set <int> se;
    se.insert(rem);
    while(1 && rem){
         rem = (10*rem+7)%k;
         cur++;
         if(rem == 0) break;
         if(se.count(rem)){
             cout << -1;
             return 0;
         }
         se.insert(rem);
    }
    cout << cur;
 }


Measured memory_bytes: 50472
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

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

    sort(a.begin(), a.end());
    // true: first move win
    // false: second move win
    vector<bool> dp(k + 1, false);
    dp[0] = false;
    for (int i = 1; i <= k; i++) {
        int pos = -1;
        while (pos + 1 < n && a[pos + 1] <= i)
            pos++;
        if (pos == -1)
            dp[i] = false;
        bool ret = false;
        for (int j = 0; j <= pos; j++) {
            if (!dp[i - a[j]])
                ret = true;
        }
        dp[i] = ret;
    }
    cout << (dp[k]?"First":"Second") << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  int64_t Y;
  cin >> N >> Y;
  
  for ( int i = 0 ; i <= N ; i++){
    for( int j = 0; j <= N -i ; j++){
      int temp = 10000 * i + 5000 * j + 1000 * ( N - i - j);
      if( temp == Y){
        cout << i << " " << j << " " << (N - i - j) << endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    int R, G, B, N;

    scanf("%d %d %d %d", &R, &G, &B, &N);

    int sum = 0;
    int tmp_N = 0;

    int ans_count = 0;
    for (int i = 0; i <= N; i++) {
        if (R * i > N)
        {
            continue;
        }
        for (int j = 0; j <= N; j++) {
            tmp_N = N;
            sum = R * i + j * G;
            tmp_N -= sum;

            if (tmp_N < 0) {
                continue;
            }

            if (tmp_N % B == 0)
            {
                // printf("%d%d\n", i, j);
                ans_count++;
            }
        }
    }

    printf("%d", ans_count);
    return 0;
}

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

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(c) (c).begin(), (c).end()

template <class T, class Compare>
vector<int> sort_index(const vector<T>& v, Compare comp) {
    vector<int> index(v.size());
    REP(i, v.size()) index[i] = i;
    sort(ALL(index), [&](int i, int j) { return comp(v[i], v[j]); });
    return index;
}

int main() {
    int N; cin >> N;
    vector<int64_t> A(N);
    REP(i, N) cin >> A[i];

    auto index = sort_index(A, greater());

    // dp[L][R] = 左にL人、右にR人配置したときの嬉しさの最大値
    vector dp(N+1, vector(N+1, int64_t()));
    REP(L, N+1) REP(R, N-L+1) {
        if (L == 0 && R == 0) {
            dp[L][R] = 0;
        } else {
            auto k = index[L+R-1];
            int64_t vl = L >= 1 ? dp[L-1][R] + A[k] * abs(k+1 - L)
                                : numeric_limits<int64_t>::min();
            int64_t vr = R >= 1 ? dp[L][R-1] + A[k] * abs(k+1 - (N-R+1))
                                : numeric_limits<int64_t>::min();
            dp[L][R] = max(vl, vr);
        }
    }

    int64_t ans = numeric_limits<int64_t>::min();
    REP(L, N+1) ans = max(ans, dp[L][N-L]);
    cout << ans << '\n';
}


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

}

Measured memory_bytes: 1800
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    s = S()
    rgb = ["R","G","B"]
    rgb_st = set(rgb)
    rgb_acc = [[0]*n for _ in range(3)]
    index = rgb.index(s[0])
    rgb_acc[index][0] += 1
    ans = 0

    for i in range(1,n):
        for j in range(3):
            rgb_acc[j][i] = rgb_acc[j][i-1]
        index = rgb.index(s[i])
        rgb_acc[index][i] += 1
    
    for i in range(n-2):
        for j in range(i+1,n-1):
            if s[i] != s[j]:
                ex = (rgb_st-{s[i],s[j]}).pop()
                index = rgb.index(ex)
                cnt = rgb_acc[index][-1] - rgb_acc[index][j]
                if j<2*j-i<n:
                    if s[2*j-i] == ex:
                        cnt -= 1
                ans += cnt
    print(ans)
main()


Measured memory_bytes: 93116
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      x = a*500+b*100+c*50
      if x == X:
        ans += 1
        break
      elif x > X:
        break
        
print(ans)

Measured memory_bytes: 40432
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
using vl = vector<ll>;
using Map = map<ll,ll>;
using T = tuple<ll,ll,ll>;
using vvl = vector<vector<ll>>;
#define all(v) v.begin(), v.end()
#define prt(v) cout<<(v)<<"\n";
#define fi(v) get<0>(v)
#define se(v) get<1>(v)
#define th(v) get<2>(v)
#define endl "\n"
template <typename T> bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template <typename T> bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;}
const ll INF=1LL<<60;
const ll MOD=1000000007;

//dp[i][j]はi個使い和がjのもの
vector<vector<ll>> dp(51, vector<ll>(2501, 0));

signed main(void){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll n=s.size();
    if(n==2){
        if(s[0]==s[1]){prt("1 2")return 0;}
        else prt("-1 -1")return 0;
    }
    for(ll i=0;i<n-2;++i){
        if(s[i]==s[i+1]||s[i+1]==s[i+2]||s[i]==s[i+2]){
            cout<<i+1<<" "<<i+3<<endl;return 0;
        }
    }
    prt("-1 -1")
    
    return 0;
}


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

int main() {
    int N;
    cin >> N;
    N--;
    vector<int> C(N), S(N), F(N);
    rep(i, N) {
        cin >> C[i] >> S[i] >> F[i];
    }

    rep(i, N) {
        int ans = 0;
        for (int j = i; j < N; j++) {
            if (ans > S[j]) { // 最初の列車が出発していたら
                if ((ans - S[j]) % F[j]) ans += F[j] - (ans - S[j]) % F[j]; // 次の電車の時間まで待つ
            } else {
                ans = S[j]; // 最初の列車が出発する時間までまつ
            }
            ans += C[j]; // 次の駅へ
        }

        cout << ans << endl;
    }

    cout << 0 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

int main()
{
  ll K, X;
  cin >> K >> X;

  cout << ((500 * K >= X) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
/* Maximam Profit */
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
  int n;
  cin >> n;
  long long min_price, max_profit = -1000000001;
  cin >> min_price;
  for (int i = 1; i < n; i++) {
    long long v;
    cin >> v;
    max_profit = max(max_profit, v - min_price);
    min_price = min(min_price, v);
  }

  cout << max_profit << endl;
  return 0;
}


Measured memory_bytes: 1168
#include<bits/stdc++.h>
using namespace std;
int n,m,ans,cnt,a[1005],b[1005];
string s;
int main()
{
	cin>>n>>m;
	if(n+m==15)
	cout<<"+";
	else if(n*m==15)
	cout<<"*";
	else
	cout<<"x";
    return 0;
	} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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 repa(i,a,n) for(int i=(a); i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
#define COUT(x) cout<<(x)<<endl
#define YES(x) cout<<(x?"YES":"NO")<<endl
#define Yes(x) cout<<(x?"Yes":"No")<<endl
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using psi = pair<string, int>;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};
const int mod = 1e9+7;
int gcd(int a, int b){if(a%b == 0){return(b);}else{return(gcd(b, a%b));}}
int lcm(int a, int b){return a / gcd(a, b)*b;}

int N, M, K, H, W, L, R, X;
//string S, T;

signed main(){
  cin >> N;
  vi a(100,0);
  rep1(i,10){
    rep1(j,10){
      a[i*j] = 1;
    }
  }
  Yes(a[N]);
  return 0;
}


Measured memory_bytes: 3648
using System;

class Atcoder83
{
    public static void Main()
    {
        string s = Console.ReadLine();
        int addition = CountChar(s, 'o');

        Console.WriteLine(700 + addition * 100);
    }

    public static int CountChar(string s, char c)
    {
        int countif = s.Length - s.Replace(c.ToString(), "").Length;
        return countif;
    }
}

Measured memory_bytes: 11092
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

#[derive(Hash, Eq, PartialEq, Debug)]
struct P {
    x: usize,
    y: usize
}

use std::collections::HashMap;

fn main() {
    let (h, w, n) = get!(usize, usize, usize);
    let mut ps = HashMap::new();
    for _ in 0..n {
        let (a, b) = get!(usize, usize);
        for y in a-1 .. a+2 {
            for x in b-1 .. b+2 {
                if 1 < x && x < w && 1 < y && y < h {
                    *ps.entry(P { x: x, y: y }).or_insert(0) += 1;
                }
            }
        }
    }
    let mut rs = vec![0; 10];
    let mut c = 0;
    for (_, n) in ps {
        c += 1;
        rs[n] += 1;
    }
    rs[0] = (h-2) * (w-2) - c;
    for r in rs { println!("{}", r) }
}

Measured memory_bytes: 53320
#include <iostream>
using namespace std;
int main(void){
    int n, x, i, j, k, count;

    while(1){
        count=0;
        cin >> n >> x;
        if(n == 0 && x == 0) break;
        for(i=1; i<=n; i++){
            for(j=i+1; j<=n; j++){
                for(k=j+1; k<=n; k++){
                    if(i+j+k == x) count++;
                }
            }
        }
    cout << count << endl;
    }
    return 0;
}


Measured memory_bytes: 3068
/*input
1 100 1
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ld double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=5e5+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
ll mult(ll a,ll b){
    return (a*b)%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
int main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int a,b,c,n,x,y;
    string s;
    cin>>a>>b>>x;
    int ans=0;
    for(;a<=b;a++){
        if(a%x==0) ++ans;
    }
    cout<<ans;
}

Measured memory_bytes: 3632
N = int(input())

F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for i in range(N)]
ans = -10**9

for i in range(1,2**10):
  tmp = 0
  c = [0] * N
  for j in range(10):
    if (i >> j)& 1:
      for k in range(N):
        if F[k][j] == 1:
          c[k] += 1
  for l in range(N):
    tmp += P[l][c[l]] 
  ans = max(tmp, ans)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int h,w;
int main() {
	// your code goes here
	cin>>h>>w;
	vector<string>v(h);
    for(int i=0;i<h;++i)
    cin >>v[i];
    for(int i=0;i<w+2;++i)
    cout<<"#";
    cout<<endl;
    for(int i=0;i<h;++i)
    cout<<"#"<<v[i]<<"#"<<endl;
     for(int i=0;i<w+2;++i)
    cout<<"#";
    cout<<endl;
	return 0;
	
}

Measured memory_bytes: 256
#if __has_include("../library/Basic/Debug.hpp")

#include "../library/Basic/Debug.hpp"

#else

/* ----- Header Files ----- */
// IO
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm
#include <algorithm>
#include <cmath>
#include <numeric>

// container
#include <vector>
#include <string>
#include <tuple>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>

// others
#include <random>
#include <limits>
#include <functional>
#include <ctime>
#include <cassert>
#include <cstdint>


/* ----- Type Alias ----- */
using Bool = bool;
using Int = long long int;
using Real = long double;
using Char = char;
using String = std::string;
template <class T, class U>
using Pair = std::pair<T, U>;
template <class... Ts>
using Tuple = std::tuple<Ts...>;

template <class T>
using Vector = std::vector<T>;
template <size_t N>
using Bits = std::bitset<N>;
template <class T>
using Queue = std::queue<T>;
template <class T>
using Stack = std::stack<T>;
template <class T>
using Deque = std::deque<T>;

template <class T>
using MaxHeap = std::priority_queue<T>;
template <class T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T>
using Set = std::set<T>;
template <class T, class U>
using Map = std::map<T, U>;

template <class T, class... Us>
using Func = std::function<T(Us...)>;

template <class T>
T genv(T v) { return v; }

template <class T, class... Ts>
auto genv(size_t l, Ts... ts) {
    return Vector<decltype(genv<T>(ts...))>(l, genv<T>(ts...));
}

template <class Cost = Int>
struct Edge {
    Int src, dst;
    Cost cost;
    Edge(Int src = -1, Int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = Int>
using Edges = Vector<Edge<Cost>>;
template <class Cost = Int>
using Graph = Vector<Vector<Edge<Cost>>>;

#endif

/* ----- Misc ----- */
void fastio() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}

struct Fout {
    Int precision;
    Fout(Int precision) : precision(precision) {}
};
std::ostream& operator<<(std::ostream& os, const Fout& fio) {
    os << std::fixed << std::setprecision(fio.precision);
    return os;
}


/* ----- Constants ----- */
// constexpr Int INF = std::numeric_limits<Int>::max() / 3;
// constexpr Int MOD = 1000000007;
// constexpr Real PI = acos(-1);
// constexpr Real EPS = 1e-10;
// std::mt19937 mt(int(std::time(nullptr)));

int main() {
    Int a, b, c;
    std::cin >> a >> b >> c;
    std::cout << std::max(0LL, c - (a - b)) << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
int main(){
  long n;
  cin >> n;
  if(n % 2 == 0){
	cout << n << endl;
  }
  else{
	cout << n*2 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int r = in.nextInt();
            int ans = 3 * r * r;
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 21460
#include<iostream>
using namespace std;
int main()
{
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if (x - r >= 0 && x + r <= W && y - r >= 0 && y + r <= H)
	{
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 3088
from sys import stdin
from decimal import *
N = int(stdin.readline().rstrip())
sp = [stdin.readline().split() for i in range(N)]
# print(sp)
sum = Decimal(0)
bitcoin = Decimal(380000.0)
for i in range(N):
    sp[i][0] = Decimal(sp[i][0])
    # print(sp[i][0])
    if sp[i][1] == 'JPY':
        sum += sp[i][0]
    else:
        sum += sp[i][0] * bitcoin
print(sum)

Measured memory_bytes: 5076
#include <iostream>
#include <vector>
#include <iomanip>
#include <stack>
#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iterator>
#include <ios>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <time.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define SORT(v) sort((v).begin(),(v).end())
#define TEMP(type,x,y) do {temp temp=x,x=y,y=temp}while(0)
const ll INF = (1LL << 50);
typedef pair<int, int> P;

typedef struct _city {
	int p;
	ll year;
	int num;
}city;

bool cmp(const city &a, const city &b) {
	return a.p == b.p ? a.year < b.year : a.p < b.p;
}

int main() {

	int N, M;
	cin >> N >> M;

	vector<city>a(M);
	REP(i, M) {
		cin >> a[i].p >> a[i].year;
		a[i].num = i;
	}

	sort(a.begin(), a.end(), cmp);

	vector<P>ans(M);

	int c = 1;
	for (int i = 0; i < M-1; i++) {
		if (a[i].p == a[i+1].p) {
			ans[a[i].num].second = c;
			ans[a[i].num].first = a[i].p;
			c++;
		}
		else {
			ans[a[i].num].second = c;
			ans[a[i].num].first = a[i].p;
			c = 1;
		}
	}

	ans[a[M - 1].num].second = c;
	ans[a[M - 1].num].first = a[M - 1].p;

	REP(i, M) {
		cout << setfill('0') << right << setw(6) << ans[i].first;
		cout << setfill('0') << right << setw(6) << ans[i].second;
		cout << endl;
	}

	return 0;

}

Measured memory_bytes: 4608
#include <iostream>
#include <math.h>
using namespace std;

double calcHour(int s);
double calcMin(int s);
double calcS(int s);

int main(int argc, const char * argv[]) {
    int s;
    cin >> s ;
    cout << calcHour(s) <<  ":" << calcMin(s) <<  ":" << calcS(s) << endl;
    return 0;
}

double calcHour(int s){
    return floor(s/3600);
}

double calcMin(int s){
    
    
    return floor((s % 3600) / 60);
}

double calcS(int s){
    return s % 60;
}

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

#define db(x) cout<<x<<'\n'
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define repi(i,n) for(int i=0;i<(n);++i)
//#define repA(i,a,n) for(int i=a;i<=(n);++i)
//#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define ll long long int
#define endl '\n'
#define lld long long double
#define vi vector<int> 
#define vl vector<ll> 
#define vb vector<bool> 
#define vvi vector<vector<int>  >
#define err(t) cout<<"Error : "<<t<<endl;
#define all(v) v.begin(),v.end()
#define mp make_pair
#define M 100000
#define MD 1000000007
#define pb push_back
#define rep(i,a,b) for(ll i = a; i <= (b); i++)
#define pii pair<int,int>
#define pll pair<ll,ll> 
#define vec(a) vector<a >
#define se second
#define fi first
#define inf 0xffffffff
#define inchar getchar_unlocked
#define outchar(x) putchar_unlocked(x)

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	// int n;cin>>n;
	// string s;cin>>s;
	
	//ll n;cin>>n; vl a(n); repi(i,n) cin>>a[i];
	int a,b,c,d;

	cin>>a>>b>>c>>d;
	bool ch=true;int i=1;
	while(a>0&&c>0){
		if(i&1){
			c-=b;
		}
		else{
			a-=d;
		
		}
		i++;
		if(a<=0) ch=false;
		else ch=true;
	}
	if(ch) cout<<"Yes\n"; else cout<<"No\n";	
	/*
	int q;cin>>q;while(q--){ 
		
	 }
	 //*/
return 0;
}



Measured memory_bytes: 3648
n = int(input())
a_b = []
for i in range(n):
    a_b.append(list(map(int, input().split())))
a_b.sort(key=lambda x: x[1], reverse=True)
c_d = []
for i in range(n):
    c_d.append(list(map(int, input().split())))
c_d = sorted(c_d)
ans = 0
for c, d in c_d:
    for a, b in a_b:
        if a < c and b < d:
            a_b.remove([a, b])
            ans += 1
            break
print(ans)


Measured memory_bytes: 3064
from functools import reduce
from operator import mul
import itertools
N = int(input())
x = [input() for _ in range(N)]
M = len([m for m in x if m.startswith('M')])
A = len([a for a in x if a.startswith('A')])
R = len([r for r in x if r.startswith('R')])
C = len([c for c in x if c.startswith('C')])
H = len([h for h in x if h.startswith('H')])
y = [M,A,R,C,H]
yy = [i for i in y if i > 0]
yl = len(yy)
s = 0
if yl < 3:
    print(0)
    exit()
else:
    for o in itertools.combinations(yy,3):
        s += reduce(mul,o)
    print(s)

Measured memory_bytes: 11168
n = int(input())
s = list(map(int, input().split()))
ss = list(i for i in range(1, n + 1))
cnt = 0
flag = False
for i in range(n):
    if s[i] == ss[i]:
        cnt += 1
    if cnt >= n - 2:
        flag = True
    else:
        flag = False

print("YES") if flag else print("NO")


Measured memory_bytes: 3060
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	vector<pii> A;
	REP(i, N) {
		int a;
		cin >> a;
		A.push_back(pii(a, i));
	}
	SORT(A);
	int ans = 0;
	REP(i, N) {
		if (A[i].second % 2 != i % 2)ans++;
	}
	cout << ans / 2 << endl;
		
	return 0;
}



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

namespace ConsoleApp1
{
    struct Works
    {
        public bool[] finishedworks;
        public int[] costs;
        public int[] limits;
        public int time;
        public int worknum;
        public bool[] availableworks;
        public bool failed;
    }


    class Program
    {
        static void Main(string[] args)
        {
            int num = int.Parse(Console.ReadLine());
            var s = Console.ReadLine().Split(' ');
            var ps = new int[num];
            for (int i = 0; i < num; i++)
            {
                ps[i] = int.Parse(s[i]);
            }
            int count = 0;
            for (int i = 1; i < num-1; i++)
            {
                if (ps[i-1] < ps[i] && ps[i] < ps[i + 1])
                {
                    count++;
                }
                else if (ps[i - 1] > ps[i] && ps[i] > ps[i + 1])
                {
                    count++;
                }
            }

            Console.WriteLine(count);



#if DEBUG
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
        }
    }
}


Measured memory_bytes: 11092
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n
# a, b
# s = input()


N, K, Q = map(int, input().split())
dp = [K-Q]*(N+1)

for _ in range(Q):
    A = int(input())
    dp[A] += 1

for i in range(1, N+1):
    if dp[i] <= 0:
        print("No")
    else:
        print("Yes")




Measured memory_bytes: 50904
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数

// デフォルト変数定義
double n,m,a,b,c,x,y,z;
double d,e,f;
string s,t;
//

signed main() {
  RAPID;
  IN2(a,n);
  OUT(floor((a*3+n)/2));
}

Measured memory_bytes: 256
a, b, k = gets.split.map(&:to_i)
arr = []

(a..b).each.with_index(0) do |e,i|
#   puts "#{i} #{a+i} #{b+i}"
  arr << a+i
  arr << b-i
  break if i == k-1
end

puts arr.sort!.uniq


Measured memory_bytes: 1788
#include<cstdio>
#include<cstring>
int main()
{
	char a[105], b[105];
	int l1 = 0 ,l2 = 0;
	scanf(" %s", a);
	scanf(" %s", b);
	l1 = strlen(a); l2 = strlen(b);
	if (l1 > l2) printf("GREATER");
	else if (l1 < l2) printf("LESS");
	else
	{
		for (int i = 0;i<l2; i++)
		{
			if (a[i] > b[i]) {
				printf("GREATER"); break;
			}
			else if (a[i] < b[i]) {
				printf("LESS"); break;
			}
			if (a[l2 - 1] == b[l2 - 1])  { printf("EQUAL"); break;}
		}
	}
	
	return 0;
}



Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>

using namespace std;

void solve(int N, int M, int C, vector<int> B) {
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int x = C;
    for (int j = 0; j < M; j++) {
      int a;
      cin >> a;
      x += a * B[j];
    }
    if (x > 0) {
      ans += 1;
    }
  }

  cout << ans << endl;
}

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  solve(N, M, C, B);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>

using namespace std;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define PRINT(str) printf(#str "\n")
#define yOUT PRINT(Yes)
#define nOUT PRINT(No)
#define YOUT PRINT(YES)
#define NOUT PRINT(NO)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

int main(){
	int a, b, k, cnt = 0;
	vector<int> ans(0);
	cin >> a >> b >> k;
	for(int i = 1; i <= max(a,b); i++){
		if(a % i == 0 && b % i == 0){
			cnt++;
			ans.pb(i);
		}
	}
	reverse(all(ans));
	cout << ans[k-1] << endl;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**9
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N = I()

    return 'ABC{}'.format(N)



print(main())



Measured memory_bytes: 5668
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;

int myceil(int x) {
  int rem = x % 10;
  if (rem == 0) {
    return x;
  }
  return x + 10 - rem;
}

int main() {
  int sum = 0;
  int mn = 10;
  for (int i = 0; i < 5; i++) {
    int x;
    cin >> x;
    sum += myceil(x);

    int rem = x % 10;
    if (rem > 0) {
      mn = min(mn, rem);
    }
  }

  if (mn != 10) {
    sum -= (10 - mn);
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define len(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "YES" << endl
#define pyes cout << "Yes" << endl
#define POK cout << "OK" << endl
#define PNO cout << "NO" << endl
#define pno cout << "No" << endl
#define PNG cout << "NG" << endl
#define ret return 0

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
ll f(ll a, ll x) {
  if (a >= 0)
    return a / x + 1;
  else
    return 0;
}

signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll a, b, x;
  cin >> a >> b >> x;
  cout << f(b,x) - f(a - 1,x) << endl;
  ret;
}


Measured memory_bytes: 3524
import collections
A, B = map(int, input().split())

def gcd(x,y):
  if y > x:
    x, y = y, x
  while x % y != 0:
    x, y = y, x % y
  return y

#print(gcd(660, 420))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

#print(prime_factorize(9))

if __name__ == "__main__":
  gcd = gcd(A, B)
  c = collections.Counter(prime_factorize(gcd))
  ans = len(c.keys()) + 1
  print(ans)

Measured memory_bytes: 3316
package main

import (
	"fmt"
	"strconv"
)

func main() {
	i := 0
	for {
		var x int
		fmt.Scan(&x)
		if x == 0 { break }
		i++
		fmt.Println("Case " + strconv.Itoa(i) + ": " + strconv.Itoa(x))
	}
}

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

#define ll long long
#define PB push_back
#define PII pair<int, int>
#define MP make_pair
#define all(x) x.begin(), x.end()
#define REP(x, y, z) for(int x = y; x <= z; x++)
#define REPP(x, y, z) for(int x = y; x >= z; x--)
#define F first
#define S second
#define MSET(x, y) memset(x, y, sizeof(x)) 
#define EB emplace_back
#define maxn

//structure

//declaration

//functions

int main(void)
{
	#ifdef DBG
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
	#endif

	int a, b;

	scanf("%d %d", &a, &b);

	if(a == 1 || a == 3 || a == 5 || a == 7 || a == 8 || a == 10 || a == 12)
	{
		if(b == 31)
			printf("1\n");
		else
			printf("0\n");
	}
	else if(a == 4 || a == 6 || a == 9 || a == 11)
	{
		if(b == 30)
			printf("1\n");
		else
			printf("0\n");
	}
	else
	{
		if(b == 28)
			printf("1\n");
		else
			printf("0\n");
	}

	scanf("%d %d", &a, &b);

	return 0;
}

Measured memory_bytes: 256