akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner scan = new Scanner(System.in);

		int c=0;
		while(true){
			int a = scan.nextInt();
			int b = scan.nextInt();

			if(a==0 && b==0)
				break;

			if(c!=0)
				System.out.println();
			boolean f = false;
			for(int i=a; i<=b;i++){
				if(i%4==0 && ( i%100!=0  || (i%100==0 && i%400==0) ) ){
					System.out.println(i);
					f=true;
				}
			}
			if(!f)
				System.out.println("NA");

			c++;
		}
	}

}

Measured memory_bytes: 12000
#include <iostream>

using namespace std;

int main() {
    int a,b;
    char op;
   
    while(1){ 
        cin>>a>>op>>b;
    if(op == '?')break;
    if(op == '+'){
        cout<<a+b<<endl;}
    else if(op == '-'){
        cout<<a-b<<endl;}
    else if(op == '*'){
        cout<<a*b<<endl;}
    else if(op == '/'){
        cout<<a/b<<endl;}

    }
    return 0;}

Measured memory_bytes: 3080
import java.io.*;
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();
		int d = saori.saori_hayami();
		int n = saori.saori_hayami();
		int num = 0;
		if(d == 0){
			if(n == 100){
				System.out.println(101);
			} else {
				System.out.println(n);
			}
			
		} else if(d == 1){
			if(n == 100){
				System.out.println(100*101);
			} else {
				System.out.println(100*n);
			}
			
		} else {
			if(n == 100){
				System.out.println(10000*101);
			} else {
				System.out.println(10000*n);
			}
			
		}


		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: 32308
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  
         long long int n,k,i=0,a,b,c,d=0;
                cin>>a>>b>>c>>k;
                if(a>=b)
                {
                        while(b<=a)
                        {
                                b=b*2;
                                i++;
                                   if(i>k)
                                   {
                                  cout<<"No";
                                           d=1;
                                           break;
                                   }
                        }
                }
     
               //  cout<<i<<endl;
                if(b>=c&&d==0)
                {
                        while(b>=c)
                        {
                                c=c*2;
                                i++;
                               // cout<<i<<c;
                                if(i>k)
                                {
                                        cout<<"No";
                                        d=1;
                                        break;
                                }
                        }
                }
        if(d==0)
                cout<<"Yes";
   return 0;    
}

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

template<typename T>
ostream& operator<<(ostream &os, vector<T> &v){
	string sep = " ";
	if(v.size()) os << v[0];
	for(int i=1; i<v.size(); i++) os << sep << v[i];
	return os;
}

template<typename T>
istream& operator>>(istream &is, vector<T> &v){
	for(int i=0; i<v.size(); i++) is >> v[i];
	return is;
}

#ifdef DBG
void debug_(){ cout << endl; }
template<typename T, typename... Args>
void debug_(T&& x, Args&&... xs){
	cout << x << " "; debug_(forward<Args>(xs)...);
}
#define dbg(...) debug_(__VA_ARGS__)
#else
#define dbg(...)
#endif

int main() {
	ios_base::sync_with_stdio(false);
	cout << setprecision(20) << fixed;

	int n; cin >> n;
	vector<ll> a(n); cin >> a;
#ifdef DBG
	n = 200000;
	a = vector<ll>(n, 1);
#endif

	sort(a.rbegin(), a.rend());

	ll ans = 0;
	vector<ll> x(1, a[0]), y;
	for(int i=1; i<n; i++){
		int k=y.size();
		ans += min(x[k], x[(k+1)%x.size()]);
		y.push_back(a[i]);
		if(x.size()==y.size()){
			vector<ll> z;
			for(int i=0; i<x.size(); i++){
				z.push_back(x[i]);
				z.push_back(y[i]);
			}
			x=z;
			y.clear();
		}
	}

	cout << ans << endl;


	return 0;
}


Measured memory_bytes: 8920
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define gcd __gcd
#define F first
#define B begin()
#define E end()
#define ln length()
#define sz size()
#define S second
#define em empty()
#define mp make_pair
#define pb push_back
#define pq priority_queue
#define um unordered_map
#define us unordered_set
#define lb lower_bound
#define ub upper_bound
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
#define sbits(a) __builtin_popcount(a)
#define lcm(a, b) ((a * b) / gcd(a, b))
#define nani(x) cerr << #x << " is " << x << endl;
#define adde(g, u, v) g[u].pb(v), g[v].pb(u);
#define addew(g, u, v, w) g[u].pb({ v, w }), g[v].pb({ u, w });
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 10000000000
#define mod 1000000007

typedef long long ll;

const int N = 1e5 + 5;

int A[N];

int main()
{
    fast;

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n;
    cin >> n;

    string s;
    cin >> s;

    if (n & 1) {
        cout << "No";
    } else {
        if (s.substr(0, n >> 1) == s.substr(n >> 1, n >> 1))
            cout << "Yes";
        else
            cout << "No";
    }
    return 0;
}


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

std::vector<int> vs;

int main(){
  int N;
  scanf("%d",&N);
  if(N==3){
    printf("2 5 63\n");
    return 0;
  }
  int zero=0;
  while(N>=8){
    vs.push_back(zero+2);
    vs.push_back(zero+3);
    vs.push_back(zero+4);
    vs.push_back(zero+6);
    vs.push_back(zero+8);
    vs.push_back(zero+9);
    vs.push_back(zero+10);
    vs.push_back(zero+12);
    N-=8;
    zero+=12;
  }
  if(N%2){
    vs.push_back(zero+6);
    N--;
  }
  switch(N){
  case 6:vs.push_back(zero+4);vs.push_back(zero+8);
  case 4:vs.push_back(zero+3);vs.push_back(zero+9);
  case 2:vs.push_back(zero+2);vs.push_back(zero+10);
  }
  for(int i=0;i<vs.size();i++){
    if(i>0) printf(" ");
    printf("%d",vs[i]);
  }
  printf("\n");
  return 0;
}


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

using namespace std;

int main() {
	int arr[5], k;
	string s = "Yay!";
	
	for (int i = 0; i < 5; i++) cin >> arr[i];
	cin >> k;
	
	if (arr[4] - arr[0] > k) s = ":(";
	cout << s;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define ll long long
#define INF 100000000000000000
#define MAX 100010
using namespace std;

struct Edge {
    int from, to;
    ll cost;
    Edge(int s, int t, ll c) : from(s), to(t), cost(c) {}
};

vector<ll> dist;

bool bellman_ford(vector<Edge> &g, int n, int s) {  // nは頂点数、sは開始頂点
    dist = vector<ll>(n, INF);                      // distをINFで初期化
    dist[s] = 0;
    for (int i = 0; i <= n; i++) {
        for (auto &e : g) {
            if (dist[e.from] == INF) continue;
            if (dist[e.from] + e.cost < dist[e.to]) {
                dist[e.to] = dist[e.from] + e.cost;
                if (i == n) return true;
            }
        }
    }
    return false;
}

int main() {
    int v, e, r, s, t;
    ll d;
    vector<Edge> g;
    cin >> v >> e >> r;
    for (int i = 0; i < e; i++) {
        cin >> s >> t >> d;
        g.push_back(Edge(s, t, d));
    }
    bool check = bellman_ford(g, v, r);
    if (check) {
        cout << "NEGATIVE CYCLE" << endl;
    } else {
        for (int i = 0; i < v; i++) {
            if (dist[i] == INF)
                cout << "INF" << endl;
            else
                cout << dist[i] << endl;
        }
    }
    return 0;
}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	// cout<<setprecision(10)<<fixed;
	int a, b, c;
	cin>>a>>b>>c;
	cout<<(a==b && b==c ? "Yes" : "No")<<'\n';
	return 0;
}


Measured memory_bytes: 256
import java.io.PrintWriter

fun main(args: Array<String>) {
    PrintWriter(System.out).use { out ->
        solve(out)
        out.flush()
    }
}

fun solve(out: PrintWriter) {
    val a = readStringList()
    println("${a[0][0].toUpperCase()}${a[1][0].toUpperCase()}${a[2][0].toUpperCase()}")
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
fun readDoubleList() = readStringList().map(String::toDouble)


Measured memory_bytes: 37744
#include<iostream>
#include<cmath>
#include<algorithm>
#include<map>
#include<cassert>
#include<vector>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS (1e-10) 
using namespace std;
bool used[1000][80];
int dx[] = {-1,+0,+1,+1,+1,+0,-1,-1};
int dy[] = {+1,+1,+1,+0,-1,-1,-1,+0};

class Point
{
 public:

 double x,y;

 Point(double x = -1,double y = -1): x(x),y(y){}

 Point operator + (Point p ){return Point(x+p.x,y+p.y);}
 Point operator - (Point p){return Point(x-p.x,y-p.y);}
 Point operator * (double a){return Point(a*x,a*y);}
 Point operator / (double a){return Point(x/a,y/a);}//※イケメンに限る

 bool operator < (const Point& p) const
 {
   return y != p.y?y<p.y:x<p.x;
 }

 bool operator == (const Point& p)const
 {
   return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
 }
};

struct Segment
{
 Point p1,p2;
 Segment(Point p1 = Point(-1,-1),Point p2 = Point(-1,-1)):p1(p1),p2(p2){}
};

typedef Point Vector;
typedef Segment Line;
typedef vector<Point> Polygon;

double dot(Point a,Point b)
{
 return a.x*b.x + a.y*b.y;
}


double cross(Point a,Point b)
{
 return a.x*b.y - a.y*b.x;
}

double norm(Point a)
{
 return a.x*a.x+a.y*a.y;
}

void dfs(int x,int y,vector<Point> &vec,vector<string> &G,int H)
{
  if(used[y][x])return;
  used[y][x] = true;
  vec.push_back(Point(x,y));

  rep(i,8)
    {
      int nx = x + dx[i];
      int ny = y + dy[i];
      if(!(0 <= ny && ny < H && 0 <= nx && nx < G[ny].size()))continue;
      if(G[ny][nx] == '*' && !used[ny][nx])
	{
	  dfs(nx,ny,vec,G,H);
	  return;
	}
    }

}

int calc(vector<Point> &vec)
{
  int res = 0;
  //cout << "vec[] = " << vec.size() << endl;
  rep(i,vec.size())
    {
      int j,cnt = 0;
      for(j=i;j<vec.size() && vec[j].y == vec[i].y;j++,cnt++);
      assert(cnt >= 2);
      if(cnt == 2)
	res += vec[i+1].x-vec[i].x+1;
      else 
	res += cnt;
      i = j-1;
    }
  return res;
}

int main()
{
  int n;
  bool f = true;
  while(cin >> n,n)
    {
      cin.ignore(); 
      vector<string> G(n);
      string input;
      rep(i,n)
	{
	  getline(cin,input);
	  G[i] = input;
	}

      rep(i,n)rep(j,G[i].size())used[i][j] = false;

      map<int,int> ans;

      rep(i,n)
	{
	  rep(j,G[i].size())
	    {
	      if(G[i][j] != '*')continue;
	      if(used[i][j])continue;
	      vector<Point> vec;
	      dfs(j,i,vec,G,n);
	      /*
 rep(k,vec.size())
		cout << vec[k].x << "," << vec[k].y << endl;
	      cout << endl;
	      */
sort(vec.begin(),vec.end());

	      
	      int area = calc(vec);
	      ans[area]++;
	    }
	}

      if(f)f = false;
      else cout << "----------" <<endl;

      for(map<int,int>::iterator it = ans.begin();it != ans.end();it++)
	cout << it->first << " " << it->second << endl;

    }
  return 0;
}

Measured memory_bytes: 1304
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<utility>
using namespace std;
 
typedef long long ll;
 
int main(){
  string s, sentou, matsubi;
  ll q;
  char c;
  cin >> s >> q;
  
  int t,f;
  ll rev=0;
  
  for(ll i=0; i<q ; i++){
  	cin >> t;
    if(t ==1){
    	rev++;
        continue;
    }else{
        cin >> f >> c;
        if( (rev%2==0 && f==1) || (rev%2==1&& f==2 )){
        	sentou=c+sentou;
        }else{
        	matsubi=matsubi+c;
        }
    }
  }
  s= sentou + s;
  s= s + matsubi;
  if(rev%2 ==1){
  	std::reverse(s.begin(),s.end());
  }
  cout << s << endl;
}


Measured memory_bytes: 1392
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pf push_front
#define mod 1000000007
#define endl '\n'
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);


int main()
{
      ll n,i,j;
      cin>>n;

      ll arr[n];
      for(i=0;i<n;i++)
      {
          cin>>arr[i];
      }
      ll mn=INT_MAX, ans=0;

      for(i=0;i<=100;i++)
      {
          ans=0;
          for(j=0;j<n;j++)
          {
              ans+=(arr[j]-i)*(arr[j]-i);
          }
          mn = min(ans,mn);
      }


      cout<<mn<<endl;
}


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

int main() {
    int N, M;
    int c1, c2;
    cin >> N >> M;
    int count[N];
    for(int i = 0; i < N; i++) count[i] = 0;
    for(int i = 0; i < M; i++) {
        cin >> c1 >> c2;
        count[c1-1]++;
        count[c2-1]++;
    }
    for(int i = 0; i < N; i++) {
        cout << count[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from math import gcd
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7


s=S()
if s[-1]=="s":
    s+="es"
else:
    s+="s"
print(s)

Measured memory_bytes: 76584
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        int[] abc=cin.ArrayInt(3,0);
        if(abc[0]+abc[1]<abc[2])Console.WriteLine("No");
        else Console.WriteLine("Yes");
        
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
    public void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}


Measured memory_bytes: 13140
import sys
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
s = readline().rstrip().decode('utf-8')
n = len(s)
for i in range(n):
    if s[i] == "A":
        start = i
        break

for i in range(n-1,-1,-1):
    if s[i] == "Z":
        end = i
        break

print(end-start+1)

Measured memory_bytes: 41584
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

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

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] >= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) right = mid;
		else left = mid;
	}
	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
long long int big[60][2] = {};

int main() {
	string n;
	cin >> n;
	if (n[0] == '7' || n[1] == '7' || n[2] == '7') {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}

Measured memory_bytes: 3600
// E - Sum Equals Xor
#include <bits/stdc++.h>

using namespace std;

#define	MOD	1000000007

int main(int argc, char *argv[])
{
	string s;
	cin >> s;
	int n = s.size();
	long long x = 1, y = 0;
	for (int i = 0; i < n; i++)
		if (s[i] == '0') y = (y * 3) % MOD;
		else y = (x + y + y * 2) % MOD, x = 2 * x % MOD;
	cout << ((x + y) % MOD) << endl;

	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(void){
    long long h,n,a[100001];
    cin >> h >> n;
    rep (i,n){
        cin >> a[i];
        h -= a[i];
    }
    if (h>0){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);
#define ppp(a) (cout << (a) << endl); 
#define cop(a) for(auto x:(a)){cout << x << endl;}


using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powmod(ll b, ll e){ll r=1;while(e>0){if(e&1)r=(r%MOD)*(b%MOD)%MOD;b=(b%MOD)*(b%MOD)%MOD;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

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; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    s << '[';
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len-1) s << ", ";
    }
    s << ']';
    return s;
}

struct aaa{
    aaa(){
        // comment this out when you use scanf or printf
        // cin.tie(0); ios::sync_with_stdio(0);
        cout<<fixed<<setprecision(15);
    };
}fastio;

int main(){

    
    int n;
    scanf("%d", &n);    
    ll x = 0;
    ll y = LINF;
    rep(i, n){
        ll a, b;
        scanf("%lld%lld" , &a, &b);
        x += a;
        if(a > b) chmin(y, b);
    }
    ppp(max(0LL, x-y));
    return 0;
}


Measured memory_bytes: 384
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection.Metadata.Ecma335;
using System.Numerics;

namespace AtCoder
{
    class Program
    {

        const int BiggestMod = 1000000007;
        public static void Main()
        {

            var numSoltion = int.Parse(Console.ReadLine());
            var ans = new long[numSoltion];

            for (int quest = 0; quest < numSoltion; quest++)
            {

                var args = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
                
                var num = args[0];
                var A = args[1];
                var B = args[2];
                var C = args[3];
                var D = args[4];
                var memo = new Dictionary<long, long>();

                ans[quest] = Solve(num);

                long Solve(long num)
                {

                    if (num == 1) return D;
                    else if (num == 0) return 0;
                    else if (memo.ContainsKey(num)) return memo[num];
                    else
                    {

                        long
                            Ard = (num >> 1) << 1,
                            Aru = ((num + 1) >> 1) << 1,
                            Brd = (num / 3) * 3,
                            Bru = ((num + 2) / 3) * 3,
                            Crd = (num / 5) * 5,
                            Cru = ((num + 4) / 5) * 5,
                            minimum = long.MaxValue,
                            buf;

                        if (num < minimum / D) minimum = num * D;

                        buf = Math.Abs(Ard - num) * D + A + Solve(Ard / 2);
                        if (buf < minimum) minimum = buf;
                        
                        buf = Math.Abs(Aru - num) * D + A + Solve(Aru / 2);
                        if (buf < minimum) minimum = buf;

                        buf = Math.Abs(Brd - num) * D + B + Solve(Brd / 3);
                        if (buf < minimum) minimum = buf;
                        
                        buf = Math.Abs(Bru - num) * D + B + Solve(Bru / 3);
                        if (buf < minimum) minimum = buf;

                        buf = Math.Abs(Crd - num) * D + C + Solve(Crd / 5);
                        if (buf < minimum) minimum = buf;
                        
                        buf = Math.Abs(Cru - num) * D + C + Solve(Cru / 5);
                        if (buf < minimum) minimum = buf;

                        memo.Add(num, minimum);

                        return minimum;

                    }
                }

            }

            foreach (var data in ans)
                Console.WriteLine(data);
        }

    }

}


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

namespace MSFJ2019B
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var dX = N / 1.08;
            var X = (int) dX;
            var Xp1 = X + 1;

            if ((int)(X*1.08) == N)
            {
                Console.WriteLine(X);
            }
            else if ((int)(Xp1*1.08) == N)
            {
                Console.WriteLine(Xp1);
            }
            else
            {
                Console.WriteLine(":(");
            }

            Console.ReadLine();
        }
    }
}


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

int maxi(int *a,int *b,int *c,int n)
   {
       int res[n][3];
       res[n-1][0]=a[n-1];
       res[n-1][1]=b[n-1];
       res[n-1][2]=c[n-1];
       for(int i=(n-2);i>=0;i--)
        {
            res[i][0]=a[i]+max(res[i+1][1],res[i+1][2]);
            res[i][1]=b[i]+max(res[i+1][0],res[i+1][2]);
            res[i][2]=c[i]+max(res[i+1][0],res[i+1][1]);
        }
       return max(res[0][0],max(res[0][1],res[0][2]));    
   }

int main() {
	// your code goes here
	int n;
	cin>>n;
	int a[n],b[n],c[n];
	for(int i=0;i<n;i++)
	   {
	       cin>>a[i];
	       cin>>b[i];
	       cin>>c[i];
	   } 
	cout<<maxi(a,b,c,n);   
	return 0;
}


Measured memory_bytes: 2560
N,C,K=map(int,input().split())
T=sorted([int(input()) for _ in range(N)])
l,r,ans=0,0,0
while l<N:
    while r<N and r-l+1<=C and T[r] <= T[l]+K:
        r+=1
    ans+=1
    l=r
print(ans)

Measured memory_bytes: 51288
/*
    Author - Param Kothari
    Ah shit, here we go again
*/

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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair

typedef long long ll;
typedef long double ld;

void solve(){
    int n;
    cin >> n;
    ll dp[n + 1][3] = {0};
    vector<vector<int>> v;
    for(int i = 0; i < n; i++){
        vector<int> tmp(3);
        cin >> tmp[0] >> tmp[1] >> tmp[2];
        v.pb(tmp);
    }
    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];
    for(int i = 1; i < n; i++){
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                if(k != j){
                    dp[i][j] = max(dp[i][j], dp[i - 1][k] + v[i][j]);
                }
            }
        }
    }
    cout << max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]});
    return;
}

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

Measured memory_bytes: 9140
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int main() {
	int k, s; cin >> k >> s;
	int out = 0;
	for (int i = 0; i <= k; i++) {
		for (int j = 0; j <= k; j++) {
			if (s <= k + i + j && i + j <= s)out++;
		}
	}
	cout << out << endl;
    return 0;
}

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

using namespace std;

const long long MOD = 1000000007;

void Main() {
    long long m, n;
    cin >> m >> n;

    bitset<35> bit(n);
    long long pow = m;
    long long ans = 1;
    for (int i = 0; i < 35; ++i) {
        if (bit[i]) {
            ans *= pow;
            ans %= MOD;
        }
        pow *= pow;
        pow %= MOD;
    }
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}



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

int main() {
  int n;
  cin >> n;
  int ans = 0;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int j = 0;
  while(true){
    if(j >= n) break;
    if(a[j] == j+1){
      ans++;
      if(a[j +1] == j+2) j += 2;
      else j++;
    }else {
      j++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}	
int a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
signed main(){
	ic(n)
	c(a[n-1])
}
		




Measured memory_bytes: 256
#include <algorithm>
//#include <cstdio>
//#include <functional>
//#include <bits/stdc++.h>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
//#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
#include <string>
//#include <time.h>
#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
#define rt0 return 0
using namespace std;
 
int main()
{
	int a,b,x;

	cin>>a>>b>>x;

	if(x>=a && x<=(a+b))	cout<<"YES";
	else cout<<"NO"; 
		

    rt0;
}


Measured memory_bytes: 256
import java.util.*;

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

        long N = sc.nextLong();
        sc.close();
        
        long count = 0;
        
        if(N % 11 == 0)
            count = N/11 * 2;
        else if(N % 11 <= 6)
            count = N/11 *2 +1;
        else
            count = N/11 *2 + 2;
        
        System.out.println(count);
    }
}

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

int main()
{
  int N;
  int X = 0;
  cin >> N;
  
  for (int i; i < N; i++)
  {
    int l, r;
    cin >> l >> r;
    
    X += r - l + 1;
  }
  cout << X << endl;
}


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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 30)
#define MOD 1000000007
//int dy[4] = {-1,0,0,1};
//int dx[4] = {0,1,-1,0};


int main(){
  
  ll n,k;
  cin >> n >> k;
  ll a = abs(n-((n+k-1)/k)*k),b = abs(n-(n/k)*k);
  cout << min(a,b) << endl;






  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
constexpr int INF = 1e9;

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main() {
  int h, w, k, x1, y1, x2, y2;
  cin >> h >> w >> k >> y1 >> x1 >> y2 >> x2;
  x1--, y1--, x2--, y2--;
  vector<string> c(h);
  for (auto& e : c) cin >> e;

  struct state {
    int y, x, d, k, cost;
  };
  auto compare = [](state a, state b) { return a.cost > b.cost; };

  vector<vector<vector<state>>> r(h, vector<vector<state>>(w, vector<state>(4, {0, 0, -1, 0, INF})));
  r[y1][x1][0] = {y1, x1, -1, 0, 0};
  priority_queue<state, vector<state>, decltype(compare)> q(compare);
  q.push(r[y1][x1][0]);
  while (!q.empty()) {
    auto e = q.top();
    q.pop();
    for (int i = 0; i < 4; i++) {
      auto e2 = e;
      e2.y += dy[i];
      e2.x += dx[i];
      if (unsigned(e2.y) >= h || unsigned(e2.x) >= w) continue;
      if (c[e2.y][e2.x] == '@') continue;

      if (e.d == i && e.k < k) {
        e2.k++;
      } else {
        e2.d = i;
        e2.k = 1;
        e2.cost++;
      }

      if (e2.cost < r[e2.y][e2.x][e2.d].cost || (e2.cost == r[e2.y][e2.x][e2.d].cost && e2.k < r[e2.y][e2.x][e2.d].k)) {
        r[e2.y][e2.x][e2.d] = e2;
        q.push(e2);
      }
    }
  }
  int rmin = INF;
  for (int i = 0; i < 4; i++) rmin = min(rmin, r[y2][x2][i].cost);
  cout << (rmin == INF ? -1 : rmin) << endl;
}


Measured memory_bytes: 238608
W, H, N = map(int, input().split(' '))
table = [[0 for i in range(W)] for i in range(H)]

for i in range(N):
    x, y, a = map(int, input().split(' '))
    srange = range(W)
    trange = range(H)
    if a==1:
        srange = range(x)
    if a==2:
        srange = range(x, W)
    if a==3:
        trange = range(y)
    if a==4:
        trange = range(y, H)
    for t in trange:
        for s in srange:
            table[t][s] = 1

area = 0
for i in table:
    area += i.count(0)
print(area)


Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> S(N), T(M);
  rep(i, N) cin >> S[i];
  rep(i, M) cin >> T[i];
  vector<vector<ll> > sum(N+1, vector<ll>(M+1));
  vector<vector<ll> > dp(N+1, vector<ll>(M+1));
  dp[0][0] = 1;
  rep(i, N+1) {
    rep(j, M+1) {
      if(i != 0 && j != 0 && S[i-1] == T[j-1])
	(dp[i][j] += sum[i-1][j-1]) %= mod;
      (sum[i][j] += dp[i][j]) %= mod;
      if(j != 0)
	(sum[i][j] += sum[i][j-1]) %= mod;
    }
    if(i != 0)
      rep(j, M+1)
	(sum[i][j] += sum[i-1][j]) %= mod;
  }
  cout << sum[N][M] << endl;
  return 0;
}


Measured memory_bytes: 62976
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
if N == 1:
	print("Hello World")
	exit()

A = INT()
B = INT()
print(A+B)

Measured memory_bytes: 5144
### constant

S_LOGIN =  1
S_LOGOUT = 0

### main

loop do
  n, m = gets.split.map(&:to_i)
  break if (n | m) == 0

  r = gets.to_i

  sts = m.times.map{[]}
  stpcs = m.times.map{0}

  r.times do
    t, pn, sm, s = gets.split.map(&:to_i)
    pn -= 1
    sm -= 1

    if s == S_LOGIN
      sts[sm] << [t, S_LOGIN] if stpcs[sm] == 0
      stpcs[sm] += 1
    else
      stpcs[sm] -= 1
      sts[sm] << [t, S_LOGOUT] if stpcs[sm] == 0
    end
  end
  #p sts
  #p stpcs

  q = gets.to_i

  q.times do
    ts, te, sm = gets.split.map(&:to_i)
    sm -= 1
    #p [ts, te, sm]

    total = 0
    t_in = nil

    sts[sm].each do |t, s|
      if s == S_LOGIN
        t_in = t
      else
        ts0 = (t_in > ts) ? t_in : ts
        te0 = (t < te) ? t : te
        total += te0 - ts0 if ts0 <= te0
        t_in = nil
      end
    end

    puts total
  end
end

Measured memory_bytes: 8760
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int[] abcd = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        int a, b, c, d;
        a = abcd[0];
        b = abcd[1];
        c = abcd[2];
        d = abcd[3];
        while (0 < a)
        {
            c -= b;
            if (c <= 0)
            {
                Console.WriteLine("Yes");
                return;
            }
            a -= d;
        }
        Console.WriteLine("No");
    }
}

Measured memory_bytes: 28100
/*
 * 10進数問題
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1180&lang=jp
 */
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#include<sstream>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define ALL(c) (c).begin(), (c).end()
#define dump(a) cerr << #a << "=" << (a) << endl
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> void chmin(T &t, T f) { if (t > f) t = f; } //t=min
template<class T> void chmax(T &t, T f) { if (t < f) t = f; } //t=max
using namespace std;

int main() {
	int num,L;
	stringstream ss;
	vector<int> nums;
	int max_num;
	int min_num;
	int find_i;
	int find_j;

	while(cin >> num >> L) {
		if(num==0 && L==0) break; 

		ss.str("");
		ss.clear();
		nums.clear();
		max_num=0;
		min_num=INT_MAX;
		find_i = -1;
		find_j = -1;

		while(true) {
			max_num=0;
			min_num=INT_MAX;
			find_i = -1;
			rep(j,nums.size()) {
				if (nums[j] == num) {
					find_i = nums.size(); //次にpushされるnumの要素
					find_j = j;
				}
			}
			if (find_i == -1) { //見つからないとき
				ss << num;
				string num_str = ss.str();
				nums.push_back(num);

				if (num_str.size() != L) {
					int diff_L = L - num_str.size();
					string diff_zero(diff_L,'0');
					num_str = diff_zero + num_str;
				}
				sort(ALL(num_str));
				int num_tmp=0;
				do {
					num_tmp = stoi(num_str);
					chmax(max_num,num_tmp);
					chmin(min_num,num_tmp);
				} while(next_permutation(ALL(num_str)) );
				num = max_num - min_num;
				ss.str("");
				ss.clear();
			}
			else {
				cout << find_j << " " << num << " " << find_i-find_j << endl;
				break;
			}
		}

	}

	return 0;
}

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n,m;cin>>n>>m;
  vector<int> h(n);
  int i,j;
  rep(i,n)cin>>h[i];
  vector<int> a(m);
  vector<int> b(m);
  rep(i,m)cin>>a[i]>>b[i];
  rep(i,m)
  {
    a[i]--;
    b[i]--;
  }
  vector<vector<int>> to(n);
  rep(i,m)
  {
    to[a[i]].emplace_back(b[i]);
    to[b[i]].emplace_back(a[i]);
  }
  int ans=0;
  rep(i,n)
  {
    bool ok=true;
    rep(j,to[i].size())
    {
      if(h[i]<=h[to[i][j]])ok=false;
    }
    if(ok)ans++;
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 9592
#include <stdio.h>
 
int main(void){
       int a,i=1;
       while(1){
       scanf("%d",&a);
          if (a == 0){
            break;
          }else{
         printf("Case %d: %d\n" ,i,a);
          i++;
             }
          }
         
         return 0;
          }

Measured memory_bytes: 600
N=int(input())
ar=[9**i for i in range(1,6)]
for i in range(1,7):ar.append(6**i)
ar.append(1)
ar.sort()
inf=10**5
DP=[inf for _ in range(N+1)]
DP[0]=0
for i in range(len(ar)):
    for j in range(ar[i],N+1):
        DP[j]=min(DP[j],DP[j-ar[i]]+1)
print(DP[N])

Measured memory_bytes: 7064
n = gets.to_i
s = n.times.map{gets.chomp}
m = gets.to_i
t = m.times.map{gets.chomp}

h = {}
s.each do |k|
  if h[k].nil?
    h[k] = 1
    next
  end
  h[k] += 1
end
t.each do |k|
  h[k] -= 1 unless  h[k].nil?
end
ans = h.max {|a, b| a[1] <=> b[1] }
puts ans[1] < 0 ? 0 : ans[1]

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x,y;
    cin >> x >> y;
    f(i,0,101){
        f(j,0,101){
            if(i + j == x){
                if(i*2 + j*4 ==y){
                    cout << "Yes\n";
                    return 0;
                }
            }
        }
    }
    cout << "No\n";
    return 0;
}
 


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> L;
  int l;
  REP(i,n){
    cin >> l;
    L.push_back(l);
  }
  SORT(L);
  REV(L);
  ll ans;
  REP(i,n){
    REP(j,i){
      REP(k,j){
        // cout << i << " " << j << " " << k << endl;
        // cout << L[i] << " " << L[j] << " " << L[k] << endl;
        if (L[i] + L[j] > L[k]){
          ans+=(j-k);
          break;
        }
      }
    }
  }
  cout << ans << endl;

}


Measured memory_bytes: 384