akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,A,B;
  cin >> N;
  
  for(int a = 0; a <= 25; a++){
    for(int b = 0; b <= 15; b++){
      int total = 4*a + 7*b;
      if(total == N){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
        cout << "No" << endl;
}
   

Measured memory_bytes: 3640
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>

using namespace std;

long long n,m;

int main()
{
	cin>>n>>m;
  if (n>=2 && m>=2)
  {
  	cout<<(n-2)*(m-2);
  }
  else
    if (n==1&&m==1) cout<<1; else
    cout<<max(n*m-2,(long long)0);
  return 0;
}


Measured memory_bytes: 256
def solve2(nums)
  count = 0

  while true
    exist_odd = false
    if nums.any?(&:odd?)
      exist_odd = true
    end

    break if exist_odd

    nums = nums.map{ |num| num/2 }
    count += 1
  end

  count
end

n = gets.to_i
nums = gets.chomp.split(' ').map(&:to_i)

answer = solve2(nums)
puts "#{answer}"

Measured memory_bytes: 1788
#include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const int N=101;

signed main(){
  int n;
  while(cin>>n,n){
    int dp[35]={};
    dp[1]=1,dp[2]=2,dp[3]=4;
    loop(i,4,31){
      dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
    }
    cout<<dp[n]/3650+1<<endl;
  }
 return 0;
}

Measured memory_bytes: 3092
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<n;i++)

int main() {
	ll n, k;
	cin >> n >> k;
	cout << min(n % k, k - n % k) << endl;
	return 0;
	}

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

int main()
{
    double radius;
    cin >> radius;
    double area = radius * radius * M_PI;
    double circumference =  radius * 2 * M_PI;
    
    cout << fixed << setprecision(6) << area << " ";
    cout << fixed << setprecision(6) << circumference << endl;
}


Measured memory_bytes: 3232
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int M = stdIn.nextInt();
		int[] As = new int[N];
		double totalVotes = 0;
		for(int i = 0; i < N; i ++) {
			As[i] = stdIn.nextInt();
			totalVotes += As[i];
		}
		
		int buyNum = 0;
		
		for(int i = 0; i < As.length; i ++) {
			if(totalVotes / (4 * M) <= As[i]) {
				buyNum ++;
			}
		}
		
		if(M <= buyNum) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

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

    int N; cin >> N;
    vi a(N); rep(i,N) cin >> a[i];
    int now = 1;
    bool flag = false;
    rep(i,N) {
        if(a[i] == 1) {
            flag = true;
            break;
        }
    }
    if(!flag) dame

    rep(i,N) {
        if(now == a[i]) now++;
    }
    cout << N - now + 1 << endl;

}

Measured memory_bytes: 1024
# 多くても 3 つがぎりぎり焼ける位置
from math import acos
from cmath import exp
from itertools import combinations
N, K = map(int, input().split())
XYC = []
for _ in range(N):
    x, y, c = map(int, input().split())
    XYC.append((complex(x, y), c))
if K==1:
    print(0)
    exit()
ans = 1e300
eps = 1e-7
for (p1, c1), (p2, c2) in combinations(XYC, 2):
    p_center = (p1 * c1 + p2 * c2) / (c1 + c2)
    t = abs(p_center-p1) * c1
    k = 0
    for xy, c in XYC:
        if abs(p_center-xy) * c < t + eps:
            k += 1
    if k >= K and t < ans:
        ans = t

def get_center(p1, p2, p3, c1, c2, c3):
    if c1 == c2 == c3:
        t1, t2, t3 = p2-p3, p3-p1, p1-p2
        denom = (t1*p1.conjugate()+t2*p2.conjugate()+t3*p3.conjugate())
        if denom == 0:
            return []
        return [(t1*abs(p1)**2+t2*abs(p2)**2+t3*abs(p3)**2) / denom]
    elif c1 == c3:
        c2, c3 = c3, c2
        p2, p3 = p3, p2
    elif c2 == c3:
        c1, c3 = c3, c1
        p1, p3 = p3, p1
    o1 = (c1*c1*p1-c3*c3*p3)/(c1*c1-c3*c3)
    r1 = (c1*c3*abs(p1-p3))/abs(c1*c1-c3*c3)
    o2 = (c2*c2*p2-c3*c3*p3)/(c2*c2-c3*c3)
    r2 = (c2*c3*abs(p2-p3))/abs(c2*c2-c3*c3)
    l = abs(o1-o2)
    if r1+r2 < l or l+r1<r2 or l+r2<r1:
        return []
    cos_a = (r1*r1+l*l-r2*r2)/(2*r1*l)
    a = acos(cos_a)
    res1 = o1 + (o2-o1) * exp(a*1j) * r1 / l
    res2 = o1 + (o2-o1) * exp(-a*1j) * r1 / l
    return [res1, res2]

for (p1, c1), (p2, c2), (p3, c3) in combinations(XYC, 3):
    p_centers = get_center(p1, p2, p3, c1, c2, c3)
    for p_center in p_centers:
        t = abs(p1 - p_center) * c1
        # print(abs(p1 - p_center) * c1,
        #       abs(p2 - p_center) * c2,
        #       abs(p3 - p_center) * c3)
        k = 0
        for p, c in XYC:
            if abs(p_center - p) * c < t + eps:
                k += 1
        if k >= K and t < ans:
            ans = t

print(ans)


Measured memory_bytes: 9876
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

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; }

#define MAX_N 1000
#define MAX_M 100

const long long INF = 1LL << 60;

//境界値に注意！！！

// DP テーブル
ll dp[110][100010]={0};

int main (){
    ll n,w;
    cin >> n >> w;
    ll weight[n+10],value[n+10];
    for (ll i=0;i<n;i++)cin >> weight[i] >> value[i];
    for (ll i=0;i<n;i++){
        for (ll sum_w=0;sum_w<=w;sum_w++){
            if (sum_w-weight[i]>=0){
                chmax(dp[i+1][sum_w],dp[i][sum_w-weight[i]]+value[i]);
            }
            chmax(dp[i+1][sum_w],dp[i][sum_w]);
        }
    }
    cout << dp[n][w] << endl;
}


Measured memory_bytes: 79360
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

const int A = 200001;

int n, las[A], cnt[A];
ll k;
vector <int> a;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k;
    a.resize(n);
    for(auto &i : a) cin >> i;
    for(int i = n - 1 ; i >= 0 ; i--){
        las[a[i]] = i;
    }
    vector <int> nex(n + 1);
    //~ n is a dummy index
    for(int i = n - 1 ; i >= 0 ; i--){
        int l = las[a[i]];
        if(l == i && l == n - 1) nex[i] = n;
        else if(l <= i || l == n - 1) nex[i] = (l + 1) % n;
        else nex[i] = nex[l + 1];
        las[a[i]] = i;
    }
    vector <vector <int> > p(n + 1, vector <int>(40));
    for(int i = 0 ; i <= n ; i++){
        p[i][0] = nex[i];
    }
    for(int i = 1 ; i < 40 ; i++){
        for(int j = 0 ; j <= n ; j++){
            p[j][i] = p[p[j][i - 1]][i - 1];
        }
    }
    k--;
    int cur = 0;
    for(int i = 0 ; i < 40 ; i++){
        if((k >> i) & 1){
            cur = p[cur][i];
        }
    }
    vector <int> ans;
    for(int i = cur ; i < n ; i++){
        if(cnt[a[i]]){
            while(cnt[a[i]]){
                cnt[ans.back()]--;
                ans.pop_back();
            }
        }
        else{
            ans.push_back(a[i]);
            cnt[a[i]]++;
        }
    }
    for(auto &i : ans) cout << i << " ";
    cout << endl;
}


Measured memory_bytes: 44664
/* winners never quit and quitters never win.
      #swap                                 */
      
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize ("-O3")
using ll = long long;
using ld = long double;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;
const ll rk = 256;
const ld PI = 3.141592653589793;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

template <typename T>
void make_unique(vector<T>& vec) {
  sort(all(vec));
  vec.erase(unique(all(vec)), vec.end());
}

#define endl '\n'
#define pb push_back
#define mp make_pair
#define vc vector
#define fs first
#define sec second
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll> 
#define pls pair<ll,string>
#define psl pair<string,ll>
#define plc pair<ll,char>
#define pcl pair<char,ll>
#define pss pair<string,string>
#define all(x) (x).begin(), (x).end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define T ll t=0;cin>>t;for(ll test=0;test<t;test++)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


ll nxt() {
    ll TemporaryVariable;
    cin >> TemporaryVariable;
    return TemporaryVariable;
}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

 
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
	//isprime();
	//coeff();
	/*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/
    string s;
    cin>>s;
    ll n=(ll)s.length();
    if(s[n-1]=='s')
        s+="es";
    else
        s+="s";
    cout<<s<<endl;
	printclock;
	return 0;
}

Measured memory_bytes: 3744
number_of_guests = input().split()

A = int(number_of_guests[0])
B = int(number_of_guests[1])


A_divisors = []
x = 2
while True:
    if (A % x == 0):
        A /= x
        A_divisors.append(x)
    else:
        x += 1

    if (A <= 1):
        break

y = 2
B_divisors = []
while True:
    if (B % y == 0):
        B /= y
        B_divisors.append(y)
    else:
        y += 1

    if (B <= 1):
        break

A_only = [x for x in A_divisors if (x not in B_divisors)]
B_only = [y for y in B_divisors if (y not in A_divisors)]

common_divisors = []
for z in (A_divisors + B_divisors):
    if z in A_divisors and z in B_divisors:
        if (A_divisors.count(z) >= B_divisors.count(z)):
            common_divisors.append(z**A_divisors.count(z))
        else:
            common_divisors.append(z**B_divisors.count(z))

        A_divisors = list(filter(lambda x: x != z, A_divisors))
        B_divisors = list(filter(lambda x: x != z, B_divisors))


result = 1
for x in A_only + B_only + common_divisors:
    result *= x

print(result)


Measured memory_bytes: 3064
n,m=gets.split.map(&:to_i)
mod=1000000007
#puts "直接 => #{(n**m)%mod}"
if m==0
    p n%mod 
else
ns=[]
while(m!=0)
    if m%2==1
        ns.push(n)
    end
    n=n**2%mod
    m/=2
end
p ns.inject{|a,b|a*b}%mod
end


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

using namespace std;

int main(void){
    long long N;
    cin >> N;
    long long init = 100;
    
    int count = 0;
    while(1) {
        init += init / 100;
        count++;
        if(init >= N) {
            cout << count << endl;
            return 0;
        }
        
    }
    return 0 ;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans[100005]={0};
int main(){
  ll n;
  cin>>n;
  vector<ll> vec,cos,cnt,pos;
  vec.push_back(0);
  cos.push_back(0);
  cnt.push_back(0);
  pos.push_back(0);
  ll max_val=0;
  for(int i=1;i<=n;i++){
    ll a;
    cin>>a;
    if(a>max_val) {
      vec.push_back(a);
      cos.push_back(0);
      cnt.push_back(0);
      pos.push_back(i);
      max_val=a;
    }
    int pos=lower_bound(vec.begin(),vec.end(),a)-vec.begin();
    cnt[pos-1]++;
    cos[pos]+=a-vec[pos-1];
  }
  ll k=vec.size();
  for(int i=k-1;i>0;i--){
    cnt[i-1]+=cnt[i];
  }
  for(int i=1;i<k;i++){
    ans[pos[i]]=(vec[i]-vec[i-1])*cnt[i]+cos[i];
  }
  for(int i=1;i<=n;i++) cout<<ans[i]<<endl;
}


Measured memory_bytes: 5076
using System;
using System.IO;
using System.Linq;
using System.Runtime;
using System.Reflection;
using System.Diagnostics;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using static System.Math;


class P
{
    static void Main()
    {
        int[] nkl = Console.ReadLine().Split().Select(int.Parse).ToArray();
        UnionFind road = new UnionFind(nkl[0]);
        UnionFind train = new UnionFind(nkl[0]);
        for (int i = 0; i < nkl[1]; i++)
        {
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            road.Union(a[0] - 1, a[1] - 1);
        }
        for (int i = 0; i < nkl[2]; i++)
        {
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            train.Union(a[0] - 1, a[1] - 1);
        }
        Dictionary<long, int> dict = new Dictionary<long, int>();
        for (int i = 0; i < nkl[0]; i++)
        {
            long key = (long)road.Parent(i) * int.MaxValue + (long)train.Parent(i);
            if (!dict.ContainsKey(key)) dict.Add(key, 0);
            dict[key]++;
        }
        int[] ans = new int[nkl[0]];
        for (int i = 0; i < nkl[0]; i++)
        {
            long key = (long)road.Parent(i) * int.MaxValue + (long)train.Parent(i);
            ans[i] = dict[key];
        }
        Console.WriteLine(string.Join(" ", ans));
    }
}

class UnionFind
{
    int[] data;
    public UnionFind(int count)
    {
        data = Enumerable.Range(0, count).ToArray();
    }
    public void Union(int x, int y)
    {
        int xp = Parent(x);
        int yp = Parent(y);
        if (xp != yp)
        {
            data[yp] = xp;
        }
    }
    public bool IsSameGroup(int x, int y) => Parent(x) == Parent(y);
    public int[] AllParents() => data.Where((x, y) => x == y).ToArray();
    public int Parent(int x)
    {
        form(x);
        return data[x];
    }
    private void form(int x)
    {
        while (data[x] != data[data[x]])
        {
            data[x] = data[data[x]];
        }
    }
}

Measured memory_bytes: 37532
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;

int main() {
  int a, b; cin>>a>>b;
  int d = b - a;
  int sum = 0;
  for(int i = 1; i <= d; i++) sum += i;
  cout << sum-b << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
l = list(map(int,input().split(" ")))
ans = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] < l[j] & l[j] < l[k]:
        if l[i] != l[j] != l[k]:
          if l[i] + l[j] + l[k] > max(l[i],l[j],l[k])*2:
            ans += 1

print(ans)
      



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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



int n, m, a[101010], b[101010];
vector<P> v[101010];
string ans[101010];
void solve(){
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> a[i] >> b[i];
		v[a[i]].push_back({b[i],i});
	}
	for(int i = 0; i <= n; i++){
		sort(v[i].begin(),v[i].end());
		int cnt = 1;
		for(auto j : v[i]){
			int x = j.second;
			for(int k = 100000; k > 0; k/=10){
				ans[x] += (char)('0'+a[x]/k);
				a[x]%=k;
			}
			int c = cnt;
			for(int k = 100000; k > 0; k/=10){
				ans[x] += (char)('0'+c/k);
				c %= k;
			}
			cnt++;
		}
	}
	
	for(int i = 0; i < m; i++){
		cout << ans[i] << endl;
	}
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

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

using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c()
{
#ifndef  ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int getSum(int n)
{
	int sum;


	for (sum = 0; n > 0; sum += n % 10, n /= 10);

	return sum;
}
int neighbours(int i, int j, int n, int m)
{
	int c = 0;
	if (i + 1 < n)
		c++;
	if (i - 1 >= 0)
		c++;
	if (j + 1 < m)
		c++;
	if (j - 1 >= 0)
		c++;
	return c;
}
int32_t main()
{
	FIO;
	
	int n;
	cin >> n;
	int a[n + 1];
	int i;
	for (i = 1; i <= n; i++)
		cin >> a[i];
	if (is_sorted(a + 1, a + n + 1))
	{
		cout << "YES";
		return 0;
	}
	int count = 2;
	for (i = 1; i <= n; i++)
	{
		if (i != a[i])
			count--;
	}
	//cout << count;
	if (count == 0)
		cout << "YES";
	else
		cout << "NO";

}








Measured memory_bytes: 3652
N,Y = map(int,input().split())

for x in range(N+1):
    for y in range(N+1-x):
        p = x*10000 + y*5000
        if p > Y: break
        rem = Y - p
        z = rem//1000
        if x+y+z == N:
            print(x,y,z)
            exit()
print(-1,-1,-1)

Measured memory_bytes: 66124
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const ll mod=1e9+7;
const int M=5010;
int n,sze[M];
ll cal[M],f[M][M];

struct ss{
	int to,last;
	ss(){}
	ss(int a,int b)
	:to(a),last(b){}
}g[M<<1];
int head[M],cnt;
void add(int a,int b){
	g[++cnt]=ss(b,head[a]);head[a]=cnt;
	g[++cnt]=ss(a,head[b]);head[b]=cnt;
}
void init(){
	cal[0]=1;
	for(int i=2;i<=n;i+=2)cal[i]=(cal[i-2]*(i-1))%mod;
}
void dfs(int a,int b){
	sze[a]=1;f[a][1]=1;ll tot=0;
	for(int eg=head[a];eg;eg=g[eg].last){
		if(g[eg].to==b) continue;
		dfs(g[eg].to,a);
		int tosze=sze[g[eg].to];tot=0;
		for(int i=1;i<=tosze;i++)tot=(tot+f[g[eg].to][i]*cal[i])%mod;
		for(int i=tosze+sze[a];i>0;i--){
			ll now=f[a][i]*tot%mod;
			now=-now+mod;
			for(int j=max(1,i-sze[a]),up=min(i,tosze);j<=up;j++)
			now=(now+f[a][i-j]*f[g[eg].to][j]%mod)%mod;
			f[a][i]=now;
		}
		sze[a]+=tosze;
	}
}
ll ans;
void calc(){
	for(int i=1;i<=n;i++)ans=(ans+f[1][i]*cal[i])%mod;
}
int a,b;
int main(){
	scanf("%d",&n);
	for(int i=1;i<n;i++){
		scanf("%d%d",&a,&b);
		add(a,b);
	}
	init();
	dfs(1,0);
	calc();
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 194816
#include "bits/stdc++.h"
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 imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

const int INF = 1e9 + 5;

int main() {
  int k;
  string s;
  cin>>k;
  cin>>s;
  for(int i =0 ; i < s.size(); i++){
    int val = s[i] - 'A' +k;
    val %= 26;
    cout<<(char)(val+'A');
  }
  
    
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS (1e-8)
#define MOD 1000000007
#define PI 3.141592653589793
#define RMAX 4294967295
#define equals(a,b)(fabs((a)-(b))<EPS)

using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vd = vector<double>;
using vP = vector<P>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using vvd = vector<vector<double>>;
using vvP = vector<vector<P>>;
using comp = complex<double>;
using vcomp = vector<complex<double>>;
using pqli = priority_queue<int, vector<int>, greater<int>>;
using pqlll = priority_queue<ll, vector<ll>, greater<ll>>;
using pqlP = priority_queue<P, vector<P>, greater<P>>;


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

	int R, G;
	cin >> R >> G;

	cout << 2*G-R << endl;

	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

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

	g := make([][]int, n)
	for i := 0; i < n; i++ {
		g[i] = make([]int, 0)
	}

	es := make([][2]int, n)
	var a, b int
	for i := 0; i < n-1; i++ {
		fmt.Scan(&a, &b)
		a, b := a-1, b-1
		g[a] = append(g[a], b)
		es[i] = [2]int{a, b}
	}

	em := make(map[[2]int]int)
	vm := make(map[[2]int]bool)

	mx := 0
	q := make([]int, 1)
	q[0] = 0
	for len(q) > 0 {
		v := q[0]
		q = q[1:]

		cnt := 0
		for _, v2 := range g[v] {
			if vm[[2]int{v, cnt}] {
				cnt++
			}
			vm[[2]int{v2, cnt}] = true
			em[[2]int{v, v2}] = cnt

			if mx < cnt {
				mx = cnt
			}
			q = append(q, v2)
			cnt++
		}
	}

	fmt.Println(mx + 1)
	for i := 0; i < n-1; i++ {
		fmt.Println(em[es[i]] + 1)
	}
}


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

int main(){
    int N;
    cin >> N;
    int a;
    int count1, count4, count2;

    count1=0;
    count2=0;
    count4=0;
    for(int i=0; i<N; i++){
        cin >> a;
        if( a%2==0 ){
            if( a%4==0 ){
                count4++;
            }else{
                count2++;
            }
        }else{
            count1++;
        }
    }

    if( count4 >= count1 ){
        if( count4>0 ||  count2 > 1  ){
            cout << "Yes" << endl;
            return 0;
        }    
    }else if( count4 >0 && count4 == count1-1 && count2==0 ){
        cout << "Yes" << endl;
        return 0;        
    }

    cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/python3
import sys
from collections import Counter
input = lambda: sys.stdin.readline().strip()
n = int(input())
a = [int(x) for x in input().split()]
c = Counter(a)
def c2(n):
    return n * (n - 1) // 2

ans = sum(c2(v) for v in c.values())

def add(x):
    global ans
    ans -= c2(c[x])
    c[x] += 1
    ans += c2(c[x])

def remove(x):
    global ans
    ans -= c2(c[x])
    c[x] -= 1
    ans += c2(c[x])

for x in a:
    remove(x)
    print(ans)
    add(x)

Measured memory_bytes: 109372
#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<algorithm>
using namespace std;
long long fact[200005]={1},inv[200005]={1},mod=998244353;
long long power(long long n,long long m){
	if(!m)
		return 1;
	long long v=power(n,m>>1);
	if(m&1)
		return v*v%mod*n%mod;
	return v*v%mod;
}
long long C(long long n,long long m){
	return fact[n]*inv[m]%mod*inv[n-m]%mod;
}
int main(){
	long long i,n,m,k,ans=0;
	scanf("%lld%lld%lld",&n,&m,&k);
	for(i=1;i<=n;i++){
		fact[i]=fact[i-1]*i%mod;
		inv[i]=power(fact[i],mod-2);
	}
	for(i=n-k-1;i<n;i++)
		ans=(ans+C(n-1,i)*m%mod*power(m-1,i)%mod)%mod;		
	printf("%lld\n",ans);
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

ll N;

constexpr ll max_n = 1000006;
bool prime[max_n];

void solve(){
    int cnt=0;
    for(int i=2;i<=N;i++) if(prime[i]) cnt++;
    cout << cnt << endl;
}

int main(){
    rep(i,max_n) prime[i]=true;
    for(int i=2;i*i<max_n;i++){
        if(!prime[i]) continue;
        for(int j=i*i;j<max_n;j+=i) prime[j] = false;
    }

    while(cin>>N){
        solve();
    }
}

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

fn main() {
    let (a1, b1) = get!(usize, usize);
    let (a2, b2) = get!(usize, usize);
    let (a3, b3) = get!(usize, usize);

    // 次数3の頂点が存在するならばNO
    let mut dp = vec!(0; 5);
    dp[a1] += 1;
    dp[b1] += 1;
    dp[a2] += 1;
    dp[b2] += 1;
    dp[a3] += 1;
    dp[b3] += 1;
    let ans = if !dp.contains(&3) {
        "YES"
    } else {
        "NO"
    };

    println!("{}", ans);
}


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


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

    long answ;

    answ = K;
    for(int i=0;i<N-1;i++){
        answ*=(K-1);
    }



    cout << answ << endl;
}



Measured memory_bytes: 256
/*
"Won't stop untill I'm Phenomenal"
- Phenomenal, EMINEM
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size())  cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" ";	cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" ";	cout<<endl;
const ll INF = 2e18;
const int inf = 2e9;
const int mod1 = 1e9 + 7;



int main(){
    Shazam;
    vector<ll> a(2), b(2);
    get(a);
    get(b);
    ll ans = LONG_LONG_MIN;
    for(int i = 0 ; i < 2; i++){
        for(int j =0 ;j <2; j++){
            ans = max(ans, a[i]*b[j]);
        }
    }
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 3636
#include <cstdio>

using namespace std;

int main()
{
	int r,c;
	
	while(scanf("%d %d", &r, &c), r != 0 && c != 0){
		if((r*c)%2 == 0) printf("yes\n");
		else printf("no\n");
	}
	
	return(0);
}

Measured memory_bytes: 1012
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<pair<int,int>> E(N-1);
  vector<int> M(N+1);
  vector<int> nodec(N);  
  vector<int> edgec(N-1);  
  for (auto &[f,t]: E) {
    cin >> f >> t;
    ++M[--f];
    ++M[--t];
  }

  vector<int> I(N-1);
  iota(begin(I),end(I),0);
  sort(begin(I),end(I),[&](int i, int j){return E[i] < E[j];});
  int NC = *max_element(begin(M),end(M));
  cout << NC << endl;
  nodec[1] = 0;
  for (auto i: I) {
    auto [f,t] = E[i];
    nodec[f] %= NC;
    edgec[i] = nodec[t] = ++nodec[f];
  }

  for(auto c: edgec) cout << c << endl;
}


Measured memory_bytes: 5404
N = int(input())
A = []
for i in range(N):
    s = input().strip().split(".")
    a = int(s[0]) * (10 ** 9)
    if len(s) > 1:
        t = s[1] + "0" * (9 - len(s[1]))
        a += int(t)
    A.append(a)
    
c = [[0 for _ in range(19)] for _ in range(19)]

for i in range(N):
    p = A[i]
    cnt2 = 0
    while(not p % 2):
        p /= 2
        cnt2 += 1

    p = A[i]
    cnt5 = 0
    while(not p % 5):
        p /= 5
        cnt5 += 1
    #print(A[i], cnt2, cnt5)
    c[min(cnt2, 18)][min(cnt5, 18)] += 1
    
ans = 0
for i in range(19):
    for j in range(19):
        for k in range(19):
            for l in range(19):
                if i + k >= 18 and j + l >= 18:
                    if i == k and j == l and c[i][j]:  ans += (c[i][j] * (c[i][j] - 1))
                    else:  ans += (c[i][j] * c[k][l])
print(ans // 2)


Measured memory_bytes: 87460
n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(n):
  at,bt=map(int,input().split())
  a.append(at)
  b.append(bt)
for j in range(m):
  ct,dt=map(int,input().split())
  c.append(ct)
  d.append(dt)
for i in range(n):
  temp=0
  man=99999999999999999
  for j in range(m):
    if abs(a[i]-c[j])+abs(b[i]-d[j])<man:
      man=abs(a[i]-c[j])+abs(b[i]-d[j])
      temp=j+1
  print(temp)

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


int main(void){
  int n;

  cin>>n;

  int a[100000],b[100000],c[100000];

  long long ans = 0;

  for(int i=0;i<n;i++)
    cin>>a[i];
  sort(a,a+n);

  for(int i=0;i<n;i++)
    cin>>b[i];

  for(int i=0;i<n;i++)
    cin>>c[i];
  sort(c,c+n);

  for(int i=0;i<n;i++){
    long long s = lower_bound(a,a+n,b[i]) -a;
    long long t = n - (upper_bound(c,c+n,b[i])-c);
    ans += s * t;
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>


#ifndef ULLONG
typedef unsigned long long ULLONG;
#endif
#ifndef LLONG
typedef long long LLONG;
#endif
template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}

static void A_task();

int main()
{
	A_task();
	
	fflush(stdout);
	return 0;
}

static void A_task()
{
	int r;
	get1int(r);

	printf("%d\n", 3 * r * r);
}


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

using namespace std;

int main(void) {
    int x1, x2, x3, x4, x5;
    cin >> x1 >> x2 >> x3 >> x4 >> x5;
    if(x1 == 0){
        cout << 1 << endl;
    }
    else if(x2 == 0){
        cout << 2 << endl;
    }
    else if(x3 == 0){
        cout << 3 << endl;
    }
    else if(x4 == 0){
        cout << 4 << endl;
    }
    else if(x5 == 0){
        cout << 5 << endl;
    }
    return 0;
}


Measured memory_bytes: 3624
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int N = sc.nextInt();
      int i=1;
      while(i*1000<N){
        	i++;
      }
      System.out.println(i*1000-N);
    }
}

Measured memory_bytes: 27052
#include<iostream>
#include<algorithm>
using namespace std;
int a[10010];

int main() {
	int n;
	cin >> n;
	int count = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];	
		while (a[i] % 2 == 0) {
			a[i] /= 2;
			count++;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h,n;
    cin>>h>>n;
    int x;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        h-=x;
        if(h<=0)
        {
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    //system("pause");
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int isRight(int height, int arg_x, int arg_y, int arg_H, int arg_Cx, int arg_Cy);

int main()
{
	int N;
	int Cx, Cy, H;
	bool tmp;
	bool Specified = false;

	cin >> N;

	int* x = new int[N];
	int* y = new int[N];
	int* h = new int[N];

	for (int i = 0; i < N; i++) cin >> x[i] >> y[i] >> h[i];

	for (Cx = 0; Cx <= 100; Cx++) {
		for (Cy = 0; Cy <= 100; Cy++) {
			for (int i = 0; i < N; i++) {
				if (h[i] > 0) {
					H = h[i] + abs(x[i] - Cx) + abs(y[i] - Cy);
					break;
				}
			}

			for (int i = 0; i < N; i++) {
				tmp = isRight(h[i], x[i], y[i], H, Cx, Cy);
				if (!tmp) break;

				if (i == N - 1) Specified = true;
			}
			if (Specified) break;
		}
		if (Specified) break;
	}

	delete[] x, y, h;

	cout << Cx << ' ' << Cy << ' ' << H << endl;

	return 0;
}

int isRight(int height, int arg_x, int arg_y, int arg_H, int arg_Cx, int arg_Cy)
{
	int tmp;
	bool ret = false;

	tmp = arg_H - abs(arg_x - arg_Cx) - abs(arg_y - arg_Cy);
	if (tmp < 0) tmp = 0;

	if (height == tmp) ret = true;

	return ret;
}


Measured memory_bytes: 256
import java.util.*;
class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int k=sc.nextInt();
  int n=7;
  n%=k;
  int i;
  for(i=0;i<k+1;i++){
    if(n==0){
    break;
    }
  	n*=10;
    n+=7;
    n%=k;
  }
  if(i==k+1){System.out.println(-1);}
  else{
    System.out.print(i+1);
  }
}
}

Measured memory_bytes: 35728
import sys

import numpy as np

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    A = np.full((N, N), "", dtype=str)
    for i in range(N):
        A[i] = list(input().rstrip())
    B = np.full((M, M), "", dtype=str)
    for i in range(M):
        B[i] = list(input().rstrip())

    ans = "No"
    L = N - (M - 1)
    for i in range(L):
        for j in range(L):
            if np.all(A[i:i + M, j:j + M] == B):
                ans = "Yes"
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 12508
package main

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

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func newIO() *IO {
	return &IO{
		scanner: bufio.NewScanner(os.Stdin),
		writer:  bufio.NewWriter(os.Stdout),
	}
}

func (IO *IO) nextLine() string {
	IO.scanner.Scan()
	return IO.scanner.Text()
}

func (IO *IO) nextInt() int {
	i, e := strconv.Atoi(IO.nextLine())
	if e != nil {
		panic(e)
	}
	return i
}

func (IO *IO) scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		num = IO.nextInt()
		nums = append(nums, num)
	}
	return
}

func (IO *IO) printLn(a ...interface{}) {
	fmt.Fprintln(IO.writer, a...)
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func sumSlice(nums []int) int {
	sum := 0
	for _, n := range nums {
		sum += n
	}
	return sum
}

func binarySearch(target int, list []int) int {
	left := 0
	right := len(list) - 1
	mid := (left + right) / 2

	for {
		if list[mid] < target {
			left = mid + 1
		} else {
			right = mid
		}
		mid = (left + right) / 2
		if left >= right {
			break
		}
	}
	return mid
}

// IO will be orverwrited in test
var io = newIO()

func main() {
	io.scanner.Split(bufio.ScanWords) // switch to separating by space
	// scanner.Buffer([]byte{}, 1000000009) // switch to read large size input
	defer io.writer.Flush()

	A := io.nextInt()
	B := io.nextInt()
	K := io.nextInt()

	for i := A; i < A+K; i++ {
		if i > B {
			break
		}
		io.printLn(i)
	}

	for i := B - K; i < B; i++ {
		if i+1 < A+K {
			continue
		}
		io.printLn(i + 1)
	}
}


Measured memory_bytes: 640
R, G, B, N = map(int, input().split())

cnt = 0
for r in range(N // R + 1):
    N_r = N - R * r
    for g in range(N_r // G + 1):
        N_rg = N_r - G * g
        if N_rg % B == 0:
            cnt += 1

print(cnt)


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

typedef long long cc;
#define pb push_back
using namespace std;
const int N = 100005;
const int P = 105;
int tot, n, d[N], res[N];
cc a[N], sum;
bitset <N> dp[P];

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
        cin >> a[i];
        sum ^= a[i];
        res[i] = 1;
	}
	for (int i= 62; i >= 0;i--) {
        if (!((sum >> i) & 1)) {
            ++tot;
            for (int j = 1; j <= n; j++) {
                dp[tot][j] = (a[j] >> i) & 1;
            }
        }
	}
	for (int i = 62; i >= 0; i--) {
        if (((sum >> i) & 1)) {
            ++tot;
            for (int j = 1; j <= n; j++) {
                dp[tot][j] = (a[j] >> i) & 1;
            }
        }
	}

	for (int i = 1; i <= tot; i++) {
		dp[i][0] = 1;
		for (int j = 1; j < i; j++) {
			if (dp[i][d[j]]) {
                dp[i] ^= dp[j];
			}
		}
		d[i] = 1;
		while (d[i] <= n && !dp[i][d[i]]) {
            ++d[i];
		}
		if (d[i] <= n) {
			for (int j = 1; j < i; j++) {
				if (dp[j][d[i]]) {
                    dp[j] ^= dp[i];
				}
			}
		}
	}

	for (int i = 1; i <= n; i++) {
        res[i] = 1;
	}
	for (int i = 1; i <= tot; i++) {
		if (d[i] <= n && dp[i][0]) {
                res[d[i]] = 2;
		}
	}
    int cnt2 = 0;
    for (int i = 1; i <= n; i++) {
        cnt2 += (res[i] == 2);
    }
    if (cnt2 == n || cnt2 == 0) {
        cc mn = a[1];
        int idx = 1;
        for (int i = 1; i <= n; i++) {
            if (a[i] < mn) {
                mn = a[i];
                idx = i;
            }
        }
        res[idx] = 3^res[idx];
    }
    cc sum1 = 0, sum2 = 0;
    for (int i = 1; i <= n; i++) {
        if (res[i] == 1) {
            sum1 ^= a[i];
        } else {
            sum2 ^= a[i];
        }
    }
    cout << sum1 + sum2;
	return 0;
}


Measured memory_bytes: 2176
// Problem : C - XYZ Triplets
// Contest : AtCoder - AIsing Programming Contest 2020
// URL : https://atcoder.jp/contests/aising2020/tasks/aising2020_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;

int give(int x,int y,int z)
{
	return (x*x+y*y+z*z+x*y+y*z+z*x);
}		
signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n;
		cin>>n;
		vector<int> v;
		for(int i=1;i<=100;++i)
		{
			for(int j=1;j<=100;++j)
			{
				for(int k=1;k<=100;++k)
				{
					v.pb(give(i,j,k));
				}
			}
		}
		unordered_map<int,int> mp;
		for(int i:v)
		mp[i]++;
		for(int i=1;i<=n;++i)
		cout<<mp[i]<<"\n";		
    }
    return 0;
}


Measured memory_bytes: 12868
use proconio::{input, fastout};

#[fastout]
fn main() {
    input! {
        s: String   
    }
    let mut cnt = vec![false; 26];
    for c in s.chars() {
        cnt[(c as usize) - ('a' as usize)] = true;
    }
    for i in 0..26 {
        if !cnt[i] {
            println!("{}", (b'a'+ i as u8) as char);
            return;
        }
    }
    println!("None");
}


Measured memory_bytes: 2312
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0]*n

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)

n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    x, y, z = map(int, input().split())
    uf.unite(x-1, y-1)
print(len(set(uf.find(i) for i in range(n))))

Measured memory_bytes: 16800
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long;
int main(){ 
    ll n;
    cin>>n;
    vector<double> a(n);
    REP(i,n) cin>>a[i];
    double c=0,b=0;
    REP(i,n){
        b+=1/a[i];
    }
    c=1/b;
    cout<<setprecision(15)<<c;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int x=0,y,data[15][15]={0};
	while(1){
		for(y=0;y<8;y++){
			for(x=0;x<8;x++){
					if(scanf("%1d",&data[y][x])==EOF) return 0;
			}
		}
		for(y=0;y<8;y++){
			for(x=0;x<8;x++){
				if(data[y][x]==1 && data[y][x+1]==1		&& data[y+1][x]==1 		&& data[y+1][x+1]==1) puts("A");
				if(data[y][x]==1 && data[y+1][x]==1		&& data[y+2][x]==1 		&& data[y+3][x]==1) puts("B");
				if(data[y][x]==1 && data[y][x+1]==1		&& data[y][x+2]==1		&& data[y][x+3]==1) puts("C");
				if(data[y][x]==1 && data[y+1][x-1]==1	&& data[y+1][x]==1 		&& data[y+2][x-1]==1) puts("D");
				if(data[y][x]==1 && data[y][x+1]==1		&& data[y+1][x+1]==1 	&& data[y+1][x+2]==1) puts("E");
				if(data[y][x]==1 && data[y+1][x]==1		&& data[y+1][x+1]==1 	&& data[y+2][x+1]==1) puts("F");
				if(data[y][x]==1 && data[y][x+1]==1 	&& data[y+1][x-1]==1 	&& data[y+1][x]==1) puts("G");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 576
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Forenska(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
#define GREATER(x) x,vector<x>,greater<x>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pLL;
typedef vector<int> vec;
typedef vector<LL> vecL;
typedef vector<pii> vecP;
typedef vector<pLL> vecPL;
typedef vector<string> vecS;
typedef vector<vec> mat;
typedef complex<double> point;
const long double PI=3.14159265358979323846264338327950288419716939937510582097;
const LL INFLL=0x3f3f3f3f3f3f3f3f;
const int INF=0x3f3f3f3f;
const long double EPS=1e-10;
int read()
{
    int x=0;
    char ch=' ';
    bool flag=false;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')flag=true;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=(x<<3)+(x<<1)+ch-'0';
        ch=getchar();
    }
    return flag?-x:x;
}
int n,ans;
void dfs(string s)
{
	if(s.size()<10 && atoi(s.c_str())<=n)
	{
		dfs(s+'3');
		dfs(s+'5');
		dfs(s+'7');
		if(s.find("3")!=string::npos && s.find("5")!=string::npos && s.find("7")!=string::npos)ans++;
	}
}
int main()
{
	cin>>n;
	dfs("");
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 256
n, m = map(int, input().split())
s = input()
dp = [-1 for _i in range(n+1)]
dp[0] = 0
f = 0
from collections import deque
q = deque([0])
c = 0
for i in range(1, n+1):
    if s[i]=="0":
        c = 0
        while i-f > m:
            f = q.popleft()
        dp[i] = f
        q.append(i)
    else:
        c += 1
        if c >= m:
            break

if dp[n] >= 0:
    r = []
    p = n
    while p > 0:
        nex = dp[p]
        r.append(p-nex)
        p = nex
    print(*r[::-1])
else:
    print(-1)

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

const ll INF = 1e18;
int main()
{
    int n;
    cin >> n;
    ll ans = 1;
    bool tr = false;
    rep(i, n) {
        ll a;
        cin >> a;
        if (a == 0) {
            cout << 0 << endl;
            return 0;
        }
        //10の18乗を超えてるか
        if (tr || INF / ans < a) {
            tr = true;
        }
        ans *= a;
    }
    if (tr)cout << -1 << endl;
    else cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3196