akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

typedef long double Real;
#define EPS 1e-13
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

#define INF 1145141919
#define MP make_pair<int,int>

int score[1141919];
// set<pii> S;
priority_queue<pii> Q;
int main(){
  int n,q;
  cin>>n>>q;
  Q.push(MP(0,INF-1));
  REP(_,q){
    int a,v;
    cin>>a>>v;
    score[a] += v;
    Q.push(MP(score[a],INF-a));
    while(!Q.empty()){
      pii P = Q.top();
      if(score[INF-P.second]!=P.first)Q.pop();
      else{
        printf("%d %d\n",INF-P.second,P.first);
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 6168
h, w = gets.split.map(&:to_i)
rows = h.times.map{gets.chomp}
rows.select! do |row|
  if row == ("." * w)
    false
  else
    true
  end
end
rows[0].length.times do |n|
  includeBlack = false
  rows.each do |row|
    if row[n] == "#"
      includeBlack = true
    end
  end
  if !includeBlack
    rows.each do |row|
      row[n] = "/"
    end
  end
end
rows.map do |row|
  puts row.tr("/", "")
end

Measured memory_bytes: 1788
#include"bits/stdc++.h"

using namespace std;

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

void Main()
{
	int w, h, x, y, r;
	cin >> w >> h >> x >> y >> r;
	if(0 <= x-r && x+r <= w && 0 <= y-r && y+r <= h){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}



Measured memory_bytes: 3216
H,W=map(int,input().split())
if H==1 or W==1:
    ans=1
else:
    if H%2==0 and W%2==0:
        ans=(H*W)//2
    elif H%2==0 and W%2==1:
        ans=(H//2)*W
    elif H%2==1 and W%2==0:
        ans=((H-1)//2)*W + W//2
    else:
        ans=((W+1)//2)+((H-1)//2)*W
print(ans)


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

constexpr long M = 2*1000+1;
int b[2000][1000];
int s[2001][1001];

inline long calc(long x, long y, long w, long h){
    return s[x+w][y+h] - s[x+w][y] - s[x][y+h] + s[x][y];
}

int main(void){
    long n, k;
    cin.sync_with_stdio(false);
    cout.sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n >> k;
    for(long i=0; i<n; i++){
        int x, y;
        char c;
        cin >> x >> y >> c;
        //scanf("%d %d %c", &x, &y, &c);
        y %= 2*k;
        if(c=='W'){
            x += k;
        }
        if(y>=k){
            y-=k;
            x+=k;
        }
        x %= 2*k;
        b[x][y]++;
    }
    s[1][1] = b[0][0];
    for(long i=1; i<2*k; i++){
        s[i+1][1] = s[i][1] + b[i][0];
    }
    for(long i=1; i<k; i++){
        s[1][i+1] = s[1][i] + b[0][i];
    }
    for(long x=1; x<2*k; x++){
        for(long y=1; y<k; y++){
            s[x+1][y+1] = b[x][y] + s[x][y+1] + s[x+1][y] - s[x][y];
        }
    }
    long max = 0;
    for(long x=0; x<k; x++){
        for(long y=0; y<k; y++){
            long t = calc(x, y, k, k-y);
            t += calc(0, 0, x, y);
            t += calc(x+k, 0, k-x, y);
            t = t<n/2 ? n-t : t;
            max = t>max ? t : max;
        }
    }
    cout << max;
    return 0;
}


Measured memory_bytes: 15872
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<long long, long long>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
const double PI = acos(-1);

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

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

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

bool fn_is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

bool isOK(int index, int key, vector<ll>& a) {
    if (a[index] >= key) return true;
    else return false;
}

int binary_search(int key, vector<ll>& a) {
    int ng = -1;
    int ok = a.size();

    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key, a)) ok = mid;
        else ng = mid;
    }
    return ok;
}

struct UnionFind {
    vector<int> r;

    UnionFind(int N) {
        r = vector<int>(N, -1);
    }

    int root(int x) {
        if (r[x] < 0) return x;
        return r[x] = root(r[x]);
    }

    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (r[x] > r[y]) swap(x, y);
        r[x] += r[y];
        r[y] = x;
        return true;
    }

    int size(int x) {
        return -r[root(x)];
    }

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

//素因数分解
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}
//const auto &pf = prime_factorize(i);
//for (auto p : pf) cout << p.first << " " << p.second;

long long pow(long long x, long long n) {
    long long ret = 1;
    while (n > 0) {
        if (n & 1) ret = ret * x % MOD;  // n の最下位bitが 1 ならば x^(2^i) をかける
        x = x * x % MOD;
        n >>= 1;  // n を1bit 左にずらす
    }
    return ret;
}

int main()
{
    double t,x; cin >> t >> x;
    printf("%lf\n", t/x);
    return 0;
}


Measured memory_bytes: 3784
n = int(input())
town = [list(map(int,input().split())) for _ in range(n)]
ans = 0
def dist(a,b,c,d):
	return ((a-c)**2+(b-d)**2)**0.5
for i in range(n):
	for j in range(n):
		ans += dist(town[i][0],town[i][1],town[j][0],town[j][1])
print(ans/(n))


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;

int main() {
  int X; cin >> X;
  for(int i = 0; i < X; ++i) {
    int N, M; cin >> N >> M;
    if(N*N + M*M <= 1) {
      cout << "C" << endl;
      continue;
    }
    vector<pair<int,int>> ans;
    for(int a = -200; a <= 200; ++a) {
      for(int b = -200; b <= 200; ++b) {
        int S = a*N + b*M;
        int T = a*M - b*N;
        int U = a*a + b*b;
        if(U == 0) continue;
        if(S % U == 0 && T % U == 0) {
          ans.emplace_back(a, b);
        }
      }
    }
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
    if(ans.size() == 8) {
      cout << "P" << endl;
    }
    else {
      cout << "C" << endl;
    }
  }
}

Measured memory_bytes: 1192
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
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;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B1 solver = new B1();
        solver.solve(1, in, out);
        out.close();
    }

    static class B1 {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            long x = s.nextLong();
            long amount = 100L;
            long rate = 101L;
            int count = 0;
            while (amount < x) {
                amount += amount / 100L;
                count++;
            }

            out.println(count);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 32584
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N = int(readline())
    S = readline().strip()

    ans = 0
    for n in range(1000):
        n = str(n).zfill(3)
        idx = 0
        for s in S:
            if s == n[idx]:
                idx += 1
                if idx == 3:
                    ans += 1
                    break

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 40796
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    int n=max(a,b);
    int cnt=0;
    for(int i=n;i>=1;i--){
        if(a%i==0&&b%i==0) cnt++;
        if(cnt>=c){
            cout<<i<<endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std;

int input[100005];
int cache[100005];

long long ans=0;

int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++) scanf("%d",&input[i]);
    if(n>=m) {printf("0\n");return 0;}
    sort(input+1,input+1+m);
    for(int i=1;i<=m-1;i++){
        ans+=input[i+1]-input[i];
        cache[i]=input[i+1]-input[i];
    }
    sort(cache+1,cache+m);
    for(int i=0;i<n-1;i++){
        ans-=cache[m-1-i];
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 896
#include <stdio.h>
#define DMAX 10
int main(void)
{
  int i, j, d, g, p[DMAX], c[DMAX], res, pcount, mpcount = 0;
  scanf("%d %d", &d, &g);
  for (i = 0; i < d; i++) {
    scanf("%d %d", &p[i], &c[i]);
    mpcount += p[i];
  }
  for (i = 0; i < 1 << d; i++) {
    res = pcount = 0;
    for (j = 0; j < d; j++) {
      if ((i >> j) & 1) {
        res += (d - j) * 100 * p[d-j-1] + c[d-j-1];
        pcount += p[d-j-1];
      }
    }
    if (res >= g) {
      if (pcount < mpcount) mpcount = pcount;
    } else {
      for (j = 0; j < d; j++) {
         if (!((i >> j) & 1)) {
           if (res + (d - j) * 100 * (p[d-j-1] - 1) >= g) {
             pcount += (g - res - 1) / ((d - j) * 100) + 1;
             if (pcount < mpcount) mpcount = pcount;
             break;
           } else {
             res += (d - j) * 100 * (p[d-j-1] - 1);
             pcount += p[d-j-1] - 1;
           }
         }
      }
    }
  }
  printf("%d\n", mpcount);
}

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

using namespace std;

int main(){

	ll n,k;
	cin >> n >> k;

	vector<ll> v(n);

	ll maxm = 0;
	for(int i = 0; i < n; i++){
		cin >> v[i];
		maxm = max(maxm,v[i]);
	}

	ll lo = 1, hi = maxm, mid;
	ll ans = 1e10;
	while(lo <= hi){
		mid = (lo + hi)/2;
		ll moves = 0;
		for(int i = 0; i < n; i++){
			if(v[i] < mid){
				continue;
			}
			if(v[i]%mid == 0){
				moves += v[i]/mid - 1;
			}
			else{
				moves += v[i]/mid;
			}
		}
		if(moves <= k){
			ans = min(ans,mid);
			hi = mid-1;
		}
		else{
			lo = mid+1;
		}
	}

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

Measured memory_bytes: 4732
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;++i)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const ll MOD = 1e9 + 7;

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

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

	vector<int>a(n);

	rep(i, 0, n) {
		cin >> a[i];
	}

	int ans = a[0];
	rep(i, 1, n) {
		ans = gcd(a[i], ans);
	}

	cout << ans << endl;
	

	return 0;
}

Measured memory_bytes: 640
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,k = map(int,input().split())
    s = input()
    ans = 0
    for i in range(n-1):
        if s[i]==s[i+1]:
            ans += 1
    ans = min(ans+2*k,n-1)
    print(ans)
    return

if __name__ == '__main__':
    main()

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

int main(){
  int A,B;  cin >> A >> B;
  string s; cin >> s;
  bool flag = true;
  for(int i = 0;i < s.size();i++){
    if(i == A and s[i] != '-')flag = false;
    if(i != A and s[i] == '-')flag = false;
  }

  if(flag)cout << "Yes" << endl;
  else cout << "No" << endl;

}


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

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

    int ans = 0;
    char current = '0';
    rep(i,n) {
        if ( current != s[i]) {
            ans += 1;
            current = s[i];
        }
    }

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


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

int main() {
    int n;
    //vector<int> a(n);
    //for (int i  = 0; i < n; i++) cin >> a.at(i);
//
    //bool can = false;
    //for (int i = 0; i < n; i++) {
    //    if (a.at(i) == 7) can = true;
    //}
    //if (can) cout << "Yes" << endl;
    //else cout << "No" << endl;
    cin >> n;
    bool can = false;
    int a = n / 100;
    n %= 100;
    int b = n / 10;
    n %= 10;
    int c = n;
    //cout << a << b << c ;
    if (a == 7 || b == 7 || c == 7) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
N=int(input())
D={}
for i in range(N):
    s=input()
    if s not in D:
        D[s]=1
    else:
        D[s]+=1
#print(D)
L=list(D.items())
#print(L)
ANS=[]
NUM=0
for i in range(len(L)):
    if L[i][1]<NUM:
        continue
    elif L[i][1]==NUM:
        ANS.append(L[i][0])
    elif L[i][1]>NUM:
        ANS=[L[i][0]]
        NUM=L[i][1]
ANS.sort()
for i in ANS:
    print(i)

Measured memory_bytes: 45784
/******************************\
*  Everyone has a different way of thinking, so God Created us
Hope You Respect My Way..,Thank You ):  *
*                            *
*   Created by : Murad   *
\******************************/
//std::transform(s1.begin(), s1.end(), s1.begin(),::tolower);
#include<iostream>
using namespace std;
#include<string>
#include<sstream>
#include<algorithm>
#include<functional>
#include<set>
#include<math.h>
#include<map>
#include<vector>
#include<list>
#define pi 3.1415926536
#define forn(i,a,b)for(int i=a;i<b;i++)
#define LL long long
#define MP make_pair
#define fi first
#define se second
#define INF 2147483647
#define _INF -2147483647
#define pq priority_queue
#define MM multimap
#define PB push_back
#define ipair pair<int,int>
#define lpair pair<LL,LL>
#define MAXN 100004
#define El3zba ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define modd 1000000007
LL MMIN(LL a, LL b)
{
	if (a <= b)
		return a;
	else
		return b;
}
LL MMAX(LL a, LL b) {
	if (a >= b)
		return a;
	else
		return b;
}
int main()
{
	string s;
	cin >> s;
	int ans = 0;
	for (int i = 1; i < s.length(); i++)
	{
		if (s[i] == '1'&&s[i - 1] == '0')continue;
		else if (s[i] == '0'&&s[i - 1] == '1')continue;
		else if (s[i] == '1'&&s[i - 1] == '1')ans++,s[i]='0';
		else if (s[i] == '0'&&s[i - 1] == '0')ans++,s[i]='1';
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
N = int(input())
W_i = list(map(int, input().split()))

output = max(W_i)

for i in range(1, N):
    S_1 = 0
    S_2 = 0
    for j in range(i):
        S_1 += W_i[j]
    for j in range(i, N):
        S_2 += W_i[j]
    if output > abs(S_1 - S_2):
        output = abs(S_1 - S_2)

print(output)


Measured memory_bytes: 3060
import math
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x.sort()
diff=[x[i+1]-x[i] for i in range(N)]

ans=diff[0]

for i in range(1,N):
    ans=math.gcd(ans,diff[i])

print(ans)

Measured memory_bytes: 20528
#include<cstdio>

int main(){
    int A, B, C, D;
    int sum=0;
    bool a[110], b[110];
    for(int g=0;g<=100;g++){
        a[g] = false;
        b[g] = false;
    }
    scanf("%d%d%d%d",&A,&B,&C,&D);
    for(int i=A;i<=B;i++)
        a[i] = true;
    for(int j=C;j<=D;j++)
        b[j] = true;
    for(int f=0;f<=100;f++)
    if(a[f]==true&&b[f]==true)
        sum++;
    if(sum!=0)
        printf("%d\n",sum-1);
    else
        printf("0\n");
    return 0;
}

Measured memory_bytes: 128
//
// ~oisín~ C++ Template
//

#include                <bits/stdc++.h>
#define MX_N            5001
#define mp              make_pair
#define mod7            1000000007
#define modpi           314159
#define PI              3.141592653589793238
#define pb              push_back
#define FastIO          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define All(a)          a.begin(),a.end()
#define fi              first
#define se              second
#define ll              long long int
#define ull             unsigned long long int

int kx[8]  =            {+2, +2, -2, -2, +1, +1, -1, -1};
int ky[8]  =            {+1, -1, +1, -1, +2, -2, +2, -2};
int d9x[9] =            {+1, +1, +1, +0, +0, +0, -1, -1, -1};
int d9y[9] =            {+1, +0, -1, +1, +0, -1, +1, +0, -1};
int dx4[4] =            {+0, +0, +1, -1};
int dy4[4] =            {+1, -1, +0, +0};

ll gcd(ull a, ull b){
    return (a==0)?b:gcd(b%a,a);
}

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

const long long INF = 1e18;

using namespace std;

ll mod;

inline void modulo(ll& tmp){
    if(tmp >= mod){
        tmp %= mod;
    }
}

ll binpow(ll base, ll expo){
    modulo(base);
    if(expo == 0){
        return 1ll;
    }else if(expo == 1){
        return base;
    }
    ll tmp = binpow(base, expo/2ll);
    tmp *= tmp;
    modulo(tmp);
    if(expo % 2){
        tmp *= base;
        modulo(tmp);
    }
    return tmp;
}

int main(){
    cin >> mod;
    if(mod % 2 == 0){
        cout << "-1\n";
        return 0;
    }
    if(mod % 5 == 0){
        cout << "-1\n";
        return 0;
    }
    ll cur = 7ll;
    modulo(cur);
    ll p = 1ll;
    while(true){
        if(cur == 0){
            cout << p << endl;
            return 0;
        }
        ll tmp = binpow(10ll, p);
        tmp *= 7ll;
        modulo(tmp);
        cur += tmp;
        modulo(cur);
        ++p;
    }
}


Measured memory_bytes: 3560
# frozen_string_literal: true

x = gets.to_i

score =  if x >= 1800
      1
elsif x >= 1600
  2
elsif x >= 1400
  3
elsif x >= 1200
  4
elsif x >= 1000
  5
elsif x >= 800
  6
elsif x >= 600
  7
elsif x >= 400
  8
end

puts score


Measured memory_bytes: 14368
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

template <std::uint_fast64_t Modulus>
class modint {
  using u64 = std::uint_fast64_t;

 public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept
      : a(x % Modulus) {
  }
  constexpr u64 &value() noexcept {
    return a;
  }
  constexpr const u64 &value() const noexcept {
    return a;
  }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(const modint rhs) noexcept {
    return *this *= ~rhs;
  }
  constexpr modint operator^(u64 exp) const noexcept {
    modint v = 1, x = *this;
    while (exp) {
      if (exp & 1) {
        v *= x;
      }
      x *= x;
      exp >>= 1;
    }
    return v;
  }
  constexpr modint operator~() const noexcept {
    return *this ^ (Modulus - 2);
  }
};

using mint = modint<1000000007>;

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  const int M = 13;
  string S;
  while (cin >> S) {
    vector<mint> dp(M, mint(0));
    dp[0] = 1;
    for (char c : S) {
      vector<mint> ndp(M, mint(0));
      for (int d = 0; d < 10; d++) {
        if (c != '?' && (c - '0') != d) continue;
        for (int m = 0; m < M; m++) {
          ndp[(m * 10 + d) % M] += dp[m];
        }
      }
      dp = ndp;
    }
    cout << dp[5].value() << endl;
  }
  return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
const int MAXN = 500005;
char s[MAXN];
int fail[2][MAXN],n;
inline void getfail(int k)
{
	fail[k][1]=0;
	fail[k][0]=-1;
	int p=0;
	for(int i=2;i<=n;++i){
		while((~p) && s[p+1]!=s[i])p=fail[k][p];
		++p;
		fail[k][i]=p;
	}
}
inline bool check(int k,int i)
{
	return !fail[k][i] || i%(i-fail[k][i]);
}
int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	getfail(0);
	for(int i=1;i<=n/2;++i)swap(s[i],s[n-i+1]);
	getfail(1);
	if(n-fail[0][n]==1)cout<<n<<endl<<1<<endl;
	else if(!fail[0][n] || n%(n-fail[0][n]))cout<<1<<endl<<1<<endl;
	else {
		int ans=0;
		for(int i=1;i<=n;++i){
			if(check(0,i) && check(1,n-i))++ans;
		}
		cout<<2<<endl<<ans<<endl;
	}
}

Measured memory_bytes: 4608
#include <stdio.h>

int main(){
	float x1,y1,x2,y2,x3,y3,x4,y4;
	float del1,del2;
	
	int n;
	scanf("%d",&n);
	int i;
	
	for(i = 0;i < n;i++){
		scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
	
		if(x1-x2 == 0&&x3-x4 == 0){
			printf("YES\n");
		}else if(x1-x2 == 0||x3-x4 == 0){
			printf("NO\n");
		}else{
			del1 = (y1-y2)/(x1-x2);
			del2 = (y3-y4)/(x3-x4);
		
			if(del1 == del2){
				printf("YES\n");
			}else{
				printf("NO\n");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1040
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int n;
    cin>>n;
    vector<P> a(n);
    rep(i,n){
        cin>>a[i].second>>a[i].first;
    }
    sort(btoe(a));
    int cnt=0;
    bool ok=true;
    rep(i,n){
        cnt+=a[i].second;
        if(cnt>a[i].first) ok=false;
    }
    cout<<(ok? "Yes": "No")<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
const int MAX=2e5;
const ll MOD=1e9+7;
const int INF=1<<30;

int main(){
  ll N,K,R,S,P;
  string T;
  cin >> N >> K >> R >> S >> P >> T;
  ll ans=0;
  int l=T.size();
  rep(i,l){
    if(i-K<0){
      if(T[i]=='r'){ans+=P;}
      else if (T[i]=='s') {ans+=R;}
      else if(T[i]=='p') {ans+=S;}
    }
    else{
      if(T[i]=='r'&&T[i-K]!='r') {ans+=P;}
      else if(T[i]=='r'&&T[i-K]=='r') {T[i]='x';}

      else if (T[i]=='s'&&T[i-K]!='s') {ans+=R;}
      else if(T[i]=='s'&&T[i-K]=='s') {T[i]='x';}

      else if(T[i]=='p'&&T[i-K]!='p') {ans+=S;}
      else if(T[i]=='p'&&T[i-K]=='p') {T[i]='x';}
    }
  }
  //cout << T << endl;
  cout << ans << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
	char bl[2],s;
	int m[4]={0,0,0,0};
	while(scanf("%d,%s",&s,bl)!=EOF) {
		getchar();
        if (bl[0]=='A') if (bl[1]=='B') m[2]++; else m[0]++;
		if (bl[0]=='B') m[1]++;
		if (bl[0]=='O') m[3]++;
	}
	for (s=0;s<4;s++) cout << m[s] << endl;
	return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,count=0;
    cin >> n;

    for(int i=1;i<=n;i++){
        if (i>=1 && i<10){
            count++;
        }else if (i>=100 && i<1000){
            count++;
        }else if (i>=10000 && i<100000) count++;
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string S;
    cin>>S;
    if(S=="Sunny")
        cout<<"Cloudy"<<endl;
    else if(S=="Cloudy")
        cout<<"Rainy"<<endl;
    else if(S=="Rainy")
        cout<<"Sunny"<<endl;
    std::cin.get();
}


Measured memory_bytes: 256
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}
//void chmin(ll &a,ll b){if(a>b) a = b ;}

int main(){
	ll n ; cin >> n ;
	vll a(n) ;
	for(int i=0;i<n;i++){
		cin >> a.at(i) ;
		a.at(i) -= i+1 ;
	}
	sort(all(a)) ;
	ll b = a.at(n/2) ;
	ll ans = 0 ;
	for(int i=0;i<n;i++) ans += abs(a.at(i)-b) ;
	cout << ans << endl ;
}


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

typedef long long ll;
int n;
ll ans;
vector<int> vec;

int main(){
	cin>>n;
	vec.resize(n);
	for(int i=0;i<n;++i)
		cin>>vec[i];
	sort(vec.begin(),vec.end());
	if(n&1){
		vector<int> tmp;
		for(int i=0;i<n;++i)
			tmp.push_back(abs(vec[i]-vec[n/2]));
		sort(tmp.begin(),tmp.end());
		for(int i=0;i<n;++i)
			ans+=(i<2?1:2)*tmp[i];
	}
	else
		for(int i=0;i<n;++i)
			ans+=(i==n/2||i==n/2-1?1:2)*abs(vec[i]-vec[n/2]);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1276
package main

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

var sc = bufio.NewScanner(os.Stdin)

func init() {
	const maxWord = (1 << 30)
	buf := []byte{}
	sc.Buffer(buf, maxWord)
	sc.Split(bufio.ScanWords)
}

func input() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	n, _ := strconv.Atoi(input())
	q, _ := strconv.Atoi(input())
	s := input()
	cnt := make([]int, n)
	for i := 0; i < n-1; i++ {
		cnt[i+1] += cnt[i]
		if s[i:i+2] == "AC" {
			cnt[i+1]++
		}
	}

	result := make([]int, q)
	for i := 0; i < q; i++ {
		left, _ := strconv.Atoi(input())
		right, _ := strconv.Atoi(input())
		result[i] = cnt[right-1] - cnt[left-1]
	}

	for i := 0; i < q; i++ {
		fmt.Println(result[i])
	}
}


Measured memory_bytes: 4992
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using namespace std;
//LLONG_MAX = 90^18
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No"); }
void Yes() { cout << "Yes"; }
void No() { cout << "No"; }

int N, M;
int H[100010];
vector<int> link[100010];

signed main()
{
	cin >> N >> M;
	REP(i, N) cin >> H[i];
	REP(i, M)
	{
		int a, b;
		cin >> a >> b;
		link[a - 1].push_back(b - 1);
		link[b - 1].push_back(a - 1);
	}

	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		bool is_good = true;
		for (int l : link[i])
		{
			if (H[i] <= H[l])
			{
				is_good = false;
			}
		}
		if (is_good)
		{
			ans++;
		}
	}

	cout << ans << endl;
}





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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
    int N,M,Q; cin>>N>>M>>Q;
    vector<vector<int>> X(N+1,vector<int>(N+1,0));
    vector<vector<int>> C(N+1,vector<int>(N+1,0));
    rep(i,M){
        int l,r; cin>>l>>r;
        X.at(l).at(r)++;
    }
    rep1(i,N){
        C.at(i).at(1)=X.at(i).at(1);
        for(int j = 2; j <= N; j++){
            C.at(i).at(j)=C.at(i).at(j-1)+X.at(i).at(j);
        }
    } 
    rep(i,Q){
        int p,q; cin>>p>>q;
        int res = 0;
        for(int j = p; j <= q; j++){
            res += (C.at(j).at(q)-C.at(j).at(p-1));
        }
        cout<<res<<endl;
    }
    return 0;
}


Measured memory_bytes: 2944
#include <cassert>
#include <iostream>
#include <functional>
#include <iomanip>
#include <set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <deque>
#include <algorithm>
#include  <cstring>
#include <string>
#include <cmath> 
using namespace std;
typedef long long LL;
const int MAX = 210000;
const LL base = 1e9 + 7;


struct Node {
	int x, y, w;
};

LL zv[110];
LL zw[110];

LL dp[MAX];

void solve() {

	LL result = 0;
	LL n,w;

	cin >> n>>w; 
	for (int i = 0; i < n; ++i) {
		cin >> zw[i] >> zv[i];
		for (int j = w - zw[i]; j >=0 ; --j) {
			int nw = zw[i] + j;
			dp[nw] = max(dp[nw], dp[j] + zv[i]);
		}
	}
	result = dp[w];
	cout << result << endl;

}

int main() {
	const int inId = 0;
	const int outId = 0;
	if (inId>0) {
		cerr << "redirect stdin to input " << inId << endl;
		string s = "input";
		s += to_string(inId);
		s += ".txt";
		auto r = freopen(s.c_str(), "r", stdin);	
		if (r == nullptr) {
			cerr<< "invalid input file "<< s;
		}
	}
	if (outId>0) {
		cerr << "redirect stdout to stdout " << outId << endl;
		string s = "stdout";
		s += to_string(outId);
		s += ".txt";
		auto r = freopen(s.c_str(), "w", stdout);
		if (r == nullptr) {
			cerr<< "invalid output file "<< s;
		}		
	}
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // close sync between cout and printf
	cout.precision(10);
	solve();
}
 

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>

using namespace std;

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

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

  vector<long long> A(N+1);
  for (int i = 1; i < N+1; ++i) cin >> A[i];

  vector<long long> left(N+2), right(N+2);
  left[0]      = 0, left[1]  = A[1];
  right[N + 1] = 0, right[N] = A[N];
  for (int i = 2; i < N+1; ++i)
  {
    left[i] = gcd(A[i], left[i - 1]);
    right[(N + 1) - i] = gcd(A[(N + 1) - i], right[(N + 1) - i + 1]);
  }

  long long gcd_max = 0;
  for (int i = 1; i < N+1; ++i)
  {
    int a;
    if (left[i - 1] == 0)       a = right[i + 1];
    else if (right[i + 1] == 0) a = left[i - 1];
    else                        a = gcd(left[i - 1], right[i + 1]);

    if (gcd_max < a) gcd_max = a;
  }

  cout << gcd_max << endl;
}

Measured memory_bytes: 2560
#include <iostream>

using namespace std;

int main()
{
	int x[5];
	int index = 0;
	for (int i = 0; i < 5; i++) {
		cin >> x[i];
		if (x[i] == 0)
			index = i + 1;
	}

	cout << index << endl;

	return 0;
}

Measured memory_bytes: 3628
#include <cstdio>

using namespace std;

int main() {
    int n, a, b;
    int sums = 0;
    scanf("%d %d %d", &n, &a, &b);
    for (int i = 1; i <= n; i++) {
       int some = i;
       int sum = 0;
       while (some > 0) {
           sum += some % 10;
           some /= 10;
       }
       if (sum >= a && sum <= b) {
           sums += i;
       }
    }
    printf("%d\n", sums);
    return 0;
}


Measured memory_bytes: 504
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();  // input Integer
    int b = sc.nextInt();  // input Integer
//    String a = sc.next();  // input String
    if (a<=5){
      System.out.println(0);
    } else if (a<=12) {
      System.out.println(b/2);
    } else {
      System.out.println(b);
    }
  }
}

Measured memory_bytes: 21076
//Date and time of submission: 
 
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e5+5;
ll n;
int main() {
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	cin>>n;
	if(n<1000)
	cout<<"ABC";
	else
	cout<<"ABD";
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

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

	ps := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&ps[i])
	}

	sort.Sort(sort.IntSlice(ps))
	ans := ps[n/2] - ps[n/2-1]
	fmt.Print(ans)
}


Measured memory_bytes: 5504
from operator import itemgetter

N = int(input())

ab = [[int(j) for j in input().split()] for i in range(N)]

cd = [[int(j) for j in input().split()] for i in range(N)]


def main():
    # y 降順
    ab.sort(key=itemgetter(1), reverse=True)

    # x 昇順
    cd.sort(key=itemgetter(0))

    # ペアになった赤
    done = [False] * N

    ans = 0

    for blue in cd:
        i = 0

        for red in ab:
            if not done[i] and red[0] < blue[0] and red[1] < blue[1]:
                done[i] = True
                ans += 1
                break

            i += 1

    print(ans)
    return


main()


Measured memory_bytes: 3064
#include <stdio.h>
#define MOD 1000000007

int main(void){
	long i, n, m;
	scanf("%ld %ld", &n, &m);
	long x, y;
	long sumx = 0;
	for(i = 0; i < n; i++){
		scanf("%ld", &x);
		sumx += x*(i*2-(n-1));
	}
	sumx %= MOD;
	long sumy = 0;
	for(i = 0; i < m; i++){
		scanf("%ld", &y);
		sumy += y*(i*2-(m-1));
	}
	sumy %= MOD;
	printf("%ld\n", sumx*sumy%MOD);

	return 0;
}


Measured memory_bytes: 128
#include <iostream>

 

using namespace std;

 

int main()
{
    int a, b;
    cin >> a >> b;
    if (a > b)
      cout << "a > b" << endl;
    else if (a < b)
      cout << "a < b" << endl;
    else
      cout << "a == b" << endl;    
}


Measured memory_bytes: 3076
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;
 
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;
}
using namespace std;

 
void solve(){
	ll x,y;
    cin>>x>>y;
    //数直線で考える
    if(x<y){
        if(y>=0)cout<<min(y-x,abs(abs(x)-y)+1)<<"\n";
        else cout<<y-x<<"\n";
    }
    else {
        if(x>=0)cout<<min(x-y+2,abs(abs(y)-x)+1+(y>0))<<"\n";
        else cout<<x-y+2<<"\n";
    }
}
 
signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

int main() {
  int x;
  cin >> x;
  if(x < 1200) print("ABC");
  else print("ARC");
}


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

#define int long long
const int MOD=1e9+7;


signed main(){
  int n,k;cin>>n>>k;
  int ans=0;
  for(int i=k;i<=n+1;i++)(ans+=(n+n-i+1)*i/2-(i-1)*i/2+1)%=MOD;
  if(ans<0)ans+=MOD;
  cout<<ans<<endl;
}



Measured memory_bytes: 3680
import java.io.*;
import java.util.*;
public class Main {
	static long MOD = 2 << 29;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		long A = sc.nextInt();
		long B = sc.nextInt();
		long C = sc.nextInt();
		long AD = A / 2;
		long BD = B / 2;
		long CD = C / 2;
		long ans = Math.abs(AD * B * C - (A - AD) * B * C);
		ans = Math.min(ans, Math.abs(A * BD * C - A * (B-BD) * C));
		ans = Math.min(ans, Math.abs(A * B * CD - A * B * (C-CD)));
		System.out.println(ans);
	}
	
	
	
	
}
 
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 boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public 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() {
        if (!hasNext()) throw new NoSuchElementException();
        int n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}

Measured memory_bytes: 8148
A, B = map(int,input().split())

def gcd(x, y):
    if y==0:return x
    else:
        return gcd(y, x%y)

def factorize(n):
    b = 2
    fct = []
    
    while b*b <=n:
        while n%b==0:
            n //=b
            fct.append(b)
        b+=1
    if n>1:fct.append(n)
    return fct
      
c = gcd(A, B)

print(len(set(factorize(c)))+1)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define ff              first
#define ss              second
#define int             long long int 
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define from(i,n)       for(int i=0;i<(int)n;i++)
#define from_j(i,j,n)   for(int i=j;i<(int)n;i++)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
 
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
 
int32_t main()
{
    c_p_c();
    string s; cin>>s;
    string s1="ABC";
    string s2 ="ARC";
    if(s==s1)cout<<s2;
    else cout<<s1;
    return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai arccos(-1);
#define keta(n) cout << fixed << setprecision((n));
#define ll long long;

int main(){
  double d,t,s;
  cin>>d>>t>>s;
  if(t>=d/s)cout<<"Yes";
  else cout<<"No";

}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll a[100002],b[100002];
int main() {
	ll n;
	cin>>n;
	for(ll i=0;i<=n;i++){
		cin>>a[i];
	}
	for(ll i=0;i<n;i++){
		cin>>b[i];
	}
	ll ans=0;
	for(ll i=0;i<n;i++){
		ll now=min(a[i],b[i]);
		ans+=now;
		b[i]-=now;
		if(b[i]>0){
			ll nex=min(b[i],a[i+1]);
			ans+=nex;
			a[i+1]-=nex;
		}
	}
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const int INF = 1000000000;
using namespace std;

const int MAX_V = 105;

void init(int m[MAX_V][MAX_V]){
    rep(i,MAX_V) rep(j,MAX_V) m[i][j] = INF;
    rep(i,MAX_V) m[i][i] = 0;
}

void warshallFloyd(int m[MAX_V][MAX_V], int n){
    rep(k,n){
        rep(i,n){
            rep(j,n){
                m[i][j] = min(m[i][j], m[i][k] + m[k][j]);
            }
        }
    }
}

bool check(int n, int g[MAX_V][MAX_V], pair<pair<int, int>,int> e){
    rep(i,n){
        rep(j,n){
            if(g[i][j] == g[i][e.first.first] + e.second + g[e.first.second][j]){
                return true;
            }
        }
    }
    return false;
}

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

    int g[MAX_V][MAX_V];
    vector<pair<pair<int, int>,int>> edge;
    init(g);
    rep(i,m){
        int a,b,c;
        cin >> a >> b >> c;
        a--; b--;
        edge.emplace_back(make_pair(make_pair(a,b),c));
        g[a][b] = g[b][a] = c;
    }
    warshallFloyd(g,n);

    int cnt = 0;
    for(auto it:edge){
        if(not check(n, g,it)) cnt++;
    }

    cout << cnt << endl;
}


Measured memory_bytes: 256