akhauriyash/Code-Regression huggingface dataset:
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    if(a<=b*c)yes;
    else no;
}


Measured memory_bytes: 3656
import java.util.*;

class Main {
    //
    static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intの最大値
    static final int INF = 1_000_000_000; // 10^9

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        if(a < 1200){
            System.out.println("ABC");
        }else if(a < 2800){
            System.out.println("ARC");
        }else{
            System.out.println("AGC");
        }
    }
}

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

long long h[100005];

int main(){
	long long N, K;
	cin >> N >> K;
	long long num = 0;
	for(long long i = 0; i < N; i++){
		cin >> h[i];
		if(h[i] >= K){
			num++;
		}
	}
	cout << num << endl;
}


Measured memory_bytes: 1024
from math import log2, floor
from operator import or_
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

if max(a) == 0 :
    bl = [0]
else :
    bl = [0 for _ in range(floor(log2(max(a)))+1)]
for ai in a :
    aj = ai
    if ai == 0 :
        pass
    else :
        for i in range(floor(log2(ai))+1) :
            if aj & 1 == 1 :
                bl[i] += 1
            aj >>= 1

ans = reduce(or_, map(lambda x : x&1, bl))
if ans :
    print("No")
else :
    print("Yes")

Measured memory_bytes: 14724
#include <stdio.h>

int main(){
  int a[3];
  int c5,c7;
  for(int i=0; i<3; i++){
    scanf("%d",&a[i]);
  }
  for(int i=0; i<3; i++){
    if(a[i]==5) c5++;
    else if(a[i]==7) c7++;
  }
  if(c5==2&&c7==1) printf("YES");
  else printf("NO");
}


Measured memory_bytes: 128
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <bitset>
#include <iostream>
#include <deque>
#include <functional>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <string>
#include <vector>
#include <vector>

using namespace std;

#define int long long

#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

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

#define debug(x) cerr << #x << ": " << x << endl;

const int MOD = 1e9 + 7;

signed main(void)
{

  string s;
  string t;
  cin >> s;
  cin >> t;
  int n = s.length();
  int m = t.length();

  vector<string> v;
  for (int i = 0; i < n - m + 1; ++i) {
    bool flag = true;
    string _s = s;

    for (int j = i; j < i + m; ++j) {
      if (s[j] != t[j - i]) {
        if (s[j] == '?') _s[j] = t[j - i];
        else flag = false;
      }
      if (!flag) break;
    }
    
    if (flag) {
      for (auto it = _s.begin(); it != _s.end(); ++it) {
        if (*it == '?') *it = 'a';
      }
      v.push_back(_s);
    }
    
  }

  if (v.size() == 0) {
    cout << "UNRESTORABLE" << endl;
  } else {
    sort(ALL(v));
    cout << v[0] << endl;
  }
}


Measured memory_bytes: 256
require 'pp'

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

K = gets_i
A, B = gets_i_list


b = B / K

a = A / K

aa = a * K
aaa  = (a+1) * K

if A <= aa && aa <= B  
  puts "OK"
elsif A <= aaa && aaa <= B
  puts "OK"
else
  puts "NG"
end


Measured memory_bytes: 14576
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

vector<ll> A;
// vectorのリサイズ
// A.resize(N);

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return b/gcd(a,b)*b;}

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

  ll r, g, b, n;
  cin >> r >> g >> b >> n;
  ll ans = 0;
  rep(i, n+1) {
    rep(j, n+1) {
      int k = (n - r*i - g*j);
      if (k >= 0 && k % b == 0) {
        ans++;
        //printf("r: %d, g: %d, b: %d\n", i, j, int(k/b));
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
    string s; cin >> s;
    string k = "keyence";
    
    int cnt=0;
    int flag=0;
    vector <int> v;
    string ktmp;

    if(s.substr(s.size()-k.size())==k){
        cout << "YES" << endl;
        return 0;
    }

    if(s.substr(0, k.size())==k){
        cout << "YES" << endl;
        return 0;
    }

    rep(i, s.size()){
        if(s[i]==k[cnt]){
            cnt++;
        }else{
            // v.emplace_back(i);
            ktmp = k.substr(cnt);
            break;
        }
    }

    if(s.substr(s.size()-ktmp.size())==ktmp){
        cout << "YES" << endl;
        return 0;
    }

    cout << "NO" << endl;
    return 0;
}

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

using namespace std;

int main(){
  for(int n,k,m;cin>>n>>k>>m,n|k|m;){
    vector<int> v(n);
    for(int i=0;i<n;i++){
      v[i]=i+1;
    }
    int x=m-1;
    v.erase(v.begin()+x);
    for(int i=0;i<n-2;i++){
      x=(x+k-1)%v.size();
      v.erase(v.begin()+x);
    }
    cout<<v[0]<<endl;
  }
  return 0;
}

Measured memory_bytes: 1252
from collections import Counter

N = int(input())
a = [int(i) for i in input().split()]
number_counter = [list(i) for i in sorted(list(Counter(a).most_common()), key=lambda x: x[0])]
if len(number_counter) == 1:
  number_counter = [[10 ** 6, 0]] + number_counter + [[10 ** 6, 0]]
elif len(number_counter) == 2:
  number_counter += [[10 ** 6, 0]]

count = 0 
for i in range(1, len(number_counter) - 1):
  next_count = number_counter[i][1]
  number = number_counter[i][0]
  if number_counter[i - 1][0] + 1 == number:
    next_count += number_counter[i - 1][1]
  if number_counter[i + 1][0] - 1 == number:
    next_count += number_counter[i + 1][1]
  if next_count > count:
    count = next_count

print(count)

Measured memory_bytes: 19420
from heapq import heappush, heappop
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    N, E, T = map(int, readline().split())
    *W, = map(int, readline().split())
    G = [[] for i in range(N)]
    R = [[] for i in range(N)]
    C = [0]*E
    Q = [None]*E
    for i in range(E):
        g, c, *s = map(int, readline().split())
        for e in s:
            R[e-1].append(i)
        C[i] = c
        Q[i] = (g, s)
    que = []
    INF = 10**9
    def calc(s):
        s.sort(key = lambda x: dp[x-1], reverse=1)
        r = 0
        for i, j in enumerate(s):
            r = max(r, i + dp[j-1])
        return r

    dp = [INF]*N
    for i in range(N):
        if W[i]:
            dp[i] = 1
            for j in R[i]:
                C[j] -= 1
                if C[j] == 0:
                    g0, s0 = Q[j]
                    heappush(que, (calc(s0), j))
    while que:
        cost, e = heappop(que)
        g, s = Q[e]
        if dp[g-1] < cost:
            continue
        if cost < dp[g-1]:
            dp[g-1] = cost
            for j in R[g-1]:
                C[j] -= 1
                if C[j] <= 0:
                    g0, s0 = Q[j]
                    heappush(que, (calc(s0), j))
    if dp[T-1] != INF:
        write("%d\n" % dp[T-1])
    else:
        write("-1\n")
solve()



Measured memory_bytes: 6008
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		for (int i = 0; i < n; i++) {
		    char[] arr = sc.next().toCharArray();
		    Arrays.sort(arr);
		    String s = new String(arr);
		    if (map.containsKey(s)) {
		        map.put(s, map.get(s) + 1);
		    } else {
		        map.put(s, 1);
		    }
		}
		long total = 0;
		for (int x : map.values()) {
		    total += (long) x * (x - 1) / 2;
		}
		System.out.println(total);
	}
}


Measured memory_bytes: 53100
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#define MOD 1000000007LL

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

int main()
{
	int n, W;
	cin>>n>>W;
	int w[201];
	for(int i=1; i<=n; i++){
		cin>>w[i];
	}
	sort(w+1, w+n+1, greater<int>());
	int s[202];
	s[n+1]=0;
	s[n]=w[n];
	for(int i=n-1; i>=1; i--){
		s[i]=s[i+1]+w[i];
	}
	ll dp[201][10001]={};
	dp[0][0]=1;
	for(int i=1; i<=n; i++){
		for(int j=0; j<=W; j++){
			dp[i][j]=dp[i-1][j];
          	if(j>=w[i]) dp[i][j]+=dp[i-1][j-w[i]];
			dp[i][j]%=MOD;
		}
	}
	ll ans=0;
	if(s[1]<=W){
		cout<<1<<endl;
		return 0;
	}
	for(int i=1; i<=n; i++){
		for(int j=max(0, W-s[i]+1); j<=W-s[i+1]; j++){
			ans+=dp[i-1][j];
			ans%=MOD;
		}
	}
	cout<<ans<<endl;
	return 0;
}


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

struct LINE {
	int a;
	int b;
	int d;
	bool use;
};

vector<int> getconnect(vector<LINE> &lines,int n)
{
	vector<int>	r;
	for(int i=0;i<lines.size();i++){
		if( lines[i].a != lines[i].b && (lines[i].a==n || lines[i].b==n) ){
			r.push_back(i);
		}
	}
	return r;
}

int main() {

	while(true){

	int n,m;
	cin >> n >> m;
	if( n==0) break;
	
	vector<LINE> lines;
	
	for(int i=0;i<m;i++){
		LINE l;
		char c;
		cin >> l.a >> c >> l.b >> c >> l.d;
		l.use=false;
		lines.push_back(l);
	}

	while( true ){

		int count=0;
		for(int i=0;i<n;i++){
			auto idxs=getconnect(lines,i);
			if( idxs.empty() ) continue;

			count++;
			
			int mini = idxs[0];
			int mind = lines[mini].d;
			for(int idx : idxs){
				if( lines[idx].d < mind ){
					mini = idx;
					mind = lines[idx].d;
				}
			}
			int t = lines[mini].a!=i?lines[mini].a:lines[mini].b;
			
			auto idxs2=getconnect(lines,t);
			for(int idx : idxs2){
				if( lines[idx].a==t){
					lines[idx].a = i;
				}
				if( lines[idx].b==t){
					lines[idx].b = i;
				}
			}

			lines[mini].use=true;
		}
		if( count==0) break;
		count=0;
	}

	int ans=0;
	for( auto l : lines){
		if( l.use){
			ans += l.d/100-1;
		}
	}
	cout << ans << endl;

	}
	return 0;
}

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

int main(){
    int H, W;
    cin >> H >> W;
    char inGrid[H][W];

    for (int i = 0; i < H; i++) {
        string str;
        cin >> str;
        int length = str.length();
        for (int j = 0; j < W; j++){
            inGrid[i][j] = str.at(j);
        }
    }

    int bombCnt = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++){
            bombCnt = 0;
            for (int n = -1; n < 2; n++){
                for (int m = -1; m < 2; m++){
                    if (((i + n) >= 0 and (i + n) < H ) and
                        (j + m) >= 0 and (j + m) < W){
                        if (inGrid[i + n][j + m] == '#'){
                            bombCnt++;
                        }
                    }
                }
            }

            if (inGrid[i][j] == '#'){
                cout << "#";
            } else {
                cout << bombCnt;
            }
        }
        cout << endl;
    }



}

Measured memory_bytes: 256
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long ll;

const int INF = INT_MAX;

int main() {
  int N, T;
  cin >> N >> T;
  vector<int> A(N);
  REP(i,0,N) {
    cin >> A[i];
  }
  int mina = INF;
  int gap = -1;
  for(auto &x: A) {
    mina = min(mina, x);
    gap = max(gap, x - mina);
  }
  int ans = 0;
  mina = INF;
  for(auto &x: A) {
    mina = min(mina, x);
    if(x - mina == gap) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(i, n) for(int i=0; i<=n; i++)
#define repr(i, n) for(int i=n; i>0; i--)
#define REPR(i, n) for(int i=n; i>=0; i--)
const ll INF = 1e18;
const int INT_INF = 1e9;
const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

string s;

int main() {
    cin >> s;

    bool flg = true;
    for (int i = 0; i < s.length(); i++) {
        if (i % 2 == 0) {
            if (s[i] == 'L') {
                flg = false; break;
            }
        } else {
            if (s[i] == 'R') {
                flg = false; break;
            }
        }
    }
    if (flg) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.Scanner;

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

        int n = sc.nextInt();
        int q = sc.nextInt();

        Queue queue = new Queue(n);
        for (int i = 0; i < n; i++) {
            String name = sc.next();
            int time = sc.nextInt();
            Process x = new Process(name, time);
            queue.enqueue(x);
        }

        int time = 0;
        while (!queue.isEmpty()) {
            Process x = queue.dequeue();
            if (x.time - q <= 0) {
                time += x.time;
                pw.print(x.name + " ");
                pw.println(time);
            } else {
                time += q;
                x.time -= q;
                queue.enqueue(x);
            }
        }

        pw.flush();
    }

    static class Process {
        String name;
        int time;

        Process(String name, int time) {
            this.name = new String(name);
            this.time = time;
        }
    }

    static class Queue {
        Process[] Q;
        int lastIndex;
        int head;
        int tail;

        Queue(int n) {
            Q = new Process[n + 1];
            lastIndex = n;
            head = 0;
            tail = 0;
        }

        void enqueue(Process x) {
            Q[tail++] = new Process(x.name, x.time);
            if (tail > lastIndex)
                tail = 0;
        }

        Process dequeue() {
            Process x = Q[head++];
            if (head > lastIndex)
                head = 0;
            return x;
        }

        boolean isEmpty() {
            return head == tail ? true : false;
        }
    }
}


Measured memory_bytes: 78080
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int  a,b;
  cin>>a>>b;
 
  for(int n=0;n<10000;n++){
    int za=n*8/100;
    int zb=n*10/100;
    if(a==za &&b==zb){
      cout<<n<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}

Measured memory_bytes: 256
#include <iostream>                                                                                                                                                                                           
using namespace std;                                                                                                                                                                                          
                                                                                                                                                                                                              
int main()                                                                                                                                                                                                    
{                                                                                                                                                                                                             
    int a, b;                                                                                                                                                                                                 
    cin >> a >> b;                                                                                                                                                                                            
                                                                                                                                                                                                              
    cout << ( a > b ? "safe" : "unsafe" ) << endl;                                                                                                                                                            
    return 0;                                                                                                                                                                                                 
} 

Measured memory_bytes: 3624
import bisect
N = int(input())
C = [int(input())for _ in range(N)]
INF = float('inf')
dp = [INF]*N
max_ind = 0
for c in C:
    index = bisect.bisect_left(dp,c)
    dp[index] = c
    max_ind = max(max_ind,index)

print(max_ind+1)



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

Measured memory_bytes: 35656
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long

typedef int Type;
struct Fenwick{
    vector<Type> bit;
    Fenwick(int n){
        bit = vector<Type>(n + 1);
    }
    void update(int i, Type v){
        int n = bit.size();
        ++i;
        while(i <= n){
            bit[i] += v;
            i += i & -i;
        }
    }
    Type get(int i){
        Type res = 0;
        ++i;
        while(i > 0){
            res += bit[i];
            i -= i & -i;
        }
        return res;
    }
};

signed main(){
	int N, K;
	cin >> N >> K;
	vector<int> a(N), b(N + 10);
	for(int i = 0; i < N; ++i) {
		cin >> a[i];
	}
	b[0] = 0;
	for(int i = 1; i <= N; ++i) {
		b[i] = b[i-1] + (i - 1) * K + a[i - 1] - i * K;
	}
	vector<int> c = b;
	sort(ALL(c));
	c.erase(unique(ALL(c)), c.end());

	int sum = 0;
	Fenwick bit(c.size());
	bit.update(lower_bound(ALL(c), b[N]) - c.begin(), 1);
	for(int i = N - 1; i >= 0; --i) {
		int t = lower_bound(ALL(c), b[i]) - c.begin();
		sum += (N - i) - bit.get(t - 1);
		bit.update(t, 1);
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 6528
#include <stdio.h>

int main(void)
{
	int a, b;
	scanf("%d %d",&a, &b);
	if( a>= 13)
	{
		printf("%d\n",b);
		return(0);
	}
	if (a>= 6)
	{
		printf("%d\n",b/2);
		return(0);
	}
	printf("0");
	return (0);
}


Measured memory_bytes: 128
main = do
  [n, a, b] <- map read . words <$> getLine
  let xs = [x | x <- [1 .. n], let y = digitSums x , y >= a, y <= b]
  print $ sum xs


digitSums :: Int -> Int
digitSums x
  | x >= 10   = x `mod` 10 + digitSums (x `div` 10)
  | otherwise = x `mod` 10



Measured memory_bytes: 508
#include <iostream>
using namespace std;
int h,w;
char map[25][25];
char dir;

bool check( int i,int j ){
  switch( map[i][j] ){
  case '*': map[i][j]='.';
  case '#': return true;
  }
  return false;
}

void shot(int y,int x){
  //  cout << "shot " << y <<" , "<< x << " "<< dir << endl;
  switch( dir ){
  case 'u': for( int i=y-1;i>=0;i-- )  if( check(i,x) ) break;
    break;
  case 'd': for( int i=y+1;i<h;i++ ) if( check(i,x) ) break;
    break;
  case 'l': for( int i=x-1;i>=0;i-- ) if( check(y,i) ) break;
    break;
  case 'r': for( int i=x+1;i<w;i++ ) if( check(y,i) ) break;
    break;
  }
}

void show(int y,int x){
  char cmd;
  for( int i=0;i<h;i++ ){
    for( int j=0;j<w;j++ ){
      if( i==y && j== x){
	switch( dir ){
	case 'u': cmd='^'; break;
	case 'd': cmd='v'; break;
	case 'l': cmd='<'; break;
	case 'r': cmd='>'; break;
	}
      }else	cmd=map[i][j];
      cout << cmd;
    }
    cout << endl;
  }
}

int main(){
  int datasetN,n, x,y;
  char cmd;

  cin >> datasetN;
  while( datasetN-- ){
    cin >> h >> w;
    for( int i=0;i<h;i++ )
      for( int j=0;j<w;j++ ){
	cin >> map[i][j];
	switch( map[i][j] ){
	case '^': map[i][j]='.';y=i;x=j; dir='u'; break;
	case 'v': map[i][j]='.';y=i;x=j; dir='d'; break;
	case '<': map[i][j]='.';y=i;x=j; dir='l'; break;
	case '>': map[i][j]='.';y=i;x=j; dir='r'; break;
	}
      }

    cin >> n;
    for( int lp=0;lp<n;lp++ ){
      cin >> cmd;
      switch( cmd ){
      case 'U':	dir='u';if( y-1>=0 && map[y-1][x]=='.' ) y--;	break;
      case 'D':	dir='d';if( y+1<h  && map[y+1][x]=='.' ) y++;	break;
      case 'L': dir='l';if( x-1>=0 && map[y][x-1]=='.' ) x--;	break;
      case 'R':	dir='r';if( x+1<w  && map[y][x+1]=='.' ) x++;	break;
      case 'S':	shot(y,x);	break;
      }
      /*
      cout << "CMD = "<< cmd << endl;
      show(y,x);
      */
    }    
    show(y,x);
    if( datasetN>0 )
      cout << endl;
  }

  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFLL = LLONG_MAX / 3;
const double eps = (1e-9);

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

  string s, t;
  cin >> s >> t;

  map<char, char> mp1, mp2;

  rep(i, s.size()) {
    if (mp1[s[i]] == 0) {
      mp1[s[i]] = t[i];
    } else if (mp1[s[i]] != t[i]) {
      puts("No");
      return 0;
    }
    if (mp2[t[i]] == 0) {
      mp2[t[i]] = s[i];
    } else if (mp2[t[i]] != s[i]) {
      puts("No");
      return 0;
    }
  }

  puts("Yes");

  return 0;
}


Measured memory_bytes: 916
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<int> vi;
typedef vector<ll> vl;
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}
ll com(ll n,ll r){
    ll x=1,y=1;
    ll tmp=n;
    while(tmp>=n-r+1){
        x=x*tmp%mod;
        tmp--;
    }
    while(r>0){
        y=y*r%mod;
        r--;
    }
    return x*rep_jijo(y,mod-2)%mod;
}

int main (){
    ll k;
    cin >> k;
    ll ans=0;
    for(ll a=1;a<=k;a++){
        for(ll b=1;b<=k;b++){
            for(ll c=1;c<=k;c++){
                ll gd=gcd(a,gcd(b,c));
                ans+=gd;
            }
        }
    }
    cout << ans <<endl;
    return 0;
}


Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using pii = pair<int, int>;
#define FOR(i,a,b) for(int (i)=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)

int n, p;
int a[55];

ll dp[55][100 * 51];
ll f(int i, int s) {
    ll &r = dp[i][s];
    if (r != -1) return r;
    if (i >= n) return r = s % 2 == p;
    return r = f(i + 1, s) + f(i + 1, s + a[i]);
}

int main() {
    scanf("%d%d", &n, &p);
    rep(i, n) scanf("%d", &a[i]);
    memset(dp, -1, sizeof(dp));
    ll ans = f(0, 0);
    cout << ans << "\n";
    return 0;
}

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

using ll = long long;

int main() {
    int M;
    cin >> M;
    vector<ll> d(M), c(M);
    ll ans = 0;
    vector<ll> v(0);
    ll x[10] = {1, 9, 9, 3, 9, 9, 3, 9, 9, 1};
    ll y[10] = {1, 10, 11, 4, 13, 14, 5, 16, 17, 2};
    rep(i, M) {
        cin >> d[i] >> c[i];
        ll z = (c[i] - 1) / x[d[i]];
        ans += z * y[d[i]];
        rep(j, c[i] - z * x[d[i]]) v.push_back(d[i]);
    }
    //cout << ans << endl;
    //rep(i, v.size()) cout << v[i];
    //cout << endl;
    for (int i = v.size() - 1; i > 0; i--) {
        int j = v[i] + v[i - 1];
        if (j > 9) {
            ans++;
            j -= 9;
        }
        ans++;
        v[i - 1] = j;
    }
    cout << ans << endl;
}

Measured memory_bytes: 13548
// https://atcoder.jp/contests/abc139/submissions/7298310

#include <iostream>
#include <vector>

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

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int a[1010][1010] = {};
    int head[1010] = {};
    rep(i,n){
        rep(j,n-1){
            int x;
            cin >> x;
            x--;
            a[i][j] = x;
        }
    }
    register int turn = 0;
    int used[1010] = {};
    for (int &i : used) i = -1;
    while(true){
        bool ng = true;
        register int empty_cnt = 0;
        rep(i,n){
            if (head[i] == n-1) {
                empty_cnt++;
                continue;
            }
            int j = a[i][head[i]];
            if (used[i] == turn || used[j] == turn) continue;
            if (a[j][head[j]] == i) {
                head[i]++;
                head[j]++;
                used[i] = used[j] = turn;
                ng = false;
            }
        }
        if (empty_cnt == n) break;
        if (ng) {
            cout << -1 << endl;
            return 0;
        }
        turn++;
    }
    cout << turn << endl;

    return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<lint>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;
const long double EPS = 1e-2;

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

    vector<long double> b(n);
    rep(i, n) {
        b[i] = log10l(a[i]);
    }

    long double sum = 0;
    int l = 0, r = 0;
    long double prev = -1;

    while (r < n) {
        if (r < k) {
            sum += b[r];
            if (r == k-1) {
                prev = sum;
            }
            r++;
        }
        else {
            sum += b[r];
            sum -= b[l];
            if (prev < sum) cout << "Yes" << endl;
            else cout << "No" << endl;
            prev = sum;
            r++;
            l++;
        }
    }
    return 0;
}

Measured memory_bytes: 8072
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j>0:
        if (N*i*j/(4*i*j-N*i-N*j)).is_integer():
          print(i,j,int((N*i*j/(4*i*j-N*i-N*j))))
          exit()

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


ll vis[sz];



int main()
{

    ll n,i,j,k,a;

    ll b,c;
    k=0;

    for(i=1;i<=3;i++)
    {
        cin>>a;
        if(vis[a]==1)k++;
        else
        {
            vis[a]=1;
        }
    }

    if(k==1)cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;



    return 0;
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int n, m, l, t[10000], p, x, total=0;
  int i = 0;
  cin >> n;
  while (i < n) {
    cin >> l;
    t[i] = l;
    total += l;
    i++;
  }
  //cout << total << "\n";
  cin >> m;
  int ans[10000];
  for (int j = 0; j < m ; j++) {
    cin >> p >> x;
    ans[j] = (total + x - t[p-1]);
  }
  for (int j = 0; j < m; j++) {
    cout << ans[j] << "\n";
  }
}


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

using namespace std;

int main(){
    long long int N,a=0,b=0,ans=0;
    cin >> N;
    vector<long long int> sum(N);
    for(int i=0;i<N;i++){
        long long int a,b;
        cin >> a >> b;
        ans -= b;
        sum[i] = a+b;
    }

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

    for(int i=N-1;0<=i;i-=2){
        ans +=sum[i];
    }

    cout << ans << endl;
}

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

int deal(int x){
    int res=0;
    while(x){
        res++;
        x=x%__builtin_popcount(x);
    }
    return res;
}

int n,p1=-1,p2=1,x1,x2;
char s[200005];
int pw1[200005],pw2[200005];

int main(){

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

    cin>>n>>s+1;
    for(int i=1;i<=n;i++){
        p1+=s[i]=='1';
        p2+=s[i]=='1';
    }
    pw1[0]=pw2[0]=1;
    for(int i=1;i<=n;i++){
        if(p1)x1=(x1<<1|(s[i]=='1'))%p1;
        x2=(x2<<1|(s[i]=='1'))%p2;
        if(p1)pw1[i]=(pw1[i-1]<<1)%p1;
        pw2[i]=(pw2[i-1]<<1)%p2;
    }
    for(int i=1;i<=n;i++){
        if(s[i]=='1'){
            if(p1)cout<<deal((x1-pw1[n-i]+p1)%p1)+1<<endl;
            else cout<<0<<endl;
        }else{
            cout<<deal((x2+pw2[n-i]+p2)%p2)+1<<endl;
        }
    }

    return 0;
}

Measured memory_bytes: 5368
#include<stdio.h>
int main(){
    int a,b,c,d,e;
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    if(a<0){
        a=a*-1;
        a=a*c;
        a=a+d;
        a=a+b*e;
    }
    else if(a==0){
        a=a+d;
        a=a+b*e;
    }
    else{
        a=b-a;
        a=a*e;
    }
    printf("%d\n",a);
    return 0;
}


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

int main() {
  int n,k;
  string s;
  cin >> n >> s >> k;
  char a = s.at(k - 1);
  for(int i = 0; i < n; i++){
    if(s.at(i) != a){
      s.at(i) = '*';
    }
  }
  cout << s << endl;
}

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

using namespace std;

int V, E, r;
int S[500050],T[500050], D[500050];

int C[100010]; // 各頂点までの最短距離の上限
// 無限を表す定数を全頂点をたどる最大超に設定
const int Inf = 10000*100000+100;
//vector<pair<int, int>> w;

void bellman_ford(int V, int E, int D[], int r){
	
	for(int i = 0; i <= V; ++i){
		C[i] = Inf;
		C[r] = 0;
		//cout << C[i] << endl;
	}
	//cout << r << endl;
	//cout << C[0] << " " << C[1] << " "<< C[2] <<   endl;
	for (int t=0; t<V; ++t){
		bool update = false;
		for (int i=0; i<E; ++i){

			int s = S[i], t = T[i], d = D[i]; // i 番目の辺のs,t,d に対して
			//cout << C[s] << " " << C[t] << endl;
			if(C[s] < Inf && C[t] > C[s] + d){//s,tを緩和できるならば
				C[t] = C[s] + d; //C[t]を更新
				update = true;	
			} 
		}
		if (!update) break;
	}
	for (int t=0; t<V; ++t){
		if(C[t] != Inf){
			cout <<  C[t] << endl;
		}
		else{
			cout << "INF" << endl;
		}
	}	
}

int main(){
	cin >> V >> E >> r;
	for(int i = 0; i < E; ++i){
		cin >> S[i] >> T[i] >> D[i];
	}
	bellman_ford(V, E, D, r);
}


Measured memory_bytes: 9208
import kotlin.math.max
import kotlin.math.min

fun main(args: Array<String>) {
    val input = readLine()!!.toLong()

    var result = 0L
    for (a in 1..input) {
        for (b in 1..input) {
            for (c in 1..input) {
                result += gcd(a, b, c)
            }
        }
    }
    println(result)
}

fun gcd(a: Long, b: Long, c: Long): Long {
    val internalGcdResult = gcd(max(a, b), min(a, b))
    return gcd(max(internalGcdResult, c), min(internalGcdResult, c))
}

fun gcd(higher: Long, lower: Long): Long {
    if (lower == 0L) {
        return higher
    }

    return gcd(lower, higher % lower)
}

Measured memory_bytes: 35936
#include <cstring>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<ll, ll> ump;
typedef pair<ll, ll> P;

ump mp;

void solve() {
}

int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
    while (true) {
        mp = ump();
#pragma clang diagnostic pop
#endif
        ll n;
        cin >> n;
        vector<ll> t(n + 1), x(n + 1), y(n + 1);
        t[0] = x[0] = y[0] = 0;
        repone(i, n) cin >> t[i] >> x[i] >> y[i];
        repone(i, n) {
            if (t[i] - t[i - 1] - (abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1])) >= 0 &&
                (t[i] - t[i - 1] - (abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1]))) % 2 == 0) {

            } else {
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;

        solve();

#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 2560
#include "bits/stdc++.h"
using namespace std;

#define all(x)  x.begin(), x.end()
#define mp      make_pair
#define pii     pair<int, int>
#define pll     pair<long long, long long>
#define ll      long long

static const int INF = 0x3f3f3f3f;
#define int long long

signed main() {
        int n;
        cin >> n;
        vector<vector<int> > dist(n, vector<int> (n));
        for (int i = 0; i < n; i ++) {
                for (int j = 0; j < n; j ++) {
                        cin >> dist[i][j];
                }                         
        }
        vector<vector<int> > dist2 = dist;
        for (int k = 0; k < n; k ++) {
                for (int i = 0; i < n; i ++) {
                        for (int j = 0; j < n; j ++) {
                                dist2[i][j] = min(dist2[i][j], dist2[i][k] + dist2[k][j]);
                        }
                }
        }
        if (dist != dist2) {
                cout << -1 << endl;
                return 0;
        }
        int ans = 0;
        for (int i = 0; i < n; i ++) {
                for (int j = 0; j < n; j ++) {
                        ans += dist[i][j];
                }
        }
        //cout << ans << endl;
        for (int i = 0; i < n; i ++) {
                for (int j = 0; j < n; j ++) {
                        bool f = true;
                        for (int k = 0; k < n; k ++) {
                                if (dist[i][j] >= dist[i][k] + dist[k][j] && k != i && k != j) {
                                        f = false;
                                }
                        }
                        if (!f) ans -= dist[i][j];
                }
        }
        cout << ans / 2 << endl;
}


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

using namespace std;

typedef long long ll;

ll mod;

ll powimod(ll x,ll n,ll mod){
    ll res=1;
    while(n){
        if(n&1) res=(res*x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return res;
}

ll powi(ll x,ll n){
    ll res=1;
    while(n){
        if(n&1) res*=x;
        x*=x;
        n>>=1;
    }
    return res;
}

vector<int> z_function(string s) {
    int n = (int) s.length();
    vector<int> z(n);
    for (int i = 1, l = 0, r = 0; i < n; ++i) {
        if (i <= r)
            z[i] = min (r - i + 1, z[i - l]);
        while (i + z[i] < n && s[z[i]] == s[i + z[i]])
            ++z[i];
        if (i + z[i] - 1 > r)
            l = i, r = i + z[i] - 1;
    }
    return z;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
    int in;
    cin>>in;
    if(i&1&&in&1) ans++;
    }
    cout<<ans;
}


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

int main() {
    int H, N;
    cin >> H >> N;
    vector<int> A(N);
    rep(i, N){
        cin >> A.at(i);
    }
    int sum = accumulate(A.begin(), A.end(), 0);
    if(sum >= H) cout << "Yes" << endl;
    if(sum < H) cout << "No" << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
const int MOD = 1e9 + 7;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
typedef long long ll;
using namespace std;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	int ans = 0;
	for(int i = 0; i < s.size(); i++)
	{
		if(s[i] == 'o')
			ans += 100;
	}
	cout << 700 + ans << endl;
	return 0;
}

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

#define rep(i,n) for(int i=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int i=(m);(i)<(n);(i)++)
#define ll long long
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

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

    int n,k,ans=0;

    cin >> n >> k;

    if(n%k){
        ans = 1;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
// #include <bits/stdc++.h>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<string>
#include<tuple>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define pt pop_front
#define pk pop_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
long a,b;
inline void solve(void){
  in(a,b);
  if(a*b==15)out("*");
  else if(a+b==15)out("+");
  else out("x");
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	string s; cin>>s;
	bool ac=false;
	For(i,0,2) if(s[i]==s[i+1]) ac=true;
	if(ac) cout<<"Bad\n";
	else cout<<"Good\n";
	return 0;
}















Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
// #define ll int128_t
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define f(i,j,l) for(i=j;i<l;i++)
#define smax(a,b) a=max(a,b)
// #if !defined(ONLINE_JUDGE)
// #include "debugging.h"
// #endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
// erase,insert same as normal set

// int const mod = 7340033;
int const mod = 998244353;
int power(int a,int b,int m){
    int res = 1;
    while(b){
        if(b&1){
            res = res*a;
            res %= m;
        }
        a=a*a;
        a%=m;
        b=b/2;
    }
    return res;
}

int inverse(int x){
    return power(x,mod-2,mod);
}

int const N = 2e5+555;
int const inf = 2e16;



void solve(){  
    int i,j,l;
    int a,v,b,w,t;
    cin >>a>>v>>b>>w>>t;

    if(a < b){
        int na = a + v*t;
        int nb = b + w*t;
        if(na >= nb){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
    else{
        int na = a - v*t;
        int nb = b - w*t;
        if(na <= nb) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}           


int32_t main(){
    IOS;
    int t;
    t = 1;
    // precompute();
    // cin>>t;
    for(int tt=1;tt<=t;tt++){
        solve();
    }
    return 0;
}


/*



*/

Measured memory_bytes: 3688
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (ll i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }

int main(){
    ll X, K, D;
    ll x, cnt;
    cin >> X >> K >> D;
    X = abs(X);
    if(X/D>K){
        cout << X-K*D << endl;
        return 0;
    }
    else{
        cnt = X/D;
        x = X-(cnt+1)*D;
    }
    if((K-cnt+1)%2) cout << abs(x+D) << endl;
    else cout << abs(x) << endl;
    return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<string> keihin(n);
  for (int i = 0; i < n; i++) cin >> keihin.at(i);
  sort(keihin.begin(), keihin.end());
  
  int ans = 1;
  for (int i = 0; i < n - 1; i++) {
    if (keihin.at(i + 1) != keihin.at(i)) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 9596
import java.io.*;
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        while (t --> 0) solver.solve(1, scan, out);
        out.close();
    }
 
    static class Task {
 
        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            int a = scan.nextInt(), b = scan.nextInt();
            System.out.println(a/b + Math.min(1, a%b));
        }
    }
 
    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
 
    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
 
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
 
}

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

import itertools

abcdek = [int(input()) for _ in range(6)]


for i, j in itertools.combinations(range(5), 2):
    num1, num2 = abcdek[i], abcdek[j]
    if num2-num1 > abcdek[-1]:
        print(":(")
        exit()


print("Yay!")


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan= new Scanner(System.in);
        int n= scan.nextInt();
        String s=Integer.toString(n);
        for(int i=0;i<s.length();i++){
            if(s.charAt(i)=='7'){
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 35776
M, D = map(int, input().split())

ans = 0
for m in range(2, M+1):
    for dd in range(11, D + 1):
        d1, d2 = map(int, str(dd))
        ans += d1 > 1 and d2 > 1 and d1 * d2 == m

print(ans)


Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC_20180929
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = int.Parse(Console.ReadLine());
            var x1 = s % 10;
            var x2 = (s / 10) % 10;
            var x3 = (s / 10) / 10;

            var result = 0;

            if(x1 == 1)
            {
                result = 9;
            }
            else
            {
                result = 1;
            }
            if(x2 == 1)
            {
                result += 90;
            }
            else
            {
                result += 10;
            }
            if(x3 == 1)
            {
                result += 900;
            }
            else
            {
                result += 100;
            }



            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 13140