akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Linq;
namespace aizu
{
    class OnlineJudge
    {
        static void Main()
        {
            string input;
            while((input = Console.ReadLine()) != null){
                int[] values = input.Split(',').Select(q => int.Parse(q)).ToArray();
                double dist = ((double)values.Take(10).Sum() / (values[10] + values[11])) * values[10];
                for(int i=0;i < 10;++i){
                    if((dist -= values[i]) <= 0){
                        Console.WriteLine(i + 1);
                        break;
                    }
                }
            }
        }
    }
}

Measured memory_bytes: 5972
#include <stdio.h>

int main(void)
{
	double weight;
	while (scanf("%lf", &weight) != EOF){
		if (weight <= 48){
		 	printf("light fly\n");
		}
		else if (weight <= 51){
		 	printf("fly\n");
		}
		else if (weight <= 54){
			printf("bantam\n");
		}
		else if (weight <= 57){
		 	printf("feather\n");
		}
		else if (weight <= 60){
		 	printf("light\n");
		}
		else if (weight <= 64){
			printf("light welter\n");
		}
		else if (weight <= 69){
			printf("welter\n");
		}
		else if (weight <= 75){
		 	printf("light middle\n");
		}
		else if (weight <= 81){
			printf("middle\n");
		}
		else if (weight <= 91){
		 	printf("light heavy\n");
		}
		else if (weight > 91){
		 	printf("heavy\n");
		}
	}
	
	return (0);
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;

int main() {
  ll N, P;
  cin >> N >> P;
  vector<ll> A(N);
  for (ll i=0; i<N; i++) cin >> A[i];
  // A_iがすべて偶数かどうか
  bool even = true;
  for (ll i=0; i<N; i++) {
    if (A[i]%2!=0) {
      even = false;
      break;
    }
  }
  if (even) {
    if (P==0) cout << (ll)pow(2, N) << endl;
    else cout << 0 << endl;
  }
  else cout << (ll)pow(2, N-1) << endl;
}

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

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

using namespace std;

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

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

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

int main() {
    int n, r[200010];
    cin >> n;
    rep(i, n) cin >> r[i];

    int maxv = r[1] - r[0];
    int minv = r[0];

    for (int j = 1; j < n; j++) {
        maxv = max(maxv, r[j] - minv);
        minv = min(minv, r[j]);
    }

    cout << maxv << endl;
}



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

int main()
{
	string s;
	cin>>s;
	
	int cnt=0,mx_cnt=0;
	
	for(int i=0;i<3;i++)
	{
		if(s[i]=='R')
			cnt++;
		else
			cnt=0;
		mx_cnt=max(mx_cnt,cnt);
	}
	cout<<mx_cnt;
}






Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define endl '\n'
#define int long long
int32_t main()
{
    int h,n;
    cin>>h>>n;
    int sum=0;
    for(int i=0;i<n;i++)
    {
    	int x;
    	cin>>x;
    	sum+=x;
    }
    if(sum>=h)
    	cout<<"Yes";
    else
    	cout<<"No";
}

Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <iostream>
#define R(i, n) for(int i = 0;i < n;i++)
#define RR(i, n) for(int i = n;i >= 0;i--)
#define F(i, m, n) for(int i = m;i < n;i++)
#define FR(i, m, n) for(int i = m; i >= n; i--)
#define S(a) scanf("%d", &a)
#define S2(a, b) scanf("%d%d", &a, &b)
#define S3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define P(a) printf("%d", a)
#define INF 1000000000
using namespace std;
typedef long long ll;

string S;
int N;

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

	for (int i = 0; i < S.size(); i++) {
		int num = S[i] + N;
		if (num <= 90) {
			printf("%c", num);
		}
		else
		{
			printf("%c", num - 26);
		}
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
	
	int n,m,a,b,good=0;
	cin >> n >> m;
	int r[n][2];
	for(int i=0;i<n;i++){
		cin >> r[i][0];
		r[i][1] = 1; 
	}

	for(int i=0;i<m;i++){
		cin >> a >> b;
		if(r[a-1][0] > r[b-1][0]){
			r[b-1][1] = 0;
		}else{
			r[a-1][1] = 0;
		}
		if(r[a-1][0] == r[b-1][0])r[b-1][1] = 0;
	}

	for(int i=0;i<n;i++){
		//cout << "r[" << i << "]=" << r[i][1] << endl; 
		if(r[i][1]==1)good++;
	}


	cout << good << endl;


	return 0;
}

Measured memory_bytes: 4412
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		// 回数
		int n = in.nextInt();
		// 今までに払った金額
		int x = 800;
		// レストランからもらう金額
		int y = 200;
		// answer
		int ans = 0;
		if (n < 15) {
			System.out.println(x * n);
		} else if (n == 15) {
			System.out.println(x * n - y);
		} else if (15 < n) {
//			if (n % 15 == 0) {
				System.out.println(x * n - (y * (n / 15)));
//			}else {
//				System.out.println(x * n - (y * (n / 15)));
//			}

		}
	}
}

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

int main() {
	string a, b, c;
	cin >> a >> b >> c;
	if (a[a.size() - 1] == b[0] && b[b.size() - 1] == c[0]) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}


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

using namespace std;

int main(){
  int n;cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++){
    cin>>v[i];
  }
  int cnt=0;
  while(1){
    bool flag=false;
    for(int i=0;i<v.size();i++){
      if(v[i]%2!=0) flag=true;
      v[i] = v[i]/2;
    }
    if(flag) break;
    cnt++;
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 256
import heapq
n, m = map(int, input().split())
day = [[] for _ in range(m+1)]
for i in range(n):
    a, b = map(int, input().split())
    if a <= m:
        day[a].append(-b)

q = []
heapq.heapify(q)
ans = 0

for i in range(1, m+1):
    for x in day[i]:
        heapq.heappush(q, x)
    if q != []:
        ans += -heapq.heappop(q)

print(ans)


Measured memory_bytes: 17604
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int N, A[101];
void print_r() {
	for (int i = 0; i < N; i++) {
		cout << A[i];
		if (i != N - 1) cout << " ";
	}
	cout << endl;
}
int main()
{
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	bool flag = true;
	int c = 0;
	for (int i = 0; i < N; i++) {
		int minj = i;
		for(int j=i; j < N; j++) {
			if (A[j] < A[minj]) minj = j;
		}
		if (minj != i) {
			int oldi = A[i];
			A[i] = A[minj];
			A[minj] = oldi;
			c++;
		}
	}
	print_r();
	cout << c << endl;
	return 0;
}

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

#define all(x) (x).begin(), (x).end()
#define sz(x) static_cast<int>((x).size())

using LL = long long;
template<class T, size_t D>
struct vec : vector<vec<T, D - 1>> {
  template<class... Args>
  vec(size_t n = 0, Args... args)
    : vector<vec<T, D - 1>>(n, vec<T, D - 1>(args...)) {}
};
template<class T>
struct vec<T, 1> : vector<T> {
  template<class... Args>
  vec(Args... args)
    : vector<T>(args...) {}
};

template<class T>
inline bool asMn(T& a, const T& b) { return a > b ? a = b, true : false; }
template<class T>
inline bool asMx(T& a, const T& b) { return a < b ? a = b, true : false; }
inline int nex(int i, int n) { return i == n - 1 ? 0 : i + 1; }
inline int pre(int i, int n) { return !i ? n - 1 : i - 1; }

mt19937 rng(static_cast<uint32_t>(chrono::steady_clock::now().time_since_epoch().count()));

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

  #ifdef EntityIT
  freopen("input.txt", "r", stdin);
  #endif // EntityIT

  int n; cin >> n;
  vec<int, 2> a(n, n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }

  vec<int, 2> dist = a;
  vec<bool, 2> marked(n, n);
  for (int k = 0; k < n; ++k) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (asMn(dist[i][j], dist[i][k] + dist[k][j])) {
          cout << "-1\n";
          return 0;
        } else if (k != i && k != j && dist[i][j] == dist[i][k] + dist[k][j]) {
          marked[i][j] = true;
        }
      }
    }
  }

  LL ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (marked[i][j]) {
        continue;
      }
      ans += a[i][j];
    }
  }
  cout << (ans >> 1) << '\n';

  return 0;
}


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

#include <atcoder/all>

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void()
#endif

using namespace std;
using namespace atcoder;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  fenwick_tree<long long> fw(n);
  for (int i = 0, a; i < n; i++) {
    cin >> a;
    fw.add(i, a);
  }
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t) {
      cout << fw.sum(x, y) << '\n';
    } else {
      fw.add(x, y);
    }
  }
  return 0;
}

Measured memory_bytes: 8252
# -*- coding: utf-8 -*-
import heapq
n,m,s,t = map(int, input().split())
g = [[] for _ in range(n+1)]
for _ in range(m):
    u,v,a,b = map(int, input().split())
    g[u].append((v,(a,b)))
    g[v].append((u,(a,b)))

inf = 10**18
def dijkstra(s, currency):
    d = [inf]*(n+1)
    d[s] = 0

    que = [(d[s],s)]
    heapq.heapify([que])
    while len(que)>0:
        _,v = heapq.heappop(que)
        for u,c in g[v]:
            if d[v]+c[currency]>=d[u]:
                continue
            d[u] = d[v]+c[currency]
            heapq.heappush(que, (d[u], u))
    return d

yen_c = dijkstra(s,0)
snuuk_c = dijkstra(t,1)

res = [0]*n
res[n-1] = yen_c[n] + snuuk_c[n]
for i in range(n-2,-1,-1):
    res[i] = min(res[i+1], yen_c[i+1]+snuuk_c[i+1])

for r in res:
    print(10**15-r)


Measured memory_bytes: 68948
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
#include<tuple>
#include<string.h>
#include <numeric> 
#include<unordered_map>
using namespace std; 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define pp1(...) "\033[1;47;35m" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define dg(x) debug() << pp1(x)
#define dg1(x) debug() << "[line : " << __LINE__ <<"]"<< pp(x)
#define dg2(x,y) debug() << "[line : " << __LINE__ <<"]"<< pp(x) pp(y)
#define dg3(x,y,z) debug() << "[line : " << __LINE__ <<"]"<< pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << "[line : " << __LINE__ <<"]"<< pp(w) pp(x) pp(y) pp(z)
#define int long long
#define all(x) x.begin() , x.end()
#define clr(x , y) memset(x , y , sizeof x);
#define sz(x) (int)x.size()
template<typename T> void db(T x ){ debug() <<">>> " <<  x; }
template<typename T> void db(T x , T y){ debug() <<">>> " <<  x <<" , "<< y; }
template<typename T> void db(T x , T y , T z){ debug() <<">>> "<< x <<" , "<< y <<" , "<< z; }
template<typename T> void db(T x , T y , T z , T a){ debug() <<">>> "<< x <<" , " << y <<" , "<< z <<" , "<< a; }
const int xx = 2e5;
const int Mod = 1e9 + 7;
const int inf = 1e18;
const int Maxn = 20010;
const int N = 1e6;
int Cnt[N + 5];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int>a(n);
  int gc = 0;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    Cnt[a[i]]++;
    gc = __gcd(a[i] , gc);
  }
  dg1(a);
  if(gc > 1) {
    cout << "not coprime" << '\n';
    return 0;
  }
  for(int i = 2; i <= N; i++) {
    int sum = 0;
    for(int j = i; j <= N; j += i) {
      sum += Cnt[j];
    }
    dg2(i , sum);
    if(sum > 1) {
      cout << "setwise coprime" << '\n';
      return 0;
    }
  }
  cout << "pairwise coprime" << '\n';
}

Measured memory_bytes: 18676
#include <cstddef>
#include <complex>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <array>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <limits>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <valarray>
#include <utility>
#include <tuple>
#include <cmath>
#include <memory>
#include <random>
#include <fstream>
#include <locale>
#include <bitset>

using ll = long long;
using ull = unsigned long long;

//vector
template <class T>
using vec = std::vector<T>;

template <class T>
using vvec = vec<vec<T>>;

constexpr std::size_t operator""_sz(ull n) { return std::size_t(n); }

int main()
{
    using namespace std;

    int n;
    cin >> n;

    vec<ll> v(n);
    int minusCount{};
    for (auto &e : v)
    {
        cin >> e;
        if (e < 0)
        {
            minusCount++;
            e *= -1;
        }
    }

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

    auto sum = accumulate(v.cbegin(), v.cend(), 0ll);

    if (minusCount % 2 == 1)
    {
        sum -= v.front() * 2;
    }

    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
 
bool square(int x){
  for(int i=1;i<350;i++){
    if (i*i==x) return true;
  }
  return false;
}
 
int main(){
  string a,b;cin>>a>>b;
  a += b;
  int c = stoi(a);
  if (square(c)) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
 
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a, b = input().split()
a = int(a)
b = b.replace(".", "")
b = int(b)
print(a * b // 100)

Measured memory_bytes: 65568
#include <bits/stdc++.h>
#include<queue>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<double,double> Pdouble;

const int INF = 2000000000;
const int MOD = 1000000007;

int main() {
  ll a,b,c;
  cin >> a >> b >> c;
  long double x;
  long double px = a*b;
  x = 2*sqrt(px);
  if(a+b+x<c){
    cout << "Yes"<<endl;
  }else{
    cout << "No"<<endl;
  }
}

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

int main(){
    int N;
    cin >> N;
    
    int count = 0;
    vector<int> vec(N);

    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }

    for(int i=1; i < N-1; i++){
        if((vec.at(i-1) < vec.at(i))&&(vec.at(i) < vec.at(i+1)))
            count += 1;
        if((vec.at(i-1) > vec.at(i))&&(vec.at(i) > vec.at(i+1)))
            count += 1;
    }

    cout << count << endl;
 
    return 0;
}

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

int main() {
	int n, d, x, ans=0;
	int A[110];
	cin >> n >> d >> x;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < n; i++) {
		ans += 1;
		int bi = 1;
		for (int j = 0; bi*A[i] < d; j++) {
			ans += 1;
			bi++;
		}
	}
	cout << ans + x << endl;


	return 0;
}

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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)x.size())
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int inf = 1LL<<60;
const int mod = 1e9 + 7;
const double eps = 1e-9;

/*{
  }*/

int n, m, l;
vector<pii> es[300];
int q, s[100000], t[100000];
int d[300][300];
int ans[300][300];

void f(int s){
  priority_queue<pii, vector<pii>, greater<pii>> que;
  que.push({0, s});
  d[s][s] = 0;
  ans[s][s] = 0;

  while(!que.empty()){
    auto q = que.top();
    que.pop();
    int v = q.second;
    if(d[s][v] < q.first) continue;
    
    for(auto e : es[v]){
      if(e.second > l) continue;
      int tmp = d[s][v] + e.second;
      int cost = 0;
      if(tmp > l){
        cost++;
        tmp = e.second;
      }
      
      if(ans[s][e.first] > ans[s][v] + cost){
        ans[s][e.first] = ans[s][v] + cost;
        d[s][e.first] = tmp;
        que.push({ans[s][e.first], e.first});
      }else if(ans[s][e.first] == ans[s][v] + cost){
        if(d[s][e.first] > tmp){
          d[s][e.first] = tmp;
          que.push({ans[s][e.first], e.first});
        }
      }
    }
  }
}

signed main(){
  cin >> n >> m >> l;
  rep(i, 0, m){
    int a, b, c;
    cin >> a >> b >> c;
    a--; b--;
    es[a].emplace_back(b, c);
    es[b].emplace_back(a, c);
  }

  cin >> q;
  rep(i, 0, q){
    cin >> s[i] >> t[i];
    s[i]--; t[i]--;
  }

  rep(i, 0, n) rep(j, 0, n) d[i][j] = ans[i][j] = inf;
  rep(i, 0, n) f(i);

//  rep(i, 0, n) rep(j, 0, n) cout << d[i][j] << " \n"[j==n-1];
//  rep(i, 0, n) rep(j, 0, n) cout << ans[i][j] << " \n"[j==n-1];
  rep(i, 0, q){
    int tmp = ans[s[i]][t[i]];
    if(tmp == inf) cout << -1 << endl;
    else cout << tmp << endl;
  }

  return 0;
}


Measured memory_bytes: 5760
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n, m, k, a, cnt[33], ans;

int main(){
    cin >> n >> m;
    REP(i, n){
        cin >> k;
        REP(j, k){
            cin >> a;
            a--;
            cnt[a]++;
        }
    }
    REP(i, m){
        if(cnt[i] == n)ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
#define T second.first
#define C second.second
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int,pair<int,int>> piii;

const int N= 1e5+5, L = 14, OO = 0x3f3f3f3f;
const ll M=10 ;
const double ESP = 1e-8;

int n, k;
int A[N], dp[N];
int main(){
    FIO
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    cin>>n>>k;
    for(int i=0; i<n; i++)cin>>A[i];
    memset(dp, OO, sizeof dp);
    dp[0] = 0;
    for(int i=0; i<n; i++){
        for(int j=1; j<=k; j++){
            if(i+j<n){
                dp[i+j] = min(dp[i+j], dp[i] + abs(A[i]- A[i+j]));
            }
        }
    }
    cout<<dp[n-1];

}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int A,B,C,K;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B>>C>>K;
	while(B<=A) B*=2, K--;
	while(C<=B) C*=2, K--;
	
	if(K>=0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i))
#define mat(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define each(x,y) for(auto &(x):(y))
#define var(type, ...)type __VA_ARGS__;Scan(__VA_ARGS__);
template<typename T> void Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void Scan(First& first, Rest&...rest) { cin >> first; Scan(rest...); }
#define vec(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define em emplace
#define pb pop_back
#define fi first
#define se second
#define get(a, i) get<i>(a)
#define bit_count __builtin_popcount
#define mt make_tuple
inline string zero(int a,string s,char c='0'){return string(a-len(s),c)+s;}
inline string zero(int a,int t,char c='0'){return zero(a, to_string(t), c);}
inline string zero(int a,ll t,char c='0'){return zero(a, to_string(t), c);}
#define mini min_element
#define maxi max_element
#define sum accumulate
#define chmax(a,b) if(a<b)a=b
#define chmin(a,b) if(a>b)a=b
template <class T> inline void print(T t){cout << t << '\n';}
template <class H, class... T> inline void print(H h, T... t){cout << h << " ";print(t...);}
ll mod = 1000000007;
ll modpow(ll a, int p) {
	if (p == 0)
		return 1;
	if (p & 1) {
		return a * modpow(a, p - 1) % mod;
	}
	ll half = modpow(a, p / 2);
	return half * half % mod;
}
ll modcomb(int a, int b) {
	if (a < 0 || b < 0 || a < b)
		return 0;
	chmin(b, a - b);
	ll ansMul = 1, ansDiv = 1;
	rep(i, 0, b) {
		ansMul = ansMul * (a - i) % mod;
		ansDiv = ansDiv * (i + 1) % mod;
	}
	return ansMul * modpow(ansDiv, mod - 2) % mod;
}
void solve() {
	var(int, n, m);
	ll ans = 1;
	for (int i = 2; i * i <= m; ++i) {
		if (m % i == 0) {
			int cnt = 0;
			while(m % i == 0) {
				m /= i;
				++cnt;
			}
			ans = ans * modcomb(n + cnt - 1, n - 1) % mod;
		}
	}
	if (m != 1) {
		ans = ans * n % mod;
	}
	print(ans);
}
int main() {
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a[5],k;int ma=0,mi=123;
	for(int i=0;i<5;i++)
	{
		cin>>a[i];
		ma=max(a[i],ma);
		mi=min(a[i],mi);
	}
	cin>>k;
	if(ma-mi>k)
	cout<<":(";
	else
	cout<<"Yay!";
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.awt.geom.*;
public class Main {
	boolean [][] clocktable;
	int ansclock, n;
	int [] inputxpos, inputypos;

	private void dfs(int deep, int startpos, int nowclock){
		if(deep == 9){
			nowclock += n;
			ansclock = Math.min(ansclock, nowclock);
			return;
		}
		for(int i = 1; i <= n; i++){
			boolean isarranged = true;
			for(int j = 0; j < n; j++){
				int xpos = startpos + i + inputxpos[j];
				int ypos = inputypos[j];
				if(clocktable[ypos][xpos]){
					isarranged = false;
					break;
				}
			}

			if(isarranged){
				//set
				for(int j = 0; j < n; j++){
					int xpos = startpos + i + inputxpos[j];
					int ypos = inputypos[j];
					clocktable[ypos][xpos] = true;
				}

				int nextstartpos = startpos + i;
				int nextclock = nowclock + i;
				dfs(deep + 1, nextstartpos, nextclock);

				//reset
				for(int j = 0; j < n; j++){
					int xpos = startpos + i + inputxpos[j];
					int ypos = inputypos[j];
					clocktable[ypos][xpos] = false;
				}
			}
		}
	}

	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(true){
			n = sc.nextInt();
			if(n == 0) break;
			inputxpos = new int[n];
			inputypos = new int[n];
			clocktable = new boolean[5][n * 10 + 1];
			int inputind = 0;
			for(int i = 0; i < 5; i++){
				String inputline = sc.next();
				for(int j = 0; j < inputline.length(); j++){
					char now = inputline.charAt(j);
					if(now == 'X'){
						inputxpos[inputind] = j;
						inputypos[inputind++] = i;
						clocktable[i][j] = true;
					}
				}
			}
			ansclock = 1 << 24;
			dfs(0, 0, 0);
			System.out.println(ansclock);
		}
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long K,A,B;cin>>K>>A>>B;
    long long ans=1;
    if(B-A>2){
        ans=A;
        K-=A-1;
        ans+=(K/2)*(B-A)+K%2;
    }
    else{
        ans+=K;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3644
#include <cstdio>
#include <algorithm>
using namespace std;
char s[3010], t[3010], a[3010];
int dp[3010][3010];
int main() {
	int i, j;
	scanf("%s%s", s, t);
	for (i = 0; s[i]; i++) {
		for (j = 0; t[j]; j++) {
			dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
			if (s[i] == t[j]) dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1);
		}
	}
	while (i && j) {
		if (dp[i][j] == dp[i-1][j-1] + 1 && s[i-1] == t[j-1]) {
			--i; --j;
			a[dp[i][j]] = s[i];
		} else if (dp[i][j] == dp[i-1][j]) {
			--i;
		} else {
			--j;
		}
	}
	puts(a);
	return 0;
}


Measured memory_bytes: 35456
#include<stdio.h>

void doit(){
  char clas[16];
  int s1,s2;
  int sum,sales;
  scanf("%s %d %d",clas,&s1,&s2);
  sum=s1+s2;
  sales=s1*200+s2*300;
  printf("%s %d %d\n",clas,sum,sales);
}

int main(){
  int i;
  for(i=0;i<9;i++){
    doit();
  }
  return 0;
}

Measured memory_bytes: 596
fun main(args: Array<String>) {
  val N = readInt()
  val abList = (2..N).map { readInts() }
  val graph = Graph(N)
  abList.forEach { graph.addEdge(it[0], it[1]) }
  val resultMap = mutableMapOf<Pair<Int, Int>, Int>()

  var maxNum = 0

  fun search(i: Int, from: Int, fromNum: Int) {
    val edgeSet = graph.getNode(i).edgeList
    var num = 1
    edgeSet.forEach { j ->
      if (j == from) return@forEach
      val a = Math.min(i, j)
      val b = Math.max(i, j)
      if (num == fromNum) num++
      resultMap[a to b] = num
      search(j, i, num)
      if (maxNum < num) maxNum = num
      num++
    }
  }
  search(1, 0, 0)
  println(maxNum)
  abList.forEach {
    println(resultMap[it[0] to it[1]])
  }
}

fun readString() = readLine()!!
fun readStrings() = readString().split(' ')
fun readInt() = readString().toInt()
fun readInts() = readStrings().map { it.toInt() }


class Node {
  //  val edgeSet = mutableSetOf<Int>()
  val edgeList = mutableListOf<Int>()
}

class Graph(nodeSize: Int) {
  private val nodeList = (1..nodeSize).map { Node() }
  fun getNode(id: Int) = nodeList[id - 1]
  fun addEdge(a: Int, b: Int) {
    getNode(a).edgeList.add(b)
    getNode(b).edgeList.add(a)
  }
}


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

int main() {
    string s, t;
    cin >> s >> t;
    vector<vector<int>> dp(s.size()+1, vector<int>(t.size()+1));
    for (int i = 1; i <= (int)s.size(); i++)
        for (int j = 1; j <= (int)t.size(); j++) {
            if (dp[i][j] < dp[i-1][j])
                dp[i][j] = dp[i-1][j];
            if (dp[i][j] < dp[i][j-1])
                dp[i][j] = dp[i][j-1];
            int base = dp[i-1][j-1];
            if (s[i-1] == t[j-1]) {
                if (dp[i][j] < base + 1)
                    dp[i][j] = base + 1;
            }
        }
    int i = s.size();
    int k = t.size();
    int len = dp[i][k];
    string ans(len, 'a');
    while (len) {
        if (s[i-1] == t[k-1]) {
            ans[--len] = s[--i];
            k--;
        } else {
            if (dp[i][k] == dp[i-1][k])
                i--;
            else
                k--;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 38580
s = input()
K = int(input())
 
l = len(s)
 
sub = []
 
for i in range(l):
    for j in range(K):
        sub.append(s[i:min(i+j+1,l)])

#print(sub)
subl = list(set(sub))

subl.sort()
#print(subl)
 
print(subl[K-1])

Measured memory_bytes: 5036
# -*- coding: utf-8 -*-


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

    l, r, d = map(int, input().split())
    count = 0

    for i in range(l, r + 1):
        if i % d == 0:
            count += 1

    print(count)


if __name__ == '__main__':
    main()


Measured memory_bytes: 8996
function Main(input) {

	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    
    let H = input[0].split(" ")[0];
    let W = input[0].split(" ")[1];
    let K = input[0].split(" ")[2];
    
    input.shift();
    
    let board = Array(H);
    let res = 0;
    
    for (let i = 0; i < H; i++) {
        
        let rows = input[i].split("");
        board[i] = rows.map(value => {
            if (value == ".") return 0;
            else return 1;
        });
        
    } //ここまでboard初期化
    
    for (let i = 0; i < 2 ** H; i++) {
        
        for (let j = 0; j < 2 ** W; j++) {
            
            let row_len = i.toString(2).split("").length;
            let col_len = j.toString(2).split("").length;
          
            let row_bit = i.toString(2).split("").map((value, index) => {
                if (value == "1") return row_len - index - 1;
                else return "";
            }).filter(value => value !== "");
            
            let column_bit = j.toString(2).split("").map((value, index) => {
                if (value == "1") return col_len - index - 1;
                else return "";
            }).filter(value => value !== "");
            
            let tmp_board = fillColumnAsRed(board, column_bit);
            tmp_board = fillRowAsRed(tmp_board, row_bit);
            //処理完了
          
            let sum = 0;
            tmp_board.forEach(value => {
                sum += value.filter(v => v === 1).length;
            })
            
            if (sum == K) res++;
            
        }
        
    }
    
    console.log(res);
    
}

function fillRowAsRed(board, rows){
    
    board = board.map((value, index) => {
        
        if(rows.indexOf(index) > -1) return value.fill(0);
        else return value;
        
    });
    
    return board;
    
}

function fillColumnAsRed(board, columns){
    
    board = board.map((value) => {
        
        return value.map((v, index) => {
            
            if(columns.indexOf(index) > -1) return 0;
            else return v;
            
        });
        
    });
    
    return board;
    
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 35452
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#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++)
#define chmin(x, y) x = min(x, y)
typedef long long ll;
const int INF = 1001001001;
const int mod = 1000000007;

int main() {
    int N, Y;
    cin >> N >> Y;
    rep(i, N + 1) {
        rep(j, N - i + 1) {
            int ans = 10000 * i + 5000 * j + 1000 * (N - i - j);
            if(ans == Y) {
                cout << i << " " << j << " " << N - i - j << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int a,b;
	char op;
	while(1){
		scanf("%d %c %d",&a,&op,&b);
		if(op == '+'){
			printf("%d\n",a+b);
		}else if(op == '-'){
			printf("%d\n",a-b);
		}else if(op == '*'){
			printf("%d\n",a*b);
		}else if(op == '/'){
			printf("%d\n",a/b);
		}else if(op == '?'){
			break;
		}
	}
	return 0;
}

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

long long k,n;
int arr[3003000];
long long sum=0;

int main(){
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>arr[i];
	}
	if(k>=n){
		cout<<0;
		return 0;
	}
	sort(arr+1,arr+n+1);
	int count=0;
	for(int i=n;count<k;i--){
		count++;
		arr[i]=0;
	}
	for(int i=1;i<=n;i++)sum+=arr[i];
	cout<<sum;
} 

Measured memory_bytes: 1024
#include <stdio.h>

int main(void)
{
  int x,y;
  while(1)
    {
  scanf("%d %d",&x,&y);

  if(x==0 && y==0)
    {
      break;
    }

  if(x>y)
    {
      int c=x;
      x=y;
      y=c;
    }
  printf("%d %d\n",x,y);
    }
  return 0;

}

Measured memory_bytes: 1028
#include <stdio.h>

int main(void){
    int h, w, flag = 0, f[50], plag = 0;
    char v;
    scanf("%d%d", &h, &w);
    getchar();
    for(int i = 0; i < 50; i++)
        f[i] = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            v = getchar();
            // printf("start>> i: %d j: %d flag: %d plag: %d f[j]: %d f[j-1]: %d\n",i, j, flag, plag, f[j], f[j-1]);
            if(v == '#'){
                // printf("In Black\n");
                plag = 0;
                if(flag == 0){
                    if(f[j] == 0){
                        plag = 1;
                        if(j == w - 1)
                            f[j] = 2;
                        else
                            f[j] = 1;
                    }
                    else
                        f[j] = 1;
                }
                else
                    f[j] = 1;
                flag = 1;
            }
            else{
                // printf("In White\n");
                if(plag == 1){
                    if(i == h - 1){
                        printf("No\n");
                        // printf("Status: ENDLINE\n");
                        return 0;
                    }
                    if(j != 0)
                        f[j - 1] = 2;
                }
                if(f[j] == 2){
                    printf("No\n");
                    // printf("Status: TAKECARE\n");
                    return 0;
                }
                f[j] = 0;
                flag = 0;
                plag = 0;
            }
            // printf("end>> i: %d j: %d flag: %d plag: %d f[j]: %d f[j-1]: %d\n",i, j, flag, plag, f[j], f[j-1]);
        }
        getchar();
        flag = 0;
        plag = 0;
    }
    printf("Yes\n");
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int a, b, c;
	int i = 0;

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

	while (a <= b){
		if (c % a == 0)i++;
		a++;
	}
	printf("%d\n", i);


	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <map>
using namespace std;

long long H, W, S, T;

int main() {
	cin >> H >> W >> S >> T;
	if ((H*W) % 2 == 0) cout << "Yes" << endl;
	else {
		if ((S + T) % 2 == 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 3092
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right


def solve_d(n, l_list):
    res = 0
    l_list_s = sorted(l_list)
    for i in range(1, n - 1):
        b = l_list_s[i]
        for j in range(0, i):
            a = l_list_s[j]
            res += bisect_left(l_list_s, a + b) - (i + 1)

    return res


def solve_d_(n, l_list):
    res = 0
    l_list_s = sorted(l_list)
    h = []
    for i in range(1, n - 1):
        for j in range(0, i):
            heappush(h, l_list_s[i] + l_list_s[j])
        while len(h) > 0:
            a = heappop(h)
            if a > l_list_s[i + 1]:
                heappush(h, a)
                break
        res += len(h)

    return res


def main():
    n = int(input())
    l_list = list(map(int, input().split()))
    res = solve_d(n, l_list)
    print(res)


def test():
    assert solve_d(4, [3, 4, 2, 1]) == 1
    assert solve_d(3, [1, 1000, 1]) == 0
    assert solve_d(7, [218, 786, 704, 233, 645, 728, 389]) == 23


if __name__ == "__main__":
    test()
    main()


Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <deque>
#include <vector>
using namespace std;
int main(void){
  int A,B,M;
  cin >> A >> B >> M;
  
  vector<int> fridges;
  vector<int> microwaves;
  
  for(int i=0;i<A;i++){
    int tmp;
    cin >> tmp;
    fridges.push_back(tmp);
  }
  int min_fridge = *min_element(fridges.begin(),fridges.end());
  
  for(int i=0;i<B;i++){
    int tmp;
    cin >> tmp;
    microwaves.push_back(tmp);
  }
  int min_micorwave = *min_element(microwaves.begin(),microwaves.end());
  
  int sum_min = min_fridge + min_micorwave;
  
  for(int i=0;i<M;i++){
    int x,y,c;
    cin >> x >> y >> c;
    --x;--y;
    int sum = fridges[x] + microwaves[y] - c;
    sum_min = min(sum_min,sum);
  }

  cout << sum_min << endl;
}


Measured memory_bytes: 1400
#!/usr/bin/env python3

import collections
import sys

def read_prob():
    inputs = []
    try:
        while True:
            line = input().strip()
            inputs.append(int(line))
    except EOFError:
        pass
    return inputs

if __name__ == '__main__':
    inputs = read_prob()
    so = sorted(inputs)
    so.reverse()
    for i in range(3):
        print(so[i])



Measured memory_bytes: 5996
local mod = 1000000007
local function badd(x, y) return (x + y) % mod end
local n, m = io.read("*n", "*n")
local f, dp = {}, {}
for i = 1, n + 2 do
  f[i] = true
  dp[i] = 0
end
for i = 1, m do
  local a = io.read("*n")
  f[a + 1] = false
end
dp[1] = 1
for i = 1, n do
  if f[i] then
    dp[i + 1] = badd(dp[i + 1], dp[i])
    dp[i + 2] = badd(dp[i + 2], dp[i])
  end
end
print(dp[n + 1])


Measured memory_bytes: 6452
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  ll term=c-a-b;
  if(term * term > 4*a*b && term > 0){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 256
threshhold = ((10**11)**0.5).floor
n,s = $stdin.read.split.map(&:to_i)

def f b, n
  if n < b
    n
  else
    f(b, n / b) + n % b
  end
end

if n == s
  puts n + 1 #割り切れない、最小値
else
  threshhold.times do |i|
    if f(i + 2, n) == s
      puts (i + 2)
      exit
    end
  end

  threshhold.times do |i|
    b = (n - s)/(threshhold - i) + 1
    next if b < 2
    if f(b, n) == s
      puts b
      exit
    end
  end

  puts -1
end

Measured memory_bytes: 1788
while True:
    n=int(input())
    ans,ans1,ans2,ans3,ans4,ans5,ans6=0,0,0,0,0,0,0
    if n==0:
        break
    for i in range(n):
        a=int(input())
        a=a//10
        if a==0:
            ans+=1
        if a==1:
            ans1+=1
        if a==2:
            ans2+=1
        if a==3:
            ans3+=1
        if a==4:
            ans4+=1
        if a==5:
            ans5+=1
        if a>=6:
            ans6+=1
    print(ans)
    print(ans1)
    print(ans2)
    print(ans3)
    print(ans4)
    print(ans5)
    print(ans6)


Measured memory_bytes: 5612
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;

int main(void){
    string S;

    cin >> S;

    for (int i = 0; i < S.length(); i++){
        printf("x");
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int n;
int f,r;
int B ,F,R,V;
int array[4][10][10];

void Array(int b,int f,int r)
{
	array[b-1][f-1][r-1] += V;
}

void input()
{
	for(int i=0; i<n; i++)
	{
			cin >> B >> F >> R >> V;
			Array(B,F,R);
	}
}


int main()
{
	cin >> n;

	for(int z=0; z<4; z++){
		for(int i=0; i<3; i++){
			for(int j=0; j<10; j++)
			{
				array[z][i][j] = 0;
			}
		}
	}

	input();

	for(int z = 0; z < 3; z++){
		for(int i=0; i<3; i++){
			for(int j=0; j<10; j++)
			{
				cout << " " << array[z][i][j];
			}
			cout << endl;
		}

		cout << "####################\n";
	}

	for(int i=0; i<3; i++){
		for(int j=0; j<10; j++)
		{
			cout << " " << array[3][i][j];
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
   int a,b;cin>>a>>b;
   int cur=1,ans=0;
   while(cur<b){
       cur--;
       cur+=a;
       ans++;
   }
   cout<<ans;
}

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

int main() {
	int a;
	cin>>a;
	int b;
	cin>>b;

if(a!=1&&b!=1){
	cout<<1;}
	else if(a!=2&&b!=2){
		cout<<2;

	}
	else if(a!=3&&b!=3){
		cout<<3;
	}

	return 0;
}


Measured memory_bytes: 256
//
#include <vector>
#include <set>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstdint>
//
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
void yes(bool cond) { cond ? puts("Yes") : puts("No"); }
//
ll sum(ll n) { return n * (n + 1) / 2; }
//
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll s = sum(N) - sum(N / 3) * 3 - sum(N / 5) * 5 + sum(N / 15) * 15;
    printf("%lld", s);
}

Measured memory_bytes: 3228
#include"bits/stdc++.h"
    using namespace std;
    using ll = long long ;
    ///PBDS Starting.......

    //#include <ext/pb_ds/assoc_container.hpp>
    //#include <ext/pb_ds/tree_policy.hpp>
    //using namespace __gnu_pbds;
    //#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

    ///PBDS_SET
    ///Index of Value - .order_of_key()
    ///Value at Index - .find_by_order()
    ///typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> pbds_set;
    ///typedef tree<int, null_type, lessorequal<int>, rb_tree_tag,tree_order_statistics_node_update> pbds_multiset;

    /// PBDS closing......
    #define int long long
    #define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.setf(ios::fixed); cout.precision(20)
    #define endl '\n'
    ///............Author..................................................................
    ///........... :: .....................................................................
    ///...........(  NOBODY  )................................................................
    ///........... Bangabandhu Sheikh Mujibur Rahman Science and Technlogy University,Gopalganj
    ///........... ( N~76 ) ...................................................................
    ///........... No Copyright .....You can copy and paste my code without any permission.....
    /// !!!!!!!!!!!!!!!........................................................................
    #define pb push_back
    #define esp 0.000000001
    #define pi acos(-1)
    #define N 1000009
    #define ff first
    #define ss second
    #define all(x) x.begin(),x.end()
    /// Code Loading Please wait.............
    /// returning to N~76.
    /// Loading Finished.....................

    int32_t main()
    {
        FAST_IO;
        int n;
        cin>>n;
        double ans=(double)2*pi*n;
        cout<<ans<<endl;
        return 0;
    }



Measured memory_bytes: 3788
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
// #define ll int
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 2100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[8] ={1,0,-1,0,1,-1,1,-1};
ll dy[8] ={0,1,0,-1,1,-1,-1,1};
 
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; }


ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

void solve(){
    ll n,k;
    cin>>n>>k;
    COMinit();
    ll ans=0;
    if(n<=k){
        ans=COM(2*n-1,n);
        cout<<ans<<endl;
    }
    else{
        rep(i,k+1){
            ll sum=COM(n,i);
            sum*=COM(i+n-i-1,i);
            sum%=MOD;
            ans+=sum;
            ans%=MOD;
            // cout<<i<<" "<<ans<<endl;
        }
        cout<<ans<<endl;
    }

}



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

    solve(); 


    return 0;
}


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

using namespace std;

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

const int M = 333333;
int sosu[M];

vector<int> num;
int main(){
	sosu[1]=1;
	for(int i=7;i<M;i+=7){
		int di[2]={-1,1};
		for(int j=0;j<2;j++){
			int p = i+di[j];
			if(sosu[p]==1)continue;
			for(int k=p*2;k<M;k+=p){
				sosu[k]=1;
			}
			num.push_back(p);
		}
	}
	
	
	while(1){
		int n;
		cin>>n;
		
		if(n==1)break;
		map<int,int> visit;
		
		printf("%d:",n);
		rep(i,num.size()){
			if(n%num[i]==0){
				printf(" %d",num[i]);
			}
		}puts("");
	}
}

Measured memory_bytes: 2628