akhauriyash/Code-Regression huggingface dataset:
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;


class CColon {
public:
    int dy[4]={-1,1,0,0};
    int dx[4]={0,0,1,-1};
    long double PI = 3.14159265358979323846264338327950L;

	void solve(std::istream& in, std::ostream& out) {
        int a,b,h,m;
        in >> a >> b >> h >> m;
        long double rad = M_PIl * 2 * ((long double)h/ 12.0 + ((long double)m/ 60.0) / 12.0 - (long double)m/ 60.0);
        long double rsq = (long double)(a*a+b*b) - (long double)(2 *a*b) *cosl(rad);
        out << setprecision(64) << sqrtl(rsq) << endl;
	}
};


int main() {
    ios::sync_with_stdio(false);
	CColon solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4156
// https://atcoder.jp/contests/abc147/tasks/abc147_e

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

const int H_MAX = 80;
const int W_MAX = 80;
const int A_IJ_MAX = 80;
const int B_IJ_MAX = 80;
const int BS_SIZE = 6400;

int H, W;
int A[H_MAX][W_MAX];
int B[H_MAX][W_MAX];

bitset<BS_SIZE> dp0[W_MAX];
bitset<BS_SIZE> dp1[W_MAX];
bitset<BS_SIZE> wk;

bitset<BS_SIZE> &move_bs(bitset<BS_SIZE> &bs, int v) {
  wk.reset();
  REP(i, BS_SIZE) if (bs[i]) {
    if (i + v < BS_SIZE) wk.set(i + v);
    if (abs(i - v) < BS_SIZE) wk.set(abs(i - v));
  }
  return wk;
}

void solve() {
  auto cur = dp0;
  auto nxt = dp1;
  REP(i, H) {
    REP(j, W) {
      nxt[j].reset();
      int v = abs(A[i][j] - B[i][j]);
      if (i == 0 && j == 0) nxt[j].set(v);
      if (i > 0) nxt[j] |= move_bs(cur[j], v);
      if (j > 0) nxt[j] |= move_bs(nxt[j - 1], v);
      // printf("[%d, %d] ", i, j);
      // REP(k, BS_SIZE) if (nxt[j][k]) printf("%d,", k);
      // puts("");
    }
    swap(cur, nxt);
  }
  REP(i, BS_SIZE) {
    if (cur[W - 1][i]) {
      printf("%d\n", i);
      return;
    }
  }
}

void input() {
  scanf("%d%d", &H, &W);
  REP(i, H) REP(j, W) scanf("%d", &A[i][j]);
  REP(i, H) REP(j, W) scanf("%d", &B[i][j]);
}

int main() {
  input();
  solve();
  return 0;
}


Measured memory_bytes: 384
import math

def main():
	X, Y = [int(n) for n in input().split(" ")]
	if (X + Y) % 3 != 0 or Y > 2 * X or X > 2 * Y:
		print(0)
		return 0
	p = 1000000007
	n_move = int((X + Y) / 3)
	i_move = int((2 * X - Y) / 3)
	j_move = int((2 * Y - X) / 3)
	f = [1, 1]
	finv = [1, 1] + [0] * n_move
	for i in range(n_move):
		f.append((f[-1] * (i + 2)) % p)
	lf = len(f)
	finv[lf - 1] = modpower(f[-1], p - 2, p)
	for i in range(lf - 1):
		finv[lf - i - 2] = ((finv[lf - i - 1]) * (lf - i - 1)) % p
	print((f[n_move] * (finv[i_move] * finv[j_move]) % p) % p)

def modpower(a, p, d):
	pp = [a]
	for i in range(int(math.log2(p)) + 1):
		pp.append((pp[-1] ** 2) % d)
	b_p = format(p, 'b')
	m = 1
	for i in range(len(b_p)):
		if b_p[-i-1] == "1":
			m = (m * pp[i]) % d
	return m

main()

Measured memory_bytes: 63600
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
//#define INF 1e18
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int k;
string s;

int main(){
  cin >> k;
  cin >> s;
  if(k >= s.size()){
    cout << s << endl;
  }else{
    rep(i,0,k){
      cout << s[i];
    }
    cout << "..." << endl;
  }

  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define For(i,m,n) for(int i=m;i<n;i++)
#define FOR(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ull unsigned long long
#define lli long long int
#define pb push_back
#define all(x) x.begin(),x.end()
ll mob=1000000007;
using namespace std;
int main()
{ 
string s;
string t;
cin>>s>>t;
for(int i=0;i<s.length();i++)
{
    if(s[i]==t[i])continue;
    else {cout<<"No";goto end;}
    
}

 cout<<"Yes";
 end:;
 



return 0;
}











Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
bool comp(const pair <string,pair<int,int>> &a ,const pair <string,pair <int,int>> &b)
{
	if(a.first == b.first)
	{
		return (a.second.first) > (b.second.first);
	}
	return (a.first) < (b.first);
}
int main() {
	// your code goes here
	int n,p;
	cin >> n;
	string s;
	vector <pair <string,pair<int ,int>>> v;
	for(int i = 0 ; i < n ; i++)
	{
		cin >> s >> p;
		v.push_back({s,{p,i+1}});
	}
	sort(v.begin(),v.end(),comp);
	for(auto i : v)cout << i.second.second << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)

N, M = map(int, input().split())
nums = [0] * N
friends = []
for _ in range(N):
    friends.append(set())

for _ in range(M):
    A, B = map(int, input().split())
    friends[A-1].add(B-1)
    friends[B-1].add(A-1)

gnum = 0
groupn = 0
nmax = 0

def find_route(i):
    global gnum
    global nums
    global friends
    global groupn
    global nmax
    if len(friends[i]) == 0:
        return
    if nums[i] == 0:
        gnum += 1
        groupn = 1
        nums[i] = gnum
    for f in friends[i]:
        if nums[f] == 0:
            nums[f] = gnum
            groupn += 1
            if groupn > nmax:
                nmax = groupn
            find_route(f)

for i in range(N):
    find_route(i)

print(max(nmax, 1))


Measured memory_bytes: 411756
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;

int main()
{
  const long double pi = acos(-1);
  
  int a, b, x;
  cin >> a >> b >> x;

  long double child, mother, ans;
  if(a*a*b/2.0 <= x)
    {
      child = 2*(a*a*b-x);
      mother = a*a*a;

      ans = atan(child / mother);
    }
  else
    {
      child = 2*x;
      
      mother = a*b*b;
      
      ans = atan(child / mother);
      
      ans = pi/2 - ans;

    }

  long double theta = 180.0*ans / pi;

  cout<<setprecision(15);
  
  cout << theta << endl;

  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(void){
	int n;
	int *a;
	int x = 0;
	scanf("%d", &n);
	a = (int *)malloc(sizeof(int) * n);
	for(int i=0; i<n; i++){
		a[i] = 0;
	}
	while((x+1)*(x+1) <= n){
		x++;
	}
	for(int i=1; i<=x; i++){
		for(int j=1; j<=x; j++){
			for(int k=1; k<=x; k++){
				int d = i*i + j*j + k*k + i*j + j*k + k*i;
				if(d-1<n){
					a[d-1]++; 
				}
			}
		}
	}
	for(int p=0; p<n; p++){
		printf("%d\n", a[p]);
	}
	return 0;
}

Measured memory_bytes: 1764
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int x = in.ni(), n = in.ni();
        ArrayList<Integer> small = new ArrayList<>();
        ArrayList<Integer> large = new ArrayList<>();
        boolean flag = true;
        for (int i = 0; i < n; i++) {
            int a = in.ni();
            if(a < x) small.add(-a);
            else if(a>x) large.add(a);
            else flag = false;
        }
        if(flag){
            out.println(x);
        }else{
            for (int i = 1; i <= 150; i++) {
                boolean f1 = true, f2 = true;
                for (int j = 0; j < small.size(); j++) {
                    if(-small.get(j)==x-i) {
                        f1 = false;
                    }
                }
                for (int j = 0; j < large.size(); j++) {
                    if(large.get(j)==x+i){
                        f2= false;
                    }
                }
                if(f1){
                    out.println(x-i);
                    break;
                }else if(f2){
                    out.println(x+i);
                    break;
                }
            }
        }
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 32980
s = gets.chomp.chars
t = gets.chomp.chars

s_hash = Hash.new{}
s.each_with_index do |l, idx|
  begin
    s_hash[l].push idx
  rescue
    s_hash[l] = [idx]
  end
end

t_hash = Hash.new{}
t.each_with_index do |l, idx|
  begin
    t_hash[l].push idx
  rescue
    t_hash[l] = [idx]
  end
end

if s_hash.values == t_hash.values
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 39844
#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)

using namespace std;
using ll = int64_t;

int main() {
  int n;
  cin>>n;
  vector<string> vs(n);
  REP(i,n) cin>>vs[i];
  int a = 0, b = 0, ab = 0, ba = 0;
  REP(i,n) {
    if (vs[i].front() == 'B') {
      if (vs[i].back() == 'A') ++ba;
      else ++b;
    } else if (vs[i].back() == 'A') ++a;
    int m=vs[i].size();
    REP(j,m-1) {
      if (vs[i].substr(j,2) == "AB") ++ab;
    }
  }
  if (min(a, b) >= 1) {
    cout << ab + ba + min(a, b) << endl;
  } else if (max(a, b) > 0) {
    cout << ab + ba << endl;
  } else {
    cout << ab + max(0, ba - 1) << endl;
  }
  return 0;
}


Measured memory_bytes: 768
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n = int(input())
l = ils(n)
s = sum(l)
if s % 10 != 0:
    print(s)
else:
    for i in sorted(l):
        if i % 10 != 0:
            print(s - i)
            exit()
    print(0)

Measured memory_bytes: 3064
def isHashi(a,b):
    visited = {}
    visited[a] = 1
    go = G[a]
    path = []
    for i in go:
        if i != b:
            path.append(i)
    flag = 0
    while path != []:
        to = path.pop()
        visited[to] = 1
        for i in G[to]:
            if not i in visited:
                visited[i] = 1
                if i == b:
                    flag = 1
                path.append(i)
    if flag == 0:
        return 1
    else:
        return 0
        
    
N,M = map(int,input().split())

G = [[0]*(N+1) for i in range(N+1)]
E = []

for i in range(M):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
    E.append([a,b])

ans = 0
for i in range(M):
    a,b = E[i]
    if isHashi(a,b) == 1:
        ans += 1
print(ans)

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

using namespace std;

#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    FOREACH(x, v) { cout << x << " "; }                                        \
    cout << "\n";

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, V, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll N, M;
VL a, b;

struct UnionFind {
    vector<int> par;
    vector<int> sizes;

    UnionFind(int n) : par(n), sizes(n, 1) { REP(i, n) par[i] = i; }

    int find(int x) {
        if(x == par[x]) return x;
        return par[x] = find(par[x]);
    }

    void unite(int x, int y) {
        x = find(x);
        y = find(y);

        if(x == y) return;

        if(sizes[x] < sizes[y]) swap(x, y);

        par[y] = x;
        sizes[x] += sizes[y];
        sizes[y] = 0;
    }

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

    int size(int x) { return sizes[find(x)]; }
};

int main() {
    cin >> N >> M;
    REP(i, M) {
        a.emplace_back(IN());
        b.emplace_back(IN());
    }
    ll ans = 0;
    REP(i, M) {
        auto uf = UnionFind(N + 1);
        REP(j, M) {
            if(j != i) uf.unite(a[j], b[j]);
        }
        if(uf.size(1) != N) ans++;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int, input().split()))

odd=0
ev=0
evev=0
for i in range(N):
  if A[i]%2==0:
    if A[i]%4==0:
      evev+=1
    else:
      ev+=1
  else:
    odd+=1
if evev+1>odd or (evev+1==odd and ev==0):
  print('Yes')
else:
  print('No')

Measured memory_bytes: 85208
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <x86intrin.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define V vector
template <typename T> bool chmin(T &a, const T &b) {if(a > b){a = b; return true;} return false;}
template <typename T> bool chmax(T &a, const T &b) {if(a < b){a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill (A (&array)[N], const T & val) {fill ((T*)array, (T*)(array+N), val);}
V<int> dx = {-1, 1,  0, 0, -1, -1,  1, 1};
V<int> dy = { 0, 0, -1, 1, -1,  1, -1, 1};

const ll INF = 1e18;

bool srt (P a, P b) {
    return a.first + a.second < b.first + b.second;
}

int main () {
    int n; cin >> n;
    V<P> v(n);
    rep(i, n) cin >> v[i].first >> v[i].second;
    sort(all(v), srt);
    V<V<ll>> dp(n+1, V<ll> (n+1, INF));//dp[i][j]:iまでみてj人選ぶ時のpの総和のmin
    dp[0][0] = 0;
    for (int i = 0; i <= n; i++) {
        dp[i][0] = 0;
        for (int j = 1; j <= i; j++) {
            chmin(dp[i][j], dp[i-1][j]);
            if (dp[i-1][j-1] <= v[i-1].first) chmin(dp[i][j], dp[i-1][j-1] + v[i-1].second);
        }
    }
    int ans = 0;
    for (int i = 0; i <= n; i++) {
        if (dp[n][i] != INF) ans = i;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 198840
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7,N=1e5+5;
int mul(int a,int b){return (long long)a*b;}
typedef long long ll;
int n,x,a[N];
int main()
{
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    int now=0,ans=1;
    for(int i=1;i<=n;i++)
    {
        if(now+a[i]>x) break;
        now+=a[i];
        ans++;
    }
    cout<<ans<<endl;
}


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

int main(){
    ll X, N;
    cin >> X >> N;
    vector<ll> p(N);
    for (int i = 0; i < N; ++i) cin >> p[i];
    ll res = 100000;
    ll out = 0;
    for (int i = 0; i < 105; ++i) {
      if (p.end() != find(p.begin(), p.end(), i)) continue;
      else{
        if(abs(X-i)<res){
            res = abs(X-i);
            out = i;
        }
      }
    }
    cout << out << endl;
    return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    priority_queue<int> que;

    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        que.push(a); 
    }


    for(int i=0; i<m; i++){
        int a;
        a = que.top();
        que.pop();
        a = a / 2;
        que.push(a);
    }

    long long sum = 0;
    for(int i=0; i<n; i++){
        int a;
        a = que.top();
        que.pop();
        sum += a;       
    }

    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 892
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(int i=a;i<b;i++)
#define mod 998244353
#define mp make_pair
#define ff first
#define ss second
#define rf(i,a,b) for(int i=a;i>=b;i--)
#define sc(a) scanf("%lld",&a)
#define pf printf
#define sz(a) (ll)(a.size())
#define psf push_front
#define ppf pop_front
#define ppb pop_back
#define pb push_back
#define pq priority_queue
#define all(s) s.begin(),s.end()

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s,t;
	cin>>s>>t;
	int x=sz(s),y=sz(t);
	int dp[x+1][y+1];
	f(i,0,x+1)
		dp[i][0]=0;
	f(i,0,y+1)
		dp[0][i]=0;
	f(i,1,x+1)
	{
		f(j,1,y+1)
		{
			if(s[i-1]==t[j-1])
				dp[i][j]=dp[i-1][j-1]+1;
			else
				dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
		}
	}
	string ans="";
	int i=x,j=y;
	while(i>0 && j>0)
	{
		if(s[i-1]==t[j-1])
		{
			ans+=s[i-1];
			i--,j--;
		}
		else if(dp[i-1][j]>dp[i][j-1])
			i--;
		else
			j--;
	}
	reverse(all(ans));
	cout<<ans<<"\n";
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const unsigned long long LINF = 1e19;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N, K;
    cin >> N >> K;

    vector<ll> x(N);
    vector<ll> y(N);
    vector<P> p(N);
    REP(i, N){
        cin >> x[i] >> y[i];
        p[i].first = x[i];
        p[i].second = y[i];
    }

    sort(x.begin(), x.end());
    sort(y.begin(), y.end());

    unsigned long long ans = LINF;
    for(ll xmin=0; xmin<N-1; xmin++){
        for(ll xmax=xmin+1; xmax<N; xmax++){
            for(ll ymin=0; ymin<N-1; ymin++){
                for(ll ymax=ymin+1; ymax<N; ymax++){
                    ll count = 0;
                    REP(i, N){
                        if(x[xmin] <= p[i].first && p[i].first <= x[xmax]){
                            if(y[ymin] <= p[i].second && p[i].second <= y[ymax]){
                                count++;
                            }
                        }
                    }
                    if(count >= K){
                        unsigned long long x_dif = x[xmax]-x[xmin];
                        unsigned long long y_dif = y[ymax]-y[ymin];
                        ans = min(ans, x_dif*y_dif);
                        // cout << (x[xmax]-x[xmin]) << " " << (y[ymax]-y[ymin]) << endl;
                    }
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3576
n = gets.to_i

$dp = Array.new(50, -1)

def fib(n)
  return $dp[n] = 1 if n == 0 || n == 1
  return $dp[n] if $dp[n] != -1
  $dp[n] = fib(n - 1) + fib(n - 2)
end
puts fib(n)


Measured memory_bytes: 6868
import copy
import math

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():  # a, b = get_int_multi()
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    n = get_int()

    ans = 0

    for i in range(1, n+1, 2):
        count= 0
        for ii in range(1, n+1):
            if i % ii == 0:
                count += 1

        if count == 8:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()




Measured memory_bytes: 9192
#include <stdio.h>

main(void)
{
	int x,i;
	
	i=0;
	
	while(1){
		i++;
		scanf("%d",&x);
		if(x==0){
			break;
		}
		
		printf("Case %d: %d\n",i,x);
	}
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
int a[100005];
typedef long long LL;
typedef double D;
const D PI = acos(-1);
struct FFT{
    typedef complex<D> base;
    void fft(vector<base> &v, bool inv){
        vector<base> w(v.size());
        for(int i=2; i<=v.size(); i<<=1){
            int bsz = v.size() / i;
            base ang(cos(2 * PI / i), sin(2 * PI / i));
            if(inv) ang = base(1, 0) / ang;
            for(int j=0; j<bsz; j++){
                for(int k=0; k<i; k++){
                    w[k] = v[bsz * k + j];
                }
                base pw(1, 0);
                for(int k=0; k<i/2; k++){
                    base a = w[2*k], b = w[2*k+1] * pw;
                    v[bsz * k + j] = a + b;
                    v[bsz * k + j + v.size()/2] = a - b;
                    pw *= ang;
                }
            }
        }
    }
    vector<LL> power(vector<LL> &v){
        vector<base> fv(v.begin(), v.end());
        int n = 1;
        while(n < v.size()) n <<= 1;
        n <<= 1;
        fv.resize(n);
        fft(fv, 0);
        for(int i=0; i<n;i++) fv[i] *= fv[i];
        fft(fv, 1);
        vector<LL> ret(n);

        for(int i=0; i<n; i++) ret[i] = round(fv[i].real()/n);
        return ret;
    }
}FFT;
int main(){
    vector<LL> x;
    x.resize(100001);
    int n;
    LL m;
    scanf("%d%lld", &n, &m);
    for(int i=1;i<=n;i++) scanf("%d", &a[i]), x[a[i]]++;
    vector<LL> res = FFT.power(x);
    LL ans = 0;
    for(int i=res.size()-1;i>=1;i--){
        if(res[i] == 0) continue;
        if(m >= res[i]) ans += res[i]*i, m -= res[i];
        else{
            ans += m*i;
            m = 0;
            break;
        }
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 9572
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
const int mod = 1e9+7;
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; }

const int inf = 1e9;
int dp[1000005][2];

int main(){
    string s; cin >> s;
    reverse(ALL(s));
    s += '0';
    int n = s.size();
    rep(i,n+1)rep(j,2) dp[i][j] = inf;
    dp[0][0] = 0;
    rep(i,n)rep(j,2){
        int d = s[i] - '0';
        if(j == 1) d++;
        rep(na, 10){
            int ni = i+1, nj = 0;
            int nb = na - d;
            if(nb < 0) {
                nj = 1;
                nb += 10;
            }
            chmin(dp[ni][nj], dp[i][j] + na + nb);
        }
    }
    cout << dp[n][0] << endl;
}


Measured memory_bytes: 9220
package main

import (
	"bufio"
	"container/list"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a := make([]int, n)
	// b := make([]int, 0)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
	}

	l := list.New()

	for i := 0; i < n; i++ {
		if i%2 != 0 {
			l.PushBack(a[i])
			// b[len(b)-1] = a[i]
		} else {
			// tmp := b[0]
			l.PushFront(a[i])
			// b = b[0:]
			// b[0] = a[i]
			// b = append(b[0:1], b[0:]...)
			// b[0] = a[i]

		}

	}

	if n%2 == 0 {
		for e := l.Back(); e != nil; e = e.Prev() {
			fmt.Printf("%d ", e.Value)
		}
	} else {
		for e := l.Front(); e != nil; e = e.Next() {
			fmt.Printf("%d ", e.Value)
		}
	}

	// if n%2 == 0 {

	// 	for i := len(b) - 1; i >= 0; i-- {
	// 		fmt.Printf("%d ", b[i])
	// 	}
	// } else {
	// 	for i := 0; i < len(b); i++ {
	// 		fmt.Printf("%d ", b[i])

	// 	}
	// }
}


Measured memory_bytes: 15744
n = int(input())
A = list(map(int, input().split()))
L = [0] * n
for i in range(n-1):
    L[i+1] = 2 * A[i] - L[i]
ans = [0] * n
ans[0] = (A[-1] * 2 - L[-1]) // 2
for i in range(n-1):
    ans[i+1] = 2 * A[i] - ans[i]
print(*ans)


Measured memory_bytes: 17588
# 2020/06/21
# AtCoder Beginner Contest 171 - E

# Input
n = int(input())
a = list(map(int,input().split()))
nans = [''] * n

# Calc
axor = 0
for i in range(n):
    axor = axor ^ a[i]

for i in range(n):
    nans[i] = str(axor ^ a[i])

# Output
print(' '.join(nans))


Measured memory_bytes: 35552
import sys
import math
import collections
from collections import deque
#n = int(input())
#n, m = map(int, sys.stdin.readline().split())
s = input()
#x = list(map(int, sys.stdin.readline().split()))
n = len(s)
for i in range(int((n-1)/2)):
    if s[i] != s[int((n-1)/2)-1-i]:
        print("No")
        sys.exit()

for j in range(int((n-1)/2)):
    if s[int((n+3)/2)-1+j] != s[n-1-j]:
        print("No")
        sys.exit()

for k in range(n):
    if s[k] != s[n-1-k]:
        print("No")
        sys.exit()


print("Yes")


Measured memory_bytes: 3444
use std::io;

// read a line(without line feed)
fn read_line() -> String {
    let mut in_str = String::new();
    io::stdin().read_line(&mut in_str).unwrap();
    return in_str.trim().to_string();
}

fn read_words_in_line() -> Vec<String> {
    let s = read_line();
    return s.split_whitespace().map(|x| x.to_string()).collect::<Vec<String>>()
}

fn read_t_in_line<T : std::str::FromStr>() -> Vec<T> {
    let mut v : Vec<T> = Vec::new();
    for e in read_words_in_line().iter().map(|x| x.parse::<T>()) {
        if let Ok(r) = e {
            v.push(r);
        }
        else{
            return Vec::new();
        }
    }
    return v;
}

// fn div_ceil<T : std::ops::Add<Output = T> + std::ops::Sub<Output = T> + std::ops::Add<Output = T>>(x : T, y : T) -> T {
//     return (x + y - 1) / y;
// }

fn main(){
    let s = read_line();
    for i in 0..(s.len() / 2) {
        let s_bytes = s.as_bytes();
        let cc = s_bytes[s.len() / 2];
        let j1 = s.len() / 2 - 1 - i;
        let j2 = s.len() - 1 - j1;
        let c1 = s_bytes[j1];
        let c2 = s_bytes[j2];
        if !(c1 == c2 && c1 == cc) {
            println!("{}", s.len() - j1 - 1);
            return;
        }
    }
    println!("{}", s.len());
}


Measured memory_bytes: 4352
#include <stdio.h>

int main(void)
{
	int a, b;
	int i;

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

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

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;

int main(){
    int n;cin>>n;vector<double> v(n);
    for(int i=0;i<n;i++) cin>>v[i];
    sort(v.begin(),v.end());
    double s=v[0];
    for(int i=1;i<n;i++){
        s=(s+v[i])/2;
    }
    cout<<s<<endl;
}

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

#define REP(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define PI 3.141592653589

using namespace std;

void InpAr(int *array, int n){
    REP(i,n) cin >> array[i];
}

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

    int R, S, P;
    cin >> R >> S >> P;

    string T;
    cin >> T;

    int counterR = 0, counterS = 0, counterP = 0;
    for(int i = 0; i < K; i++){
        if(T[i] == 'r') counterP ++;
        else if(T[i] == 's') counterR ++;
        else counterS ++;
    }
    
    for(int i = K; i < N; i++){
        if(T[i - K] == T[i]) T[i] = 'x'; //別の文字にしてしまう
        else{
            if(T[i] == 'r') counterP ++;
            else if(T[i] == 's') counterR ++;
            else if(T[i] == 'p') counterS ++;
        }
    }

    cout << counterP * P + counterR * R + counterS * S;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int a,b; cin >> a >> b;
    int ans = -1000;
    ans = max(ans, a+b);
    ans = max(ans, a-b);
    ans = max(ans, a*b);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::cmp::{min,max};

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let cin = stdin();
    let cin = cin.lock();
    let s: String = cin 
        .bytes() // Bytes
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace()) // c が whitespace である限り skip
        .take_while(|c| !c.is_whitespace()) // c が whitespace でない限り要素を返す
        .collect();
    s.parse().ok().expect("failed parsing")
}

fn main() {
    input! {
        n:usize, 
        k:usize,
        l: [usize; n]
    }
    let mut l = l;
    l.sort();
    let mut ans = 0;
    for i in 0..k {
        ans += l[n-1-i];
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 23:10:10 2018

@author: maezawa
"""

s = input()
n = len(s)

st = []
st2 = []
total_sum = 0

for i, c in enumerate(s):
    if c == '\\': # Back Slashをそのまま使うため二重にした。
        st.insert(0,i)
    elif c == '/' and len(st)>0: 
        j = st.pop(0)
        total_sum += i - j
        a = i - j
        while len(st2) > 0 and st2[0][0] > j:
            a += st2.pop(0)[1]
        st2.insert(0, [j, a])
        
print(total_sum)
print(len(st2), end='')
for i in reversed(range(len(st2))):
    print(" {}".format(st2[i][1]), end='')
print()





Measured memory_bytes: 6528
#include<iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <fstream>

using namespace std;
using ll=long long;

#define REP(i, n)  for(int i = 0; i < (int)n; ++i)
#define REP1(i, n)  for(int i = 1; i <= (int)n; ++i)
#define REPT(i, t, n)  for(int i = t; i <= (int)n; ++i)
#define REPll1(i, n)  for(ll i = 1; i*i < (int)n; ++i)
const char alphabet[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                           's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
const ll MOD = 1e9 + 7;
typedef pair<int, int> Pi;

int mx[4] = {0, -1, 0, 1};
int my[4] = {-1, 0, 1, 0};
int X = 100000;

int main() {
    int N, M, x, y;
    cin >> N >> M;
    vector<pair<int, int>> A(M);
    int tx = 0;
    int cnt = 0;
    REP(i, M) {
        cin >> x >> y;
        A[i] = make_pair(y, x);
    }
    sort(A.begin(), A.end());
    REP(i, M ) {
        y = A[i].first;
        x = A[i].second;
        if (x > tx) {
            tx = y - 1;
            cnt++;

        }
    }

    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;

int main() {
	ll a, b;
	cin >> a >> b;
	if (abs(a - b) % 2) cout << "IMPOSSIBLE" << endl;
	else cout << abs(a - b) / 2 + min(a, b) << endl;

	return 0;
}

Measured memory_bytes: 256
from collections import deque

N = int(input())
L = deque()

for i in range(N):
    C= input().split()

    if C[0] == "insert":
        L.appendleft(C[1])

    elif C[0] == "delete":
        try:
            L.remove(C[1])
        except ValueError:
                pass
    elif C[0] == "deleteFirst":
        L.popleft()
    elif C[0] == "deleteLast":
        L.pop()
    
print(" ".join(L))



Measured memory_bytes: 69736
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    for (int i = 0; i < n; i++)
    {
        cin >> l[i];
    }
    int sum =0;
    for (int i = 0; i < n; i++)
    {
        for (int j = i+1; j < n; j++)
        {
            for (int k = j+1; k < n; k++)
            {
                int a = l[i];
                int b = l[j];
                int c = l[k];
                if(a!= b && b != c && c != a && a+b>c && b+c>a && c+a>b) sum ++;
            }
            
        }
        
    }
    cout << sum << endl;
    
    
}

Measured memory_bytes: 3596
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream> 
#include <algorithm>
using namespace std;
#define LL long long

LL sum=0;

int main()
{
	LL x;
	int n;
	cin>>n;
	for (int i=1;i<=n;i++)
		cin>>x,sum+=x;
	sum-=n;
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <ctime>
#include <algorithm>
#define N 101
#define PLL pair<ll, ll>
#define MP make_pair
typedef long long ll;
template<typename T> inline void read(T &x) {
  x = 0; char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) { x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); }
}
using namespace std;
const int P = 1e9 + 7;
int ftot;
ll f[N];
PLL pr[N][N];
inline void work() {
  ll n, m, res = 0; read(n), read(m);
  if (n > m)  swap(n, m);
  if (n == 1) {
    printf("1 %lld\n", m % P);
    return ;
  }
 
  int p;
  p = upper_bound(f + 1, f + 1 + ftot, n) - f - 1;
  if (f[p + 1] > m) --p;
  printf("%d ", p);
  if (p == 1) res = n % P;
  for (int i = 1; i <= p; ++i)
    if (pr[p][i].first <= n && pr[p][i].second <= m)
      res = (res + (m - pr[p][i].second) / pr[p][i].first + 1) % P;
  swap(n, m);
  for (int i = 1; i <= p; ++i)
    if (pr[p][i].first <= n && pr[p][i].second <= m)
      res = (res + (m - pr[p][i].second) / pr[p][i].first + 1) % P;
  printf("%lld\n", (res % P + P) % P);
}
int main() {
  f[0] = f[1] = 1;
  for (int i = 2; f[i - 1] <= 3e18; ++i)  f[i] = f[i - 1] + f[i - 2], ftot = i;
  pr[1][1] = MP(1, 2);
  for (int i = 2; i <= 91; ++i) {
    for (int j = 1; j < i; ++j) pr[i][j] = MP(pr[i - 1][j].second, pr[i - 1][j].first + pr[i - 1][j].second);
    ll a = pr[i - 1][1].first, b = pr[i - 1][1].second;
    pr[i][i] = MP(a + b, a + a + b);
    for (int j = 1; j <= i; ++j) {
    	if (pr[i][j].first > 2e18)	pr[i][j].first = 2e18;
    	if (pr[i][j].second > 2e18)	pr[i][j].second = 2e18;
    }
  }
  int _; read(_);
  while (_--)
    work();
  return 0;
}

Measured memory_bytes: 4460
#include<iostream>
#include<vector>
#include<stack>
#include<string.h>
#include<string>
#include<math.h>
#define LL long long int
using namespace std;

const int maxn = 320000;
const LL mod = 1000000007;
int n,m;
LL save[maxn];

void pre()
{
	save[0] = 1;
	for(int i = 1;i<maxn;i++)
	{
		save[i] = save[i-1] * i;
		save[i] %= mod;
	}
}



int main()
{
	pre();
	while(cin >> n >> m)
	{
		if(!(n == m || abs(n-m) == 1))
		{
			cout<<0<<endl;
			continue;
		}
		LL ans = 1;
		if(n == m)
		{
			ans = save[n]*save[m];
			ans %= mod;
			ans *= 2;
			ans %= mod;
		}
		else 
		{
			if(n < m) swap(n,m);
			ans = save[n]*save[m];
			ans %= mod;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;

int main(){
  ll a,b; cin>>a>>b;
  cout<<a*b/2<<endl;
  
}

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

void fnInput(vector<int>& rvnSeq)
{
  int nSeqSiz;
  cin >> nSeqSiz;
  rvnSeq.resize(nSeqSiz);

  for (int& rnSeq : rvnSeq)
    cin >> rnSeq;
}
  
int fnLowerCnt(const vector<int>& cnrvnSeq)
{
  int nMaxLowerCnt = 0;
  int nBgn = 0;
  while (nBgn < cnrvnSeq.size())
  {
    int nLowerCnt = 0;
    int nFoward;

    for (nFoward = nBgn; nFoward < cnrvnSeq.size() - 1; nFoward++)
      if (cnrvnSeq[nFoward] >= cnrvnSeq[nFoward + 1])
        nLowerCnt++;
      else
        break;

    nMaxLowerCnt = max(nMaxLowerCnt, nLowerCnt);
    nBgn = nFoward + 1;
  }
  return nMaxLowerCnt;
}
  
int main()
{
  vector<int> vnSeq;

  fnInput(vnSeq);
  cout << fnLowerCnt(vnSeq) << endl;

  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n); i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)	
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define LOOP while(true)
#define INF 1e9
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	ll A, B, K;
	cin >> A >> B >> K;
	int range = B - A + 1;
	if(range >= K * 2){
		for(ll i = A; i <= A + K - 1; i++)cout << i << endl;
		for(ll i = B - K + 1; i <= B; i++)cout << i << endl;
	} else {
		for(ll i = A; i <= B; i++)cout << i << endl;
	}
}

Measured memory_bytes: 256
from collections import defaultdict
N, M = map(int, input().split())  # ちょうどN桁, M個のクエリ
correspondence = defaultdict(set)
for _ in range(M):
    s, c = map(int, input().split())
    correspondence[s].add(c)
# print(correspondence)
if M == 0:
    if N == 1:
        print(0)
        exit()
    print("1"+"0"*(N-1))
    exit()
for k, v in correspondence.items():  # 要素が複数あったら-1を出力
    if len(v) > 1:
        print(-1)
        exit()
ans = ""
for i in range(1, N+1):
    if i in correspondence.keys():  # 指定があるならばそれにする
        ans += str(list(correspondence[i])[0])
    else:
        ans += "0"  # ないならば0にする
if ans[0] == "0":
    ans = list(ans)
    ans[0] = "1"
    ans = "".join(ans)

if N == 1 and 1 in correspondence.keys():
    print(list(correspondence[1])[0])
    exit()

if 1 in correspondence.keys() and list(correspondence[1])[0] == 0:  # 1桁目が0に指定されているなら終わり
    print(-1)
else:
    print(ans)


Measured memory_bytes: 3316
//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
#define int long long
   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; }
    const int MAX =1002;
const int MOD =1000000007;

signed main(){
  string s;
  cin>>s;
  s[3]='8';
  cout<<s<<endl;

}

Measured memory_bytes: 3608
n, w = map(int, input().split())

value, weight = [], []
for i in range(n):
    a, b = map(int,input().split())
    value.append(a)
    weight.append(b)

dp = [[0]*(w+1) for _ in range(n+1)]

for i in range(n):
    for j in range(w+1):
        if j - weight[i] >= 0:
            dp[i+1][j] = max(dp[i+1][j], dp[i+1][j-weight[i]] + value[i])

        dp[i+1][j] = max(dp[i+1][j], dp[i][j])

print(dp[n][w])



Measured memory_bytes: 41888
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef unsigned long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
const int i_INF = 2147483647;

int r,d,x;
int i=0;
void solve(int xx){
  if(i<10){
  xx=r*xx-d;
  cout<<xx<<endl;
  i++;
  solve(xx);
  }
}

int main() {
  cin>>r>>d>>x;
  solve(x);
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
bool in[7368792];
int main(){
	int n,m;
	while(cin>>n>>m,n+m){
		fill(in,in+7368792,false);
		int t=n;
		while(m--){
			while(in[t])t++;
			for(int i=t;i<7368792;i+=t)in[i]=true;
		}
		while(in[t])t++;
		cout<<t<<endl;
	}
}

Measured memory_bytes: 10276
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1e9;
using namespace std;
typedef long long ll;
int main() {
  ll N;
  cin >> N;
  if (N / 100 == N % 10) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int s=n%10;
	if (s==2 || s==4 || s==5 || s==7 || s==9)
	cout <<"hon";
	else if(s!=3)
	cout <<"pon";
	else
	cout <<"bon";
} 

Measured memory_bytes: 3600
package main

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

////////////////////////////////////////
///        templates                 ///
////////////////////////////////////////

var sc = bufio.NewScanner(os.Stdin)

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

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readBigLine() string {
        buf := make([]byte, 0, 1000000)
        for {
                l, p, e := rdr.ReadLine()
                if e != nil {
                        panic(e)
                }
                buf = append(buf, l...)
                if !p {
                        break
                }
        }
        return string(buf)
}

func strSprit(str string) []string {
        cols := strings.Split(str, " ")
        return cols
}

func parseInt(str string) int {
        n, _ := strconv.Atoi(str)
        return n
}

func intSprit(str string) []int {
        strs := strSprit(str)
        cols := make([]int, len(strs))
        for i, v := range strs {
                cols[i] = parseInt(v)
        }
        return cols
}

type SortSlice []int

func (s SortSlice) Len() int {
        return len(s)
}

func (s SortSlice) Swap(i, j int) {
        s[i], s[j] = s[j], s[i]
}

func (s SortSlice) Less(i, j int) bool {
        return s[i] < s[j]
}

func reverseString(str string) string {
        buf := []rune(str)
        for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 {
                buf[i], buf[j] = buf[j], buf[i]
        }
        return string(buf)
}

////////////////////////////////////////
///        end templates             ///
////////////////////////////////////////

func main() {
        line := readBigLine()
        spl := strSprit(line)
        N := parseInt(spl[0])
        K := parseInt(spl[1])

        div := float64((N - 1)) / float64((K - 1))

        fmt.Println(math.Ceil(div))

}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
int main(){
  int X;
  int N;
  cin>>N;
  X=N/1.08;
  int Y=X+1;
  int Z=X*1.08;
  int A=Y*1.08;
  if(Z==N){
    cout<<X<<endl;
  }else if(A==N){
    cout<<Y<<endl;
  }else{
    cout<<":("<<endl;
  }
  return 0;
}

Measured memory_bytes: 256