akhauriyash/Code-Regression huggingface dataset:
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a = read::<i32>();
    let b = read::<i32>();
    let h = read::<i32>();
    println!("{}", (a + b) * h / 2);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;

#define rep(i,x,y) for(int i=(x); i<(y); ++i)
const int INF = (1<<30);
const ll INFLL = 1LL<<62;
const long double EPS = 1e-12;

template <typename T>
void vec_print(vector<T> VEC){
  rep(i, 0, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  rep(i, 0, MAT.size()){
    rep(j, 0, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

class HOGE{
  public:
    ll index;
    ll value;
    HOGE(ll index, ll value){
      this->index = index;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "index : " << index << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  vector<ll> X(3);
  rep(i, 0, 3){
    cin >> X[i];
  }
  sort(X.begin(), X.end());

  ll ans = X[2] - X[1];
  X[0] += ans;
  ans += (X[2] - X[0])/2 + (ll)2*((X[2] - X[0])%2);

  cout << ans << "\n";

  return 0;
}

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

string S;

int main(){
  cin >> S;
  switch (S[S.size() - 1]){
    case '2':
    case '4':
    case '5':
    case '7':
    case '9':
      cout << "hon" << endl;
      break;
    case '0':
    case '1':
    case '6':
    case '8':
      cout << "pon" << endl;
      break;
    case '3':
      cout << "bon" << endl;
      break;
  }
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
  int main(){
    cout << fixed << setprecision(12);

    int a,b;
    cin>>a>>b;
    
 
    cout<< a / b <<" ";
    cout<< a % b << " ";
    cout<<(double)a / b <<endl;

    return 0;
}


Measured memory_bytes: 3288
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <cmath>
#include <iomanip>
#include <map>

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

using namespace std;
using ll = long long;
using P = pair<int,int>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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;
}
template <typename T>
T GCD(T x, T y)
{
    return (y ? GCD<T>(y, x % y) : x);
}



int main() {
    long long N, A, B, C, D, E;
    cin >> N >> A >> B >> C >> D >> E;
    cout << max({ (N - 1) / A, (N - 1) / B, (N - 1) / C, (N - 1) / D, (N - 1) / E }) + 5 << endl;
}



Measured memory_bytes: 256
import std.stdio, std.conv, std.string, std.range, std.typecons, std.format;
import std.algorithm.searching, std.algorithm.sorting, std.algorithm.iteration, std.algorithm.mutation;

void main()
{
    string input = readln().strip();
    foreach(c; input)
    {
        write(c=='1'?'9':'1');
    }
    writeln("");
}


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

struct Tally
{
	Tally(){}
	Tally( string s, int n, int a ) : name( s ), num( n ), amount( a ){}
	string name;
	int num;
	int amount;
};

int main()
{
	vector< Tally > v;
	for( int i = 0; i < 9; ++i ){
		string s;
		int a, b;
		cin >> s >> a >> b;
		v.push_back( Tally( s, a + b, a * 200 + b * 300 ) );
	}
	for( int i = 0; i < 9; ++i ){
		cout << v[ i ].name << " " << v[ i ].num << " " << v[ i ].amount << endl;
	}

	return 0;
}

Measured memory_bytes: 1216
// Rifqisyandi
#include <iostream>
using namespace std;

int N;
bool ada=false;

int main(){
    cin>>N;
    for(int i=1;i<=9;i++){
        for(int j=1;j<=9;j++){
            if(i*j==N){
                ada=true;
            }
        }
    }
    if (ada){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3636
/*.゜｡:+*.゜｡:+code by lynmisakura.wish to be accepted!*.゜+*.゜｡:+*/
#include<bits/stdc++.h>
using namespace std;
/*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*.゜｡:+*/
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vpi;
 
const long long INF = 1LL << 55;
 
#define itn int
#define endl '\n'
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define dup(x,y) ((x) + (y) - 1)/(y)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
#define rrep(i,n) for(int i = n - 1;i >= 0;i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
 
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
 
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
int main(void){
   int a,b;cin >> a >> b;
   if(b >= a)cout << a << endl;
   else cout << a - 1 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int l = m * n;
		int[] a = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = sc.nextInt();
		}
		long[][][] dp = new long[n+1][n+1][l+1];
		dp[0][0][0] = 1;
		for(int i=0;i<n;i++) {
			for(int j=0;j<=n;j++) {
				for(int k=0;k<=l;k++) {
					dp[i+1][j][k] += dp[i][j][k];
					if (j < n && k + a[i] <= l) {
						dp[i+1][j+1][k+a[i]] += dp[i][j][k];
					}
				}
			}
		}
		long ans = 0;
		for(int i=1;i<=n;i++) {
			ans += dp[n][i][i*m];
		}
//		System.out.println(Arrays.deepToString(dp));
		System.out.println(ans);
	}

}


Measured memory_bytes: 77652
def main():
    import sys
    input = sys.stdin.readline

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

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

    # i種類目までの荷物を見る
    for i in range(N):
        # その荷物を重さjになるように持つ
        for j in range(W+1):
            w, v = WV[i]
            num_w = min(1, j//w)        # 荷物は1種につき1個まで
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-w*num_w] + v*num_w)
    print(max(dp[-1]))


if __name__ == "__main__":
    main()


Measured memory_bytes: 119788
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();

        long remove = 0;
        long count = 0;

        foreach (var c in s)
        {
            if (c == 'S')
            {
                count++;
            }
            else
            {
                if (count > 0)
                {
                    count--;
                    remove++;
                }
            }
        }

        long answer = s.Length - remove * 2;

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 26704
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <26/May/2019 06:11:19 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


def input(): return sys.stdin.readline().strip()


def main():
    n = int(input())
    d = {}
    for i in range(n):
        x, y = input().split()
        if x not in d:
            d[x] = []
        d[x].append((int(y), i + 1))
    for i in d:
        d[i].sort(reverse=True)
    from collections import OrderedDict
    od = OrderedDict(sorted(d.items()))
    # print(od)
    for i in od:
        for j in od[i]:
            print(j[1])


if __name__ == "__main__":
    main()


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

int main(void)
{
	int n, a, b, c;
	int data[10][10];
	
	while (scanf("%d", &n), n){
		int N = 0;
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				if (i == j) data[i][j] = 0;
				else data[i][j] = 10000000;
			}
		}
		for (int i = 0; i < n; i++){
			scanf("%d %d %d", &a, &b, &c);
			data[a][b] = data[b][a] = c;
			N = max(N, max(a, b));
		}
		
		// WF
		for (int k = 0; k < 10; k++){
			for (int i = 0; i < 10; i++){
				for (int j = 0; j < 10; j++){
					data[i][j] = min(data[i][j], data[i][k] + data[k][j]);
				}
			}
		}
		
		/*
		for (int i = 0; i <= N; i++){
			cout << i << " : ";
			for (int j = 0; j <= N; j++){
				cout << data[i][j] << " ";
			}
			puts("");
		}
		*/
		
		// i が答えだと仮定して全部計算
		int ret = 10000000, ret_num = 10000000, sum;
		for (int i = 0; i <= N; i++){
			sum = 0;
			for (int j = 0; j <= N; j++){
				sum += data[i][j];
			}
			// cout << sum << endl;
			if (sum < ret_num){
				ret_num = sum;
				ret = i;
			}
		}
		
		cout << ret << " " << ret_num << endl;
	}
	
	return 0;
}

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

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a, b, c, d, cnt = 0;
    cin >> a >> b >> c >> d;
    while(a > 0 && c > 0) {
        if(cnt % 2 == 0) {
            c -= b;
        }
        else {
            a -= d;
        }
        cnt++;
    }
    if(cnt % 2 == 1) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
#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 all(x) (x).begin(), (x).end()
const ll INF = ll(1e18)+1;

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

    long double A,B,H,M;
    cin >> A >> B >> H >> M;
    long double pi = 3.1415926535;

    long double funkaku,jikaku;
    funkaku = M / 60;
    jikaku = H / 12 + M / 720;

    long double theta = abs(funkaku - jikaku) * 2 * pi;
    // cout << theta;
    long double result;

    if(theta == 0){
        result = abs(A-B);
    }
    else{
        result = sqrt(pow(A,2) + pow(B,2) - 2 * A * B * cosl(theta));
    }
    
    cout << fixed << setprecision(15) << result;
}

Measured memory_bytes: 4140
#include<bits/stdc++.h>
using namespace std;
 
typedef vector <int> vi;
typedef pair< int ,int > pii;
#define PB push_back
#define MP make_pair
#define FF first
#define SS second
#define ll long long
#define MOD 1000000007
#define OJ \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout);
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
map <int,int> Map;
int main(){
    //OJ;
    ll n,sum=0;
    cin>>n;
    for(int i=0;i<n;i++){
        ll t;
        cin>>t;
        sum+=t;
        Map[t]++;
    }
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
        int t,k,c;
        cin>>t>>k;
        c=Map[t];
        sum+=(k-t)*c;
        Map[t]=0;
        Map[k]+=c;
        cout<<sum<<endl;
    }
}

Measured memory_bytes: 8024
S = str(input())

# S を abc を並び替えて作ることができるなら Yes を、そうでないなら No を出力せよ。

abc = [S[0], S[1], S[2]]
if "a" in abc and "b" in abc and "c" in abc:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 8856
#include <iostream>
#include <complex>

using namespace std;

int main(){
  int n, count = 0, i, j;
  cin >> n;
  int list[n];
  for(i = 0; i < n; i++) cin >> list[i];

  for(i = 0; i < n; i++){
    if(list[i] <= 1) continue;
    if(list[i] == 2 || list[i] == 3){
      count++;
      continue;
    }
    if(list[i] > 3 && list[i] % 2 == 0) continue;
    for(j = 2; j <= sqrt(list[i]); j++) if(list[i] % j == 0) break;
    if(j > sqrt(list[i])) count++;
  }
  cout << count << endl;
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<long long,long long>
#define endl '\n'
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int test=1;
    while(test--)
    {
        int k ,n ; cin>>k>>n;
        vector<int> v(n);
        for(int i=0;i<n;i++)
        cin>>v[i];
        vector<int> dist; int ans=0;
        for(int i=0;i<n-1;i++)
        {
            dist.pb(abs(v[i]-v[i+1]));
        }
        dist.pb(v[0]+k-v[n-1]);
        sort(dist.begin(),dist.end());
        for(int i=0;i<n-1;i++)
        ans+=dist[i];
        cout<<ans;
    }
    return 0;
}

Measured memory_bytes: 3956
# include <iostream>
# include <algorithm>
# include <cmath>
# include <tuple>
# include <vector>
# include <queue>
# include <string>
# include <map>

typedef long long ll;
using namespace std;

string s;
int n;

bool isValid(int len) {
    map<string, int> m;
    for (int i = 0; i <= n-len; i++) {
        string str = s.substr(i, len);
        if (m.find(str) != m.end() && m[str]+len <= i) return true;
        else m.insert({str, i});
    }
    return false;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    cin >> s;
    if (!isValid(1)) {
        cout << 0 << endl;
        return 0;
    }
    int l = 1;
    int r = n/2+1;
    while (r - l >= 1) {
        if (r-l == 1) {
            if (isValid(r)) l = r;
            break;
        }
        int mid = (l+r)/2;
        if (isValid(mid)) {
            l = mid;
        } else {
            r = mid;
        }
    }
    cout << l << endl;
    return 0;
}


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

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

    int n;
    cin >> n;
    vector<vector<int>> A(2, vector<int>(n + 1, 0));

    for(int i = 0; i < 2; i++){
        for(int j = 1; j < n + 1; j++){
            cin >> A[i][j];
            A[i][j] += A[i][j - 1];
        }
    }

    int maxi = -1e9;
    for(int i = 1; i < n + 1; i++){
        maxi = max(maxi, A[0][i] + A[1][n] - A[1][i - 1]);
    }
    cout << maxi << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  long long int A[N], sum=0, half=0, ans, ans1, ans2;
  for(int i=0; i<N; i++) cin >> A[i];
  for(int i=0; i<N; i++) sum += A[i];
  for(int i=0; i<N; i++){
    half += A[i];
    if(sum <= half*2){
      ans1 = abs(sum-half*2);
      half -= A[i];
      ans2 = abs(sum-half*2);
      break;
    }
  }
  if(ans1 < ans2) ans = ans1;
  else ans = ans2;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");
		String a = tmp[0];
		String b = tmp[1];
		long d = Long.parseLong(a) / Long.parseLong(b);
		long r = Long.parseLong(a) % Long.parseLong(b);
		double f = Double.parseDouble(a) / Double.parseDouble(b);
		System.out.printf("%d %d %.5f", d, r, f);
	}
}

Measured memory_bytes: 16940
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
 
using namespace std;
 
using i64=long long;
 
i64 f(i64 b, i64 n) {
    return n<b? n:f(b, n/b)+(n%b);
}
 
int main() {
    i64 n, s;
    scanf("%lld %lld", &n, &s);
 
    if (n == s)
        return !printf("%lld\n", n+1);
 
    i64 ub=sqrt(n);
    for (i64 b=2; b<=ub; ++b)
        if (f(b, n) == s)
            return !printf("%lld\n", b);
 
    for (i64 p=ub+1; --p;) {
        i64 b=(n-s)/p+1;
        if (b < 2) continue;
        if (f(b, n) == s)
            return !printf("%lld\n", b);
    }
 
    return !printf("-1\n");
}

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

const int64_t INF = 1e+15;

int main() {
    int64_t N, K;
    cin >> N >> K;
    
    vector<int64_t> h(N);
    for ( int64_t i = 0; i < N; ++i){
        cin >> h[i];
    }
    
    sort(h.begin(),h.end());
    
    int64_t ans = INF;
    for ( int i = 0; i <= N - K; ++i){
        int64_t dh;
        dh = h[i+K-1] - h[i];
        ans = min(ans,dh);
    }
    
    cout << ans << endl;
    
    return 0;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

vector<int> makePrimeList(){
	int range = 1000000;
	vector<int> ret;
	vector<bool> notp(range);

	notp[0] = notp[1] = true;
	for(int i = 2;i < range;i++){
		if(!notp[i]){
			ret.PB(i);
			for(int j = 2 * i;j < range;j += i){
				notp[j] = true;
			}
		}
	}

	return ret;
}

void check(vector<ll> v, vector<ll> &ans, ll now){
	bool flag = true;
	int n = v.size();
	REP(i, n)if(v[i] % now)flag = false;
	if(flag)ans.PB(now);
}

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

	ll n;cin >> n;
	vector<ll> v(n+1);
	REV(i, n+1)cin >> v[i];

	auto p = makePrimeList();

	vector<ll> ans;
	for(ll i = 0;p[i] <= n;i++){
		if(v[0] % p[i] != 0)continue;
		vector<ll> now(p[i]-1, 0);
		for(int j = 1;j <= n;j++){
			now[(j-1)%(p[i]-1)] += v[j];
		}
		bool flag = true;
		REP(j, p[i]-1){
			if(abs(now[j]) % p[i] != 0)flag = false;
		}
		if(flag)ans.PB(p[i]);
	}

	REP(i,n+1)v[i] = abs(v[i]);
	REP(i, p.size()){
		if(p[i] > n && v[n] % p[i] == 0){
			check(v, ans, p[i]);
		}
		while(v[n] != 0 && v[n] % p[i] == 0)v[n] /= p[i];
	}

	if(v[n] > 1){
		check(v, ans, v[n]);
	}

	REP(i, ans.size()){
		cout << ans[i] << endl;
	}

	return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#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 rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000
#define LLINF 1e18

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

void solve_abc_e() {
	ll n, m;
	ll h, w;
	ll l_ans = 0;

	cin >> h >> w >> m;

	multiset<P> target;
	vector<P> hi(h, make_pair(0, 0)), wi(w, make_pair(0, 0));

	ll a, b;
	rep(i, m) {
		cin >> a >> b;
		a--;
		b--;
		target.emplace(make_pair(a, b));
		hi[a] = make_pair(hi[a].first + 1, a);
		wi[b] = make_pair(wi[b].first + 1, b);
	}

	sort(RALL(hi));
	sort(RALL(wi));

	V ht, wt;
	rep(i, hi.size()) {
		if (hi[i].first == hi[0].first) {
			ht.push_back(hi[i].second);
		}
		else {
			break;
		}
	}

	rep(i, wi.size()) {
		if (wi[i].first == wi[0].first) {
			wt.push_back(wi[i].second);
		}
		else {
			break;
		}
	}

	l_ans = hi[0].first + wi[0].first;

	P tmp;
	rep(i, ht.size()) {
		rep(j, wt.size()) {
			tmp = make_pair(ht[i], wt[j]);
			if (target.find(tmp) == target.end()) {
				cout << l_ans << "\n";
				return;
			}
		}
	}
	l_ans--;
	cout << l_ans << "\n";
	return;
}

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

	solve_abc_e();

	return 0;
}

Measured memory_bytes: 39744
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a,b;
int w[10],k[10];
for(int i=0;i<10;i++){
cin>>a;
w[i]=a;}
for(int i=0;i<10;i++){
cin>>b;
k[i]=b;}
sort(w,w+10);
sort(k,k+10);
cout<<w[9]+w[8]+w[7]<<" "<<k[9]+k[8]+k[7]<<endl;
return 0;
}

Measured memory_bytes: 1180
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        int a,b;
		Scanner sc=new Scanner(System.in);
		a=sc.nextInt();
		b=sc.nextInt();
		if(a>b){
			System.out.println("a > b");
		}else if(a<b){
			System.out.println("a < b");
		}else{
			System.out.println("a == b");
		}
    }
}


Measured memory_bytes: 26236
import sys
import math
line1 = sys.stdin.readline()
line2 = sys.stdin.readline()

n = int(line1)
a_array = [int(x) for x in line2.split()]
y = int(round(float(reduce(lambda x, y: x + y, a_array)) / n))
print reduce(lambda x, y: x+y, [(x - y) ** 2 for x in a_array])

Measured memory_bytes: 2692
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=0;i<b;i++)
#define REP(i,a,b) for(int i=0;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout <<(f?"Yes":"No")<<endl//fが真の場合Yesを出力、偽の場合Noを出力
#define yes(f) cout <<(f?"yes":"no")<<endl
#define YES(f) cout <<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())

using namespace std;

const int mod=1e9+7;

signed main(){
    int n,k;
    cin >> n >> k;
    string abc;
    cin >> abc;
    
    if(abc[k-1]=='A')abc[k-1]='a';
    else if(abc[k-1]=='B')abc[k-1]='b';
    else abc[k-1]='c';

    cout << abc << endl;
}


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

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void insertionSort(int A[], int n, int g) {
  for ( int i = g; i < n; i++ ) {
    int v = A[i];
    int j = i - g;
    while ( j >= 0 && A[j] > v ) {
      A[j + g] = A[j];
      j -= g;
      cnt++;
    }
    A[j + g] = v;
  }
}

void shellSort(int A[], int n) {
  for ( int h = 1; ; ) {
    if ( h > n ) break;
    G.push_back(h);
    h = 3*h + 1;
  }

  for ( int i = G.size()-1; i >= 0; i-- )
    insertionSort(A, n, G[i]);
}

int main() {
  scanf("%d", &n);
  for ( int i = 0; i < n; i++ ) scanf("%d", &A[i]);
  cnt = 0;

  shellSort(A, n);

  printf("%d\n", G.size());
  for ( int i = G.size() - 1; i >= 0; i-- ) {
    printf("%d", G[i]);
    if ( i ) printf(" ");
  }
  printf("\n");
  printf("%d\n", cnt);
  for ( int i = 0; i < n; i++ ) printf("%d\n", A[i]);

  return 0;
}


Measured memory_bytes: 6568
import java.util.Scanner;

public class Main{
	public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a<b){
			System.out.println("a < b");
		} else if(a>b){
			System.out.println("a > b");
		} else if(a==b){
			System.out.println("a == b");
		}
	}
}

Measured memory_bytes: 17224
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <limits>
#include <string>
#include <algorithm>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include "math.h"
#include "assert.h"

using namespace std;

#define ll long long

#define buff ios::sync_with_stdio(false)
#define epsilon 1e-07
#define pi 2 * acos(0.0);
#define mod 1000000007   // 1e9+7
#define cerr if(false)cerr
#define watch(x) cerr << #x << " = " << x << endl;

#define xy pair<int, int>
#define x first
#define y second 

#define inf std::numeric_limits<int>().max()

int main() {
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int m = t.size();
	int ans = 0;
	for(int i=0; i<n-m+1; i++) {
		int ct = 0;
		for(int j=0; j<m; j++) {
			if (i+j < n and s[i+j] == t[j]) ct++; 
		}
		ans = max(ans, ct);
	}
	cout << m-ans << endl;
}



Measured memory_bytes: 3156
import java.util.*;

class Main{
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		double a = sc.nextDouble();
        double b = sc.nextDouble();
        double c = Math.toRadians(sc.nextDouble());
        System.out.println(a * b * Math.sin(c) / 2.);
        System.out.println((a + b + Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(c))));
        System.out.println(b * Math.sin(c));
    }
}


Measured memory_bytes: 27856
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;
int main(){
  int n;
  cin>>n;

  vector<int> a(n,0);

  rep(i,n-1){
     int x;
     cin>>x;
     a[x-1]++;
  }
  rep(i,n){
     cout<<a[i]<<endl;
  }

return 0;
}


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

int main(){
	int N, i, j, k;
	scanf("%d", &N);
	N = (1 << N);
	vector<int> S(N);
	for(i = 0; i < N; i++){
		scanf("%d", &S[i]);
		S[i] *= -1;
	}
	sort(S.begin(), S.end());
	for(i = 1; i < N; i <<= 1){
		sort(S.begin(), S.begin() + i);
		sort(S.begin() + i, S.end());
		for(j = 0, k = i; j < i; j++){
			while(S[j] >= S[k]){
				k++;
				if(k == N){
					printf("No\n");
					return 0;
				}
			}
			swap(S[i + j], S[k]);
		}
	}
	printf("Yes\n");
	return 0;
}

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

int main(){
    char c;
    int sum;
    stack<pair<int, int> > w1;
    stack<int> w2;
    
    sum = 0;
    for(int i = 0; cin >> c; i++){
        if(c == '\\'){
            w2.push(i);
        }
        else if(c == '/' && w2.size() > 0){
            int j = w2.top();
            w2.pop();
            sum += i - j;
            int a = i - j;
            while(w1.size() > 0 && w1.top().first > j){
                a += w1.top().second;
                w1.pop();
            }
            
            w1.push(make_pair(j, a));
        }
    }
    
    int a = w1.size();
    stack<int> ans;
    while(w1.size() > 0){
        ans.push(w1.top().second);
        w1.pop();
    }
    
    int num = ans.size();
    cout << sum << endl << num;
    for(int i = 0; i < num; i++){
        cout << " " << ans.top();
        ans.pop();
    }
    cout << endl;
    
    return 0;
}


Measured memory_bytes: 3196
#include <iostream>

using namespace std;

int main() {
    int S;

    cin >> S;

    const int s = S % 60;
    const int m = (S - s) / 60 % 60;
    const int h = (S / 60 - m) / 60;

    cout << h << ":" << m << ":" << s << endl;

    return 0;
}




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

int main(){
	LL a,b;
	cin>>a>>b;
	LL ar[a];
	LL sum=0;
	for(LL i=0;i<a;i++){
		cin>>ar[i];
		sum+=ar[i];
	}
	double val=(double)(b)*4.0;
	//cout<<val<<endl;
	val=1.0/val;
	//cout<<val<<endl;
	val*=(double)sum;
	//cout<<val<<endl;
	LL cnt=0;
	for(LL i=0;i<a;i++){
		double k=(double)ar[i];
		if(k>=val) cnt++;
	}
	//cout<<cnt<<endl;
	if(cnt>=b) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#include <bitset>
using namespace std;
using ll = long long;
using ld = long double;

template<class T> bool chmin(T &a, T b) { return a>b?(a=b,true):false; }
template<class T> bool chmax(T &a, T b) { return a<b?(a=b,true):false; }
#define FOR(i,x,y) for(int i=(x);i<(int)(y);i++)
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define repp(i,y) for(int i=1;i<=(int)(y);i++)
#define REPB(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define bs2int(bs) ((bs).to_ullong())

template<class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << " ";
    os << *it;
  }
  return os;
}

ll n,k;
ll a[100100], b[100100];

int main() {
  
  cin>>n>>k;
  vector<ll> v;
  v.push_back(k);
  for(ll i=0; (k>>i)>0; i++) {
    bitset<64> bs(k);
    REP(j,i) {
      bs.set(j);
    }
    bs.reset(i);
    if (bs2int(bs) < k) v.push_back(bs2int(bs));
  }
  REP(i,n) {
    cin>>a[i]>>b[i];
  }
  ll mxans = 0;
  for (int k : v) {
    ll ans = 0;
    REP(i,n) {
      if (k==(k | a[i])) ans+=b[i];
    }
    chmax(mxans, ans);
  }
  cout << mxans << endl;
}


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

using namespace std;

const int N = 11;

int v[N][N];

bool perfect_square(int val) {
    int x = sqrt(val);
    return (x * x == val);
}

int main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);
    cout.tie(0);
    int n, d;
    cin >> n >> d;
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= d; ++j)
            cin >> v[i][j];
    }
    int ans(0);
    for (int i = 1; i <= n; ++i) {
        for (int j = i + 1; j <= n; ++j) {
            int dist(0);
            for (int k = 1; k <= d; ++k)
                dist += (v[i][k] - v[j][k]) * (v[i][k] - v[j][k]);
            if (perfect_square(dist))
                ++ans;
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<map>
using namespace std;
int a[200005],b[200005];
map<int,int> mp;
int main(){
	int n,i;
	long long ans=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
		b[i]=a[i]+i;
	}
	for(i=1;i<=n;i++){
		ans+=mp[i-a[i]];
		mp[b[i]]++;
	}
	printf("%lld\n",ans); 
	return 0;
}


Measured memory_bytes: 21764
import numpy as np

if __name__ == "__main__":
	N=int(input())
	A=list(map(int,input().split()))

	P=200_003
	rootP=2

	order=[1]
	x=rootP
	while x!=1:
		order.append(x)
		x *= rootP
		x %= P

	ORDER_SIZE=len(order)	# 200_002

	where=np.zeros(P,int)
	for i in range(ORDER_SIZE):
		where[ order[i] ] = i

	prevCnt = np.zeros(P,int)
	resCnt = np.zeros(P,int)
	for n in range(N):
		if A[n] != 0:
			prevCnt[ where[A[n]] ] += 1
			resCnt[ (A[n] * A[n]) % P ] -= 1

	N_=1
	while N_ < 2*len(prevCnt): N_ *= 2
	nf = np.zeros(N_,int)
	nf[:len(prevCnt)]=prevCnt
	nf=np.fft.rfft(nf)
	fftRes = np.rint( np.fft.irfft(nf*nf) )

	for r in range(len(fftRes)):
		if fftRes[r] != 0:
			resCnt[ order[ r % ORDER_SIZE ] ] += fftRes[r]

	ans = 0
	for p in range(P):
		if resCnt[p] != 0:
			ans += (resCnt[p] // 2) * p

	print(ans)


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

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  cout<<a-b-c+d<<endl;
 
  return 0;
}
   
  
	
	  
	  
	  
	  
	  
	  
     
  
  
  
  
  

  

 
  


 

    
  



Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = pow(10,9) + 7;
 
string S;
int dp[100002][15];
 
ll solve(int pos, int rem) {
    if(pos == S.size()) return rem == 5;
    if(dp[pos][rem] != -1) return dp[pos][rem];
    ll ans(0);
    if(S[pos] == '?') {
        for(int i(0); i < 10; ++i) {
            ans += solve(pos + 1, (rem * 10 + i) % 13) % mod;
        }
    }
    else ans += solve(pos + 1, (rem * 10 + S[pos] - '0') % 13) % mod;
    return dp[pos][rem] = ans % mod;
}
 
int main() {
	memset(dp, -1, sizeof dp);
    cin >> S;
    cout << solve(0, 0) << endl;
}

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

int main(){
    int N, A, B;
    cin >> N >> A >> B;
    int s=0, t=0, u=0;
    for (int i = 0; i < N; i++) {
        int p;
        cin >> p;
        if (p <= A) s++;
        else if (p <= B) t++;
        else u++;
    }
    cout << min(min(s, t), u) << endl;
    return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

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

  int m; cin >> m;
  cout << 24 - m + 24 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  string s;
  cin >> s;
  if (s[0] != s[1] && s[2] == s[3] && s[4] == s[5]) 
    cout << "Yes\n";
  else
  cout << "No\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
int main(){
  long k;
  cin>>k;
  
  if(k%10==3){
    cout<<"bon"<<endl;
  }
  else if(k%10==0||k%10==1||k%10==6||k%10==8){
    
    cout<<"pon"<<endl;
  }
  else{
    cout<<"hon"<<endl;
  }
}

Measured memory_bytes: 3636
#include<iostream>
#include<cmath>
#include<algorithm>
#include <cassert>
#include<string>
#include<vector>
#include <utility>
#include <math.h>
using namespace std;
int main(){
	int a = 0, b = 0, c = 1000000003, d = 0, e[100010] = { 0 };
	cin >> a >> b>>c;
	cout << (a - b + 1)*(a - c + 1) << endl;

	return 0;
}

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

int main() {
  int N, n1, n2, n3, n4;
  cin >> N;
  n1 = N / 1000;
  n2 = (N - n1 * 1000) / 100;
  n3 = (N - n1 * 1000 - n2 * 100) / 10;
  n4 = N - n1 * 1000 - n2 * 100 - n3 * 10;
  if ((n1 == n2 && n2 == n3)||(n2 == n3 && n3 == n4)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
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;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

template <class T> T gcd(T x, T y) {
    // 最小公倍数を求める
    if (y == 0)
        return x;
    return gcd(y, x % y);
}

template <class T> T lcm(T x, T y) {
    // 最大公約数を求める
    T GCD = gcd(x, y);
    T ans = x / GCD * y;
    return ans;
}

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

    ll a, b;
    scan(a, b);
    ll ans = lcm(a, b);
    print(ans);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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


Measured memory_bytes: 256
#include <stdio.h>
 
int egara(char c){
  if(c=='S')return 0;
  if(c=='H')return 1;
  if(c=='C')return 2;
  if(c=='D')return 3;
  return 0;
}
char Egara(int n){
  if(n==0)return 'S';
  if(n==1)return 'H';
  if(n==2)return 'C';
  if(n==3)return 'D';
  return 'S';
}
int main(){
  int n,a[4][13],i,j,m;
  char c,d;
  for(i=0; i<4; i++){
    for(j=0; j<13; j++){
      a[i][j]=1;
    }
  }
  scanf("%d\n",&n);
  for(i=0; i<n; i++){
    scanf("%c %d\n",&c,&m);
    a[egara(c)][m-1]=0;
  }
for(i=0; i<4; i++){
    for(j=0;j<13; j++){
      if(a[i][j])
      printf("%c %d\n",Egara(i),j+1);
    }
  }
  return 0;
}


Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
ll n;
std::vector<ll> v;
int num(int s){
  ll ans= 0;
  rep(i,n+1)if(v[i]>=s-1) ans++;
  return ans;
}
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n;
  // std::vector<ll> v;
  ll cur;
  v.resize(101,0);
  repl(i,2,n+1){
    cur = i;
    repl(j,2,i+1){
      while(cur%j==0){
        v[j]+=1;
        cur = cur / j;
      }
    }
  }
cout<<num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
  + num(5) * (num(5) - 1) * (num(3) - 2)/2<<endl;
}
int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
parseInt(x) = parse(Int,x)
function f()
    #=
    i2-i1=Ai1+Ai2
    L=i1+Ai1
    R=i2-Ai2
    L=R
    =#
    n=parseInt(readline())
    a=map(x->parse(Int,x),split(readline()))
    ans=0
    L=zeros(Int,n)
    R=Dict()
    for i=1:n
        L[i]=i+a[i]
        R[i-a[i]]=0
    end
    for i=1:n
        if haskey(R,L[i])
            R[L[i]] += 1
        end
    end
    for i=1:n
        ans += R[i-a[i]]
    end
    return ans
end
print(f())
#=再帰(TLE)
function f(n,a,b)
    if b>n
        return 0
    end
    ans=0
    for i=b+1:n
        if abs(b-i) == a[b]+a[i]
            ans += 1
        end
    end
    ans += f(n,a,b+1)
    return ans
end
n=parseInt()
a=map(x->parse(Int,x),split(readline()))
print(f(n,a,1))
=#


Measured memory_bytes: 218492
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();

        for (int i = 0; i < X; i++) {
            int low = 100 * i, high = 105 * i;
            if (low <= X && X <= high) {
                System.out.println(1);
                return;
            }
        }
        System.out.println(0);
}
}

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

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N, R;

	cin >> N >> R;

	if (N >= 10) cout << R << endl;
	else cout << R + 100 * (10 - N) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

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

  vll csum(n + 1, 0);
  rep(i, n) {
    ll a;
    cin >> a;
    csum[i + 1] = csum[i] + a;
  }

  vll bs;
  repLRE(i, 0, n - 1) {
    repLRE(j, i + 1, n) { bs.push_back(csum[j] - csum[i]); }
  }

  ll const blmax = 50;

  ll ans = 0;
  rrepLRE(i, blmax, 0) {
    ll cnt = 0;
    rep(j, (ll)bs.size()) {
      if ((bs[j] & ans) == ans) if (bs[j] >> i & 1) cnt++;
    }
    if (k <= cnt) ans += (1LL << i);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6256
import math

def factorization(n):
    r = []
    temp = n
    for i in range(2,int(math.sqrt(n))+1):
        m = 0
        while temp % i == 0:
            temp /= i
            m += 1
        if m > 0:
            r.append((i,m))
    if temp != 1:
        r.append((temp,1))
    if len(r) == 0:
        r.append((n,1))
    return r

n = int(input())
p = factorization(n)
ans = 0
if p[0][0] == 1:
    ans = 0
else:
    for x in p:
        i = 1
        s = x[1]
        while s >= i:
            s -= i
            i += 1
        ans += (i-1)
print(ans)


Measured memory_bytes: 9296
#include <stdio.h>

int main(){
	
	int i,j;
	
	for(i=1; i<=9; i++)
	{
		for(j=1; j<=9; j++)
		{
			printf("%dx%d=%d\n", i, j, i*j);
		}
	}
	
	return 0;
}

Measured memory_bytes: 524
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define YESNO(i) puts((i)?"YES":"NO");
#define YesNo(i) puts((i)?"Yes":"No");
#define yesno(i) puts((i)?"yes":"no");
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a,b;cin>>a>>b;
  print(a*b);
  return 0;
}

Measured memory_bytes: 3648
///
// File:  dpl_1_d.cpp
// Author: ymiyamoto
//
// Created on Thu Nov  2 08:05:56 2017
//

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

static vector<uint32_t> arr;
static vector<uint32_t> l;

int32_t main()
{
  uint32_t n;
  cin >> n;

  for (uint32_t i = 0; i < n; i++) {
    uint32_t val;
    cin >> val;
    arr.push_back(val);
  }

  l.push_back(arr[0]);
  for (uint32_t i = 1; i < arr.size(); i++) {
    if (l[l.size() - 1] < arr[i]) {
      l.push_back(arr[i]);
    } else {
      uint32_t at = lower_bound(l.begin(), l.end(), arr[i]) - l.begin();
      l[at] = arr[i];
    }
    // for (uint32_t i = 0; i < l.size(); i++) {
    //   cout << l[i] << " ";
    // }
    // cout << endl;
  }

  cout << l.size() << endl;

  return 0;
}

Measured memory_bytes: 3860
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    string s;
    cin >> s;

    int sl = s.size();
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    if (sl == s.size()) {
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }

    return 0;
}


Measured memory_bytes: 256