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

int main() {
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i+=2) {
        int cnt = 0;
        for (int j = 1; j <= i; j++) {
            if (i % j == 0) cnt++;
        }
        if (cnt == 8) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		char[] c = s.toCharArray();

		Arrays.sort(c);

		boolean can = false;
		for (int i = 0; i < s.length() - 1; i++) {
			if (c[i] == c[i + 1]) can = true;
		}

		if (can) {
			System.out.println("no");
		} else {
			System.out.println("yes");
		}

		sc.close();
	}

}


Measured memory_bytes: 21844
//IOI 2021

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second

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

const int MAXN = 2 * 1000 + 17;

string s;
map<char, bool> mp;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> s;
	for (auto i : s)
		mp[i] = true;
	if ((mp['S'] + mp['N'] == 1) || (mp['W'] + mp['E'] == 1))
		cout << "No";
	else
		cout << "Yes";
	return 0;
}


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

using namespace std;

int main(){
	int n;
	cin>>n;
	int l;
	cin>>l;
	string x;
	vector <string> V(n);
	for(int i=0;i<n;i++){
		cin>>V.at(i);
	}
	sort(V.begin(),V.end());
	int mal=V.size();
	for(int i=0; i<n ; i++){
		cout<<V.at(i);
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256
K,S=map(int,input().split())

z = list(range(0,K+1))
ans = []

for i in z:
  s_z = S - i
  if s_z < 0:
    pass
  elif K < s_z:
    if (K + 1) > (s_z - K):
      ans.append(K + 1 - (s_z - K))
  else:
    ans.append(s_z + 1)

print(sum(ans))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e16

template <typename T>
struct Graph {
    int V, E;
    struct Edge {
        int from, to;
        T cost;
    };
    vector<vector<Edge>> edge;
    vector<vector<T>> dist;
    vector<Edge> es;

    Graph(int V, int E) : V(V), E(E) {
        edge.assign(V, vector<Edge>(0));
        dist.assign(V, vector<T>(0));
    }

    void input(bool is_direct = false, bool index0 = false) {
        int a, b;
        T P;
        T c;
        cin >> P;
        for (int i = 0; i < E; i++) {
            cin >> a >> b >> c;
            c = -(c - P);
            if (!index0) a--, b--;
            edge[a].push_back((Edge){a, b, c}), es.push_back((Edge){a, b, c});
            if (!is_direct) edge[b].push_back((Edge){b, a, c}), es.push_back((Edge){b, a, c});
        }
    }

    void add_edge(int from, int to, T cost) {
        edge[from].push_back({from, to, cost});
        es.push_back({from, to, cost});
        E++;
    }

    // 頂点rからの最小距離(true : no cycle, false : negative cycle(reachable from r))
    bool bellmanFord(int r = 0) {
        dist[r].assign(V, INF);

        dist[r][r] = 0;
        for (int i = 0; i < V - 1; i++) {
            for (const auto &e : es) {
                if (dist[r][e.from] != INF && dist[r][e.to] > dist[r][e.from] + e.cost) {
                    dist[r][e.to] = dist[r][e.from] + e.cost;
                }
            }
        }
        for (int i = 0; i < V; i++) {
            for (const auto &e : es) {
                if (dist[r][e.from] != INF && dist[r][e.to] > dist[r][e.from] + e.cost) {
                    dist[r][e.to] = -INF;
                }
            }
        }
        return 1;
    }
};

int main() {
    int V, E;
    cin >> V >> E;
    Graph<ll> g(V, E);
    g.input(true);
    g.bellmanFord(0);
    if (g.dist[0][V - 1] <= -INF)
        cout << -1 << endl;
    else
        cout << max(0ll, -g.dist[0][V - 1]) << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define MOD 1000000007
#define ar array
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);

int n;
vector<vector<int>> adj;
vector<int> parent;
vector<int> visited;
vector<int> color_white;
vector<int> color_black;

void dfs(int u, int p) {
	parent[u] = p;
	visited[u] = true;
	for (int v : adj[u]) {
		if (v != p && !visited[v]) {
			dfs(v, u);
		}
	}
	return;
}

int ways_to_color(int u, char color) {
	if (color == 'W') {
		if (color_white[u] != -1) return color_white[u];
		int children = 0;
		for (int v : adj[u]) {
			if (v != parent[u]) {
				children++;
			}
		}
		if (children == 0) {
			color_white[u] = 1;
			return 1;
		}
		int res = 1;
		for (int v : adj[u]) {
			if (v != parent[u]) {
				// res += ways_to_color(v, 'W'); res %= MOD;
				// res += ways_to_color(v, 'B'); res %= MOD;
				res *= (ways_to_color(v, 'W') + ways_to_color(v, 'B')) % MOD;
				res %= MOD;
			}
		}
		color_white[u] = res;
		return res;
	}
	if (color == 'B') {
		if (color_black[u] != -1) return color_black[u];
		int children = 0;
		for (int v : adj[u]) {
			if (v != parent[u]) {
				children++;
			}
		}
		if (children == 0) {
			color_black[u] = 1;
			return 1;
		}
		int res = 1;
		for (int v : adj[u]) {
			if (v != parent[u]) {
				res *= ways_to_color(v, 'W'); res %= MOD;
				res %= MOD;
			}
		}
		color_black[u] = res;
		return res;
	}
}

int32_t main() {
	fast_io;

	// int t; cin >> t;
	// while (t--) {
		
	// }
	cin >> n;
	adj.resize(n); parent.assign(n, -1); visited.assign(n, false);
	color_white.assign(n, -1); color_black.assign(n, -1);
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(0, -1);
	int ans = ways_to_color(0, 'W') + ways_to_color(0, 'B');
	cout << ans % MOD << endl;

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

	return 0;
}

Measured memory_bytes: 18632
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws IOException{
		int a = 0;
		int n = 10000; //?????§????????????????????°
		int j = 0;
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(j != n){
			a = Integer.parseInt(br.readLine());
			if(a == 0){
				break;
			}
			parse.add(a);
			++j;
		}

		for(int i = 1; i <= parse.size(); ++i){
		System.out.println("Case " + (i) + ": " + parse.get(i-1));
		}
	}
}

Measured memory_bytes: 32428
import math
X = int(input())

for a in range(1, 1500):
    a4 = a**4
    a3 = a**3
    a2 = a**2
    for b in range(-1500, 1500):
        an = (a-b)*(a4 + (a3)*b + (a2)*(b**2) + a*(b**3) + b**4)
        if an < 0:
            break

        if an == X:
            print(a, b)
            exit()


Measured memory_bytes: 9184
#include<stdio.h>
#include<math.h>

int main(){
	int a[21][7], L;
	int p, s, t, now=0, zan, j, flag=0;
	scanf("%d %d", &a[0][6], &L);
	while(L!=0)
	{
		for(now=0;now<21 && flag==0;now++)
		{
			for(p=0;p<L;p++)
			{
				a[now][p] = (int)(a[now][6] / pow(10, p)) % 10;
			}
			for(s=L;s>1;s--)
			{
				for(t=0;t<s-1;t++)
				{
					zan = a[now][t];
					if(zan > a[now][t+1])
					{
						a[now][t] = a[now][t+1];
						a[now][t+1] = zan;
					}
				}
			}
			a[now+1][6] = 0;
			for(p=0;p<L;p++)
			{
				a[now+1][6] -= a[now][L-p-1] * pow(10, p);
				a[now+1][6] += a[now][p] * pow(10, p);
			}
			for(j=0;j<now+1;j++)
			{
				if(a[j][6] == a[now+1][6])
				{
					printf("%d %d %d\n", j, a[now+1][6] , now +1 -j);
					flag++;
					break;
				}
			}
		}
		flag=0;
		scanf("%d %d", &a[0][6], &L);
	}
	return 0;
}

Measured memory_bytes: 644
// template version 1.6
// {{{ define basic macro
using namespace std;
#include <iostream>
#include <bits/stdc++.h>
// varibable settings
#define int long long
#define INF 1000000000000000000LL
// #define INF 2147483647
#define MOD 1000000007LL
// #define MOD 998244353LL
#define infile "../test/sample-1.in"

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)(b-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ten(n) ((int)1e##n)
template<class T, size_t N> size_t sza(const T (&array)[N]) { return N; }
template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
template<class T=int> T in() {T x; cin>>x; return (x);}
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

// dump macro
#ifdef PCM
  #include "dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;
template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
#define fi first
#define se second

// }}}

int solve(){
  int n,h,w;cin>>n>>h>>w;
  cout << (n-h+1)*(n-w+1) << endl;

  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	int a,b;
	cin>>a>>b;
	cout<<(a+b-3)/(a-1);
	
   return 0;
}


Measured memory_bytes: 3656
while True:
    a,b = map(int,input().split())
    if a == 0 or b == 0:
        break
    else:
        for i in range(a):
            if i == 0 or i == a-1:
                print('#' * b)
            else:
                print('#' + '.'*(b-2) + '#')
            if i == a-1:
                print('')



Measured memory_bytes: 5612
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#define max(X, Y) ((X) > (Y) ? (X) : (Y))

typedef long long ll;
typedef struct {
	char t, d;
} Query;

ll n, q;
char grid[200005];
Query query[200005];
char buff[200005];

//初期位置を引数に取り、最終的位置を返す。n + 1のとき右に落ち、0のとき左に落ちる
ll simulate(ll position);
ll bin_search(char mode);

//VSのscanf()使わせてくれないやつ嫌い！！
ll input(const char* format, ...);

int main()
{
	ll left, right;

	input("%lld %lld", &n, &q);
	input("%s", grid + 1);
	for (ll i = 0; i < q; i++) {
		input("%c %c", &query[i].t, &query[i].d);
	}

	//printf("%lld : %lld\n", bin_search('L'), bin_search('R'));
	printf("%lld\n", bin_search('R') - bin_search('L') - 1);

	return EXIT_SUCCESS;
}

ll simulate(ll position)
{
	ll i = 0;
	while (i < q && position >= 1 && position <= n) {
		if (query[i].t == grid[position]) {
			if (query[i].d == 'L') {
				position--;
			}
			else if (query[i].d == 'R') {
				position++;
			}
		}

		i++;
	}

	if (position > n) {
		position = n + 1;
	}
	else if (position < 1) {
		position = 0;
	}

	return position;
}

ll bin_search(char mode)
{
	ll valid, invalid;
	ll mid;

	valid = (mode == 'L' ? 0 : n + 1);
	invalid = (mode == 'L' ? n + 1: 0);

	while (llabs(invalid - valid) > 1) {
		mid = (invalid + valid) / 2;

		if (simulate(mid) == (mode == 'L' ? 0 : n + 1)) {
			valid = mid;
		}
		else {
			invalid = mid;
		}
	}

	return valid;
}

ll input(const char* format, ...)
{
	va_list args;
	ll ret_val;

	fgets(buff, sizeof(buff) - 1, stdin);

	va_start(args, format);
	ret_val = vsscanf(buff, format, args);
	va_end(args);

	return ret_val;
}

Measured memory_bytes: 896
// =========
use std::cmp::{max, min};
use std::collections::{HashMap, HashSet};
use std::process::exit;

const MOD: usize = 1000000007;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    // var... 変数の識別子, $t...型を一つよむ
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        //ここで繰り返し
        input_inner!{$iter $($r)*}
    };
}

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

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

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    // 配列の最後のNestではここで型が指定されてparseされる
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
// =========

fn main() {
    input! {
        n: u64,
        a: u64
    }
    println!("{:?}", n * n - a);
}

mod tests {
    use super::*;
    #[test]
    fn check() {}
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = (int)1e9 + 7;

vector<LL> dp, dp2;
LL dfs(int f, LL num){
    if(num <= 0) return 0;
    if(num >= dp[f]) return dp2[f];
    
    // B dp[f-1] P dp[f-1] B
    return dfs(f - 1, min(num, dp[f] / 2 + 1) - 1) + (num > dp[f]/2 ? 1 : 0) + dfs(f - 1, num - (dp[f] / 2) - 1);
}

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

    LL n, k;
    cin >> n >> k;

    // dp[i] := i層目の全体の長さ, dp2[i] := i層目のPの数
    dp.assign(n+1, 0), dp2.assign(n+1, 0);
    dp[0] = 1;
    dp2[0] = 1;

    REP(i, n){
        dp[i+1] = dp[i] * 2 + 3;
        dp2[i+1] = dp2[i] * 2 + 1;
    }

    cout << dfs(n, k) << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<iostream>
#include<map>
#include<cstring>
#define INF 1e9+10
using namespace std;
typedef struct Pointx{
    int x,y,h;
}point;
int n,H,yes,done=0,res,t;
point coor[105];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d%d",&coor[i].x,&coor[i].y,&coor[i].h);
        if(coor[i].h>0)
            t=i;
    }
    for(int cx=0;cx<=100;cx++)
        for(int cy=0;cy<=100;cy++){
            yes=1;
            H=coor[t].h+abs(coor[t].x-cx)+abs(coor[t].y-cy);
            for(int i=1;i<=n;i++){
                res=max(H-abs(coor[i].x-cx)-abs(coor[i].y-cy),0);
                if(coor[i].h!=res){
                    yes=0;
                    break;
                }
            }
            if(yes){
                printf("%d %d %d",cx,cy,H);
                return 0;
            }
        }
}

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


int main()
{
	int x[4];
	int times =3;
	int i,j;

	cin >>x[1];
	cin >>x[2];
	cin >>x[3];

	for(j=0;j<times-1;j++){
		for(i=1;i<times-j;i++){
			if(x[i]>x[i+1]){
				x[0]=x[i];
				x[i]=x[i+1];
				x[i+1]=x[0];
			}
		}
	}

	cout<<x[1]<<" "<<x[2]<<" "<<x[3]<<endl;

	//while(1);

	return 0;
}

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

// Miller–Rabin 素数判定法, int に対して決定的で O(log n)
// mod p での累乗
ll modPow(ll x, ll n, int p) {
    ll res = 1;
    while(n > 0){
        if(n & 1) res = res * x % p;
        x = x * x % p;
        n >>= 1;
    }
    return res;
}

// 素数なら true を返す
bool Miller_Rabin(int n){
    if(n == 2) return true;
    if(n % 2 == 0 || n < 2) return false;
    // n-1 = 2^t * m (t>0, m は奇数) と分解
    int t = __builtin_ctz(n-1);
    int m = (n-1) >> t;
    vector<int>a{2, 7, 61};
    for (int x: a) {
        if(n == x) return true;
        if(n % x == 0) return false;
        ll b = modPow(x, m, n);
        if(b == 1 || b == n-1) continue;
        int flag = 0;
        for (int i = 1; i < t; ++i) {
            b = b * b % n;
            if(b == n-1) {
                flag = 1;
                break;
            }
        }
        if(flag == 0) return false;
    }
    return true;
}

int main() {
    int N;
    cin >> N;
    while (Miller_Rabin(N) == false) {
        N++;
    }
    cout << N << "\n";
    return 0;
}

Measured memory_bytes: 256
n, m = [int(i) for i in input().split()]
p = [0] * m
s = [0] * m

ac = 0
wc = 0
wan = [0] * (n+1)
qj = [False] * (n+1)

for i in range(m):
    p[i], s[i] = input().split()
    p[i] = int(p[i])
    if not qj[p[i]]:
        if s[i] == 'AC':
            qj[p[i]] =  'True'
            ac += 1
            wc += wan[p[i]]
        else:
            wan[p[i]] += 1

print(ac, wc)

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
ll INF = LLONG_MAX;
 
using vc = vector<char>;
using vi = vector<int>;

int N, K; 
bool isValid() {
    if (N == 2) return K == 0;
    return ((N-1) * (N-2)) / 2 >= K;
}
int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> N >> K;
    if (!isValid()) {
        cout << -1 << endl; return 0;
    }
    vector<vi> graph (N);
    FOR(i, 1, N) {
        graph[i].push_back(0);
        graph[0].push_back(i);
    }
    int total = ((N-1) * (N-2)) / 2;
    for (int s = 1; s < N && total > K; ++s) {
        for (int e = s + 1; e < N && total > K; ++e) {
            graph[s].push_back(e);
            graph[e].push_back(s);
            --total;
        }
    }

    cout << N - 1 + ((N-1) * (N-2)) / 2 - K << endl;
    F0R(i, N) {
        for (int e : graph[i]) {
            if (i > e) continue;
            cout << i + 1 << " " << e + 1 << endl;
        }
    }
}

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

using namespace std;

const int maxn = 100;
int main()
{
	int n, a[maxn];
	cin >> n;
	
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}

	for (int i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			if (a[i] % 3 != 0 && a[i] % 5 != 0)
			{
				cout << "DENIED";
				return 0;
			}
		}
	}

	cout << "APPROVED";

	
	return 0;
}


Measured memory_bytes: 256
#include <stack>
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <iomanip>
#include <string>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
int mod = 1000000000 + 7;
int main(){
    //std::stack<int> stack;
    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = s.size();
    string ans = "";
    if(n <= k){
        ans = s;
    }else{
        for(int i = 0; i < k; i++){
            ans += s[i];
        }
        ans += "...";
    }
    cout << ans << endl;
    return 0;
}





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

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

using namespace std;

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

    int ans = 0;
    int j;
    for(int i = 0; i < n; i++){
        for(j = 0; a[i] % 2 == 0; j++){
            a[i] /= 2;
        }
        ans += j;
    }

    cout << ans << endl;
}

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

using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define LEN(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
using ll = long long;
using llu = long long unsigned;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vpii = vector<pii>;

const ld EPS = 1e-9;
inline int cmp(ld x, ld y = 0, ld tol = EPS) {
	return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}

const int MOD = 1;
inline int mod(ll x, int m = MOD) {
	return (int)(((x%m) + m)%m);
}

// template<typename T, typename M = __gnu_pbds::null_type>
// using ordered_set = __gnu_pbds::tree<T, M, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

////////////////////////// Solution starts below. //////////////////////////////



int main () {
	ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    // cout.precision(10);
    int n, m;
    cin>>n>>m;
    vector<pii> points(n);
    int ans = 0;
    for(int i = 0; i < n; i++){
        int a, b;
        cin>>a>>b;
        if (sqrt(pow(a,2)+pow(b,2)) <= m){ ans++;
        }
    }
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4844
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#define bitcount __builtin_popcount
#define bitctz __builtin_ctz
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n, m; double p;
	cin>>n>>m>>p; p/=100;
	int a[100], b[100];
	for(int i=0; i<m; i++){
		cin>>a[i]>>b[i]; a[i]--; b[i]--;
	}
	int ct[1<<14]={};
	for(int i=0; i<(1<<n); i++){
		for(int j=0; j<m; j++){
			if((i&(1<<a[j])) && (i&(1<<b[j]))) ct[i]++;
		}
	}
	double dp[1<<14]={};
	for(int i=1; i<(1<<n); i++){
		int t=bitctz(i);
		if(i==(1<<t)) continue;
		for(int j=i; j>0; j=(j-1)&i){
			if(j==i) continue;
			if((j&(1<<t))==0) continue;
			dp[i]+=((1-dp[j])*pow(p, (double)(ct[i]-ct[j]-ct[i-j])));
			
		}
	}
	printf("%.10lf\n", 1-dp[(1<<n)-1]);
	return 0;
}


Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>

int main() {
	int s = 0, w = 0;

	std::cin >> s >> w;

	if (s <= w) {
		std::cout << "unsafe" << std::endl;
	}
	else {
		std::cout << "safe" << std::endl;
	}
	
	return 0;
}



Measured memory_bytes: 3632
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
#define PI (acos(-1))

int main() {
	int d,a,kakudo=0;
	long double x=0, y=0;
	while (1) {
		scanf("%d,%d", &d, &a);
		if (d == 0 && a == 0)
			break;
		y += d*cos(kakudo*PI / 180.0);
		x += d*sin(kakudo*PI / 180.0);
		kakudo = (kakudo + a) % 360;
	}
	cout << (int)x << endl << (int)y <<endl;
	return 0;
}


Measured memory_bytes: 3552
#include <iostream>

using namespace std;

int main()
{
    string s; cin >> s;
    if(s.size() < 6)
    {
        cout << "No\n";
    }
    else
    {
        if(s[2] == s[3] && s[4] == s[5]) cout << "Yes\n";
        else cout << "No\n";
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll gcd(ll a,ll b){
 ll  r=a%b;
  while(r>0){
    a=b;
    b=r;
    r=a%b;
  }
  return b;
}
ll lcm(ll a,ll b){
  return a/gcd(a,b)*b;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,b;cin>>a>>b;
  cout<<lcm(a,b)<<endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())

red = []
blue = []


for i in range(n):
    l = list(map(int,input().split()))
    red.append(l)
for i in range(n):
    l = list(map(int,input().split()))
    blue.append(l)

done = []

blue.sort()
for i in range(n):
    bag = []
    cnt = 0
    x = blue[i][0]
    y = blue[i][1]
    for j in range(n):
        if (x > red[j][0]) and (y > red[j][1]):
            if red[j] not in done:
                bag.append(red[j])
                cnt += 1
    bag.sort(key = lambda x:x[1])
    if cnt != 0:
        done.append(bag[cnt-1])

print(len(done))

Measured memory_bytes: 3064
n,m=gets.split.map(&:to_i)
all=[]
m.times.each do
    all<<gets.split.map(&:to_i)
end
result=[]

for i in 0..1000
     i=i.to_s
    if i.length!=n
        next
    end
    flag=0
    for j in 0..all.length-1
        v=i[all[j][0]-1].to_i
        #p v
        if v!=all[j][1]
            flag=1
            break
        end
    end
    if flag==0
    result<<i
    end
end

result=result.map(&:to_i)
if result[0]==nil
    p -1
else
p result.min
end
    

Measured memory_bytes: 14280
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cstdio>
#define LL long long
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
char s[200010];
int pref[200010];
int main(){
	int n;
	cin>>n;
	cin>>(s+1);
	int ans=INF;
	// int n=strlen(s+1);
	for(int i=1;i<=n;i++)pref[i]=pref[i-1]+(int)(s[i]=='R');
	if(pref[n]==0){
		cout<<0<<endl;
		return 0;
	}
	for(int i=1;i<=pref[n];i++){
		ans=min(ans,i-pref[i]+pref[n]-pref[i]-(i-pref[i]));
	}
	cout<<ans<<endl;
	return 0;
}


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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

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

  string S, T;
  IN(S);
  IN(T);

  ll ans = S.size();
  REP(i,S.size()){
    if(S[i]==T[i]) ans--;
  }

  OUT(ans);

  return 0;
}

Measured memory_bytes: 3804
#include <bits/stdc++.h>
#define MODNum 1000000007
#define REP(type, i, a, b) for( type i = a; i < b; i++ )
typedef long long ll;

using namespace std;

int main (void) {
    ll A, B, K, ans1, ans2;
    scanf("%lld %lld %lld", &A, &B, &K);
    if ( K >= A + B ){
        ans1 = 0;
        ans2 = 0;
    }
    else if ( A >= K ){
        ans1 = A - K;
        ans2 = B;
    }
    else{
        ans1 = 0;
        ans2 = B - (K - A);
    }
    printf("%lld %lld\n", ans1, ans2);
    return 0;
}

Measured memory_bytes: 256
# Contest No.: ABC173
# Problem No.: E
# Solver:      JEMINI
# Date:        20200705

import sys
import heapq

def main():
    modVal = 10 ** 9 + 7
    # parsing
    n, k = map(int, sys.stdin.readline().split())
    nums = list(map(int, sys.stdin.readline().split()))
    
    # edge case; n == k
    if n == k:
        ans = 1
        for i in nums:
            ans *= i % modVal
            ans %= modVal
        print(ans % modVal)
        return
    
    # edge case; all neg
    if max(nums) < 0:
        nums.sort()
        ans = 1
        # odd k
        if k % 2:
            for i in range(k):
                ans *= nums[-i - 1] % modVal
                ans %= modVal
        # even k
        else:
            for i in range(k):
                ans *= nums[i] % modVal
                ans %= modVal
        print(ans % modVal)
        return
    
    # convert to absolute value & count zeros
    absNums = []
    zeroCnt = 0
    for i in nums:
        if i == 0:
            zeroCnt += 1
        else:
            absNums.append([abs(i), i])
    absNums.sort()  # sorted by absolute value
    
    # edge case; non-zero cnt is less than k
    if len(absNums) < k:
        print(0)
        return

    # separate non-zero int to 4 sorted lists; all values are absolute value
    posOverK = []
    negOverK = []
    posLessK = []
    negLessK = []
    for _ in range(k):
        temp = absNums.pop()
        if temp[1] > 0:
            posOverK.append(temp[0])
        else:
            negOverK.append(temp[0])
    while absNums:
        temp = absNums.pop()
        if temp[1] > 0:
            posLessK.append(temp[0])
        else:
            negLessK.append(temp[0])

    posOverK.sort()
    negOverK.sort()
    posLessK.sort()
    negLessK.sort()
    
    # odd negative numbers; if able, change to even
    if len(negOverK) % 2:
        minNeg = None
        minPos = None
        maxNeg = None
        maxPos = None
        if posOverK:
            minPos = posOverK[0]
        if negOverK:
            minNeg = negOverK[0]
        if posLessK:
            maxPos = posLessK[-1]
        if negLessK:
            maxNeg = negLessK[-1]
        
        # both case available; pos -> neg or neg -> pos
        if (minNeg and maxPos) and (minPos and maxNeg):
            # compare ratio
            if maxPos * minPos > maxNeg * minNeg:
                negOverK[0] = maxPos
            else:
                posOverK[0] = maxNeg
        # one case available
        elif not (minNeg and maxPos) and (minPos and maxNeg):
            posOverK[0] = maxNeg
        elif (minNeg and maxPos) and not (minPos and maxNeg):
            negOverK[0] = maxPos
        # unchangable, zero exists
        elif zeroCnt > 0:
            print(0)
            return
    
    # answer building
    ans = 1
    for i in posOverK:
        ans *= i % modVal
        ans = ans % modVal
    for i in negOverK:
        ans *= i % modVal
        ans = ans % modVal
    
    print(ans % modVal)
    return

if __name__ == "__main__":
    main()

Measured memory_bytes: 122836
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    sc.close();

    String[] S = s.split("");

    String result = "";

    int max = 0;

    for (int i = 0; i < S.length; i++) {
      if (S[i].equals("A") || S[i].equals("C") || S[i].equals("G") || S[i].equals("T")) {
        result += S[i];
        max = Math.max(max, result.length());
      } else {
        result = "";
      }
    }

    System.out.println(max);

  }

}

Measured memory_bytes: 23636
W, H, N = map(int,input().split())

Wmin = 0
Wmax = W
Hmin = 0
Hmax = H

for i in range(N):
    x, y, z = map(int,input().split())
    if z == 1:
        Wmin = max(x, Wmin)
    if z == 2:
        Wmax = min(x, Wmax)
    if z == 3:
        Hmin = max(y, Hmin)
    if z == 4:
        Hmax = min(y, Hmax)
if Wmax < Wmin or  Hmax < Hmin:
    print(0)
else:
    print((Wmax-Wmin)*(Hmax-Hmin))

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main(){
	int N;
	long long int E[100000];
	long long int K;
	int i=0;
	int a,b;
	long long int c=0;
	int ans;
	
	for(i=0;i<100000;i++){
		E[i]=0;
	}
	
	cin>>N>>K;
	for(i=0;i<N;i++){
		cin>>a>>b;
		E[a-1]=E[a-1]+b;
	}
	for(i=0;i<100000;i++){
		c=c+E[i];
		if(c>=K){
			ans=i+1;
			break;
		}
	}
	cout<<ans;
}

Measured memory_bytes: 1024
from collections import deque
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
G = [[] for _ in range(N+1)]
for _ in range(M):
    u, v = map(int, input().split())
    G[u].append(v)
S, T = map(int, input().split())
queue = deque()
queue.append((S, 0))
visited = [[False] * 3 for _ in range(N+1)]
while queue:
    u, d = queue.popleft()
    if visited[u][d % 3]:
        continue
    visited[u][d % 3] = True
    if d % 3 == 0 and u == T:
        print(d // 3)
        exit()
    for v in G[u]:
        queue.append((v, d+1))
print(-1)


Measured memory_bytes: 66096
#include <stdio.h>

int n, A[50];

int solve(int i, int m) {
	if (m == 0) return 1;
	if (m < 0) return 0;
	if (i >= n) return 0;
	int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
}

int main(void) {
	int q, M, i;

	scanf("%d", &n);
	for (i = 0; i < n; i++)scanf("%d", &A[i]);
	scanf("%d", &q);
	for (i = 0; i < q; i++) {
		scanf("%d", &M);
		printf("%s\n", solve(0, M) ? "yes" : "no");
	}

	return 0;
}


Measured memory_bytes: 2048
INF=10**18
def calc(a,b,xor):
  if (a,b,xor) in memo:
    return memo[(a,b,xor)]
  if (a&1)^(b&1)!=(xor&1):
    return INF
  if xor==0:
    if a<b:
      return INF
    else:
      return (a-b)//2
  x=2*calc(a//2,b//2,xor//2)
  y=2*calc((a-1)//2,(b+1)//2,xor//2)+1
  memo[(a,b,xor)]=min(x,y)
  return memo[(a,b,xor)]

n=int(input())
arr=list(map(int,input().split()))
a,b=arr[0],arr[1]
xor=0
for i in range(2,n):
  xor^=arr[i]
memo={}
ans=calc(a,b,xor)
if ans>=a:
  print(-1)
else:
  print(ans)

Measured memory_bytes: 61856
# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
lis=[]
for i in range(n):
    lis.append(LI())
lis.sort(key=lambda x:x[2],reverse=True)
x1,y1,h1,x2,y2,h2=lis[0][0],lis[0][1],lis[0][2],lis[1][0],lis[1][1],lis[1][2]
cand=[]
    
for i in range(101):
    for j in range(101):
        H=h1+abs(i-x1)+abs(j-y1)
        cand.append([i,j,H])
#print(cand)

candx=[]
for j in range(len(cand)):
    H=cand[j][2]
    count=0
    #print(H)
    for i in range(1,n):
        if max(H-abs(cand[j][0]-lis[i][0])-abs(cand[j][1]-lis[i][1]),0)==lis[i][2]:
            count+=1
    #print(count)
    if count==n-1:
        candx.append([cand[j][0],cand[j][1],H])
print(*candx[0])
'''for li in candx:
    flag=True
    for i in range(n):
        if lis[i][2]<0:
            if -abs(li[0]-lis[i][0])-abs(li[1]-lis[i][1])+li[2]>=0:
                flag=False
    if flag==True:
        print(*li)
        sys.exit()'''

Measured memory_bytes: 4724
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

typedef long long LL;

int main(int argc, char* argv[]) {
#ifdef _MSC_VER
	while (true)
#endif
	{
		LL ans = 0;
		int n = -1, a;
		cin >> n;
		if (n < 0) return 0;
		map<int, int> m;
		
		for (int i = 0; i < n; ++i) {
			cin >> a;
			int d = (n - 1 - i);
			a -= d;
			int sum = -d * 2 - a;
			ans += m[sum];
			m[a] += 1;
//			cout << " " << a;
		}
//		cout << endl;
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 20676
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

using Graph=vector<vector<int>>;
Graph G;

int main(){
  ll n, k;
  cin >> n >> k;
  
  
  if(k%2 != 0){
    ll a = n/k;
    cout << a*a*a << endl;
  }
  else{
    ll a = n/k;
    ll b = (n+k/2)/k;
    cout << a*a*a + b*b*b << endl;
  }
  
  
}
    


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

int n, n1, x;

int main(){

	cin >> n;
	n1 = n;
	
	while (n1 > 0) {
		x += n1 % 10;
		n1 /= 10;
	}

	if (n % x == 0) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#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 drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  int a,b,c,x,y;
  cin>>a>>b>>c>>x>>y;
  ll ans = 1LL<<60;
  for(int i = 0;i<=2*(x+y);i+=2){
    ll ax = i/2;
    ll bx = i/2;
    ll tmp = i*c + max(0LL,x-ax)*a + max(0LL,y-bx)*b;
    mins(ans,tmp);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#define SIZE 10
using namespace std;

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

	int M,D;
	int i,j;
	int tmp;
	int counter=0;
	vector<int> given;

	cin >> M >> D;

	for(i=1;i<=M;i++){
		for(j=1;j<=D;j++){
			if(i==((j/10)*(j%10)) && (j/10)>=2 && (j%10)>=2){
				counter++;
			}
		}
	}

	cout << counter << endl;
	return 0;
}



Measured memory_bytes: 256
import java.io.*;
import java.math.BigInteger;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		BigInteger a = new BigInteger(saori.nextHayami());
		BigInteger b = new BigInteger(saori.nextHayami());
		BigInteger x = new BigInteger(saori.nextHayami());
		BigInteger ans;
		a = a.subtract(BigInteger.ONE);
		if(a.compareTo(BigInteger.ZERO) < 0){
			ans = b.divide(x).add(BigInteger.ONE);
			System.out.println(ans);
		} else {
			ans = b.divide(x).subtract(a.divide(x));
			System.out.println(ans);
		}
		


		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 23252
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

#define debug(x) cout << #x << ": " << x << endl;
#define ll long long
#define mod 1000000007

ll N, A, D;
unordered_map<int, vector<pair<ll, ll>>> uma;

int modD(ll num) {
  return ((num%D) + D)%D;
}

ll find_answer(vector<pair<ll,ll>> B) {
  sort(B.begin(), B.end());
  ll xmin = B[0].first;
  ll xmax = B[0].second;

  int i = 0;
  ll ans = 0;
  for(i = 1;i < B.size();i++) {
    if(B[i].first <= xmax) {
      xmax = max(xmax, B[i].second);
    } else {
      ans = ans + (xmax-xmin)/D + 1;

      xmin = B[i].first;
      xmax = B[i].second;
    }
  }
  ans = ans + (xmax-xmin)/D + 1;
  return ans;
}

int main() {
//  freopen("input.in","r",stdin);
  //freopen("output.out","w",stdout);

  // cout<<LONG_LONG_MAX;
  //   return 0;
  cin >> N >> A >> D;
  // distinct vals of Lambda*A + (sum of Lambda elements)*D
  if(D == 0) {
    if(A == 0) {
      cout << 1 << endl;
    } else {
      cout << N + 1 << endl;
    }
    return 0;
  }

  if(D < 0) {
    A = -A;
    D = -D;
  }

  ll forw = 0, back = 0;
  for(int lambda = 0;lambda <= N;lambda++) {
    if(lambda == 0) {
      uma[0].push_back({0, 0});
      continue;
    }

    forw = forw + lambda - 1;
    back = back + N - lambda;

    ll minm = lambda*A + forw*D;
    ll maxm = lambda*A + back*D;
    uma[modD(minm)].push_back({minm, maxm});
  }

  ll ans = 0;
  for(auto it = uma.begin();it != uma.end();it++) {
    ans += find_answer(it->second);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 17864
#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;
 
 
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define speedhack() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define form(i, n) for (size_t i = 0; i < size_t(n); ++i)
#define forn(i, n) for (size_t i = 1; i <= size_t(n); ++i)
template<class T> using ordered_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long mod(long long a, long long b) { return (a%b+b)%b; }
long long gcd(long long x, long long y) { return __gcd(x, y); }
long long lcm(long long x, long long y) { return x * 1ll * y / gcd(x, y); }
 
 
const long long MAXN = 1e9 + 9;
const long long SIZE = 3e5 + 5;
const long long MOD = 1e9 + 7;


int N, res;
double x, y, D;


int main() { speedhack()

	cin >> N >> D;

	forn (i, N) {
		cin >> x >> y;
		double d = sqrt (x * x + y * y);
		if (d <= D)
			++res;
	}

	cout << res << endl;

	return 0;
}


Measured memory_bytes: 3828
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
from collections import Counter
def resolve():
    S=input()
    a=[s in S for s in"NSEW"]
    if a[0]==a[1] and a[2]==a[3]:
        print("Yes")
        return
    print("No")
    #print()
#%%submit!
resolve()


Measured memory_bytes: 38256
#![allow(unused_macros)]

// cf. [Rustで競技プログラミングの入力をスッキリ記述するマクロ - Qiita](https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8)
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")
    };
}

fn main() {
    input! {
        x: usize,
    }
    let mut x = x;

    let mut ans = 0;
    ans += (x / 11) * 2;
    x %= 11;
    if 0 < x && x <= 6 {
        ans += 1;
    } else if 6 < x && x < 11 {
        ans += 2;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352