akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();
        string s = sc.Next();
        string t = sc.Next();

        int count = n;
        while (true)
        {
            if (s.Substring(s.Length - count, count) == t.Substring(0, count))
            {
                break;
            }
            else
            {
                count--;
            }
        }

        int answer = s.Length + t.Length - count;

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 13140
import sys
input = sys.stdin.readline

max_n = 100000
max_k = 100000
max_w = 10000


def check(p):
  global N, K, T

  i = 0
  for k in range(K):
    s = 0
    while s + T[i] <= p:
      s += T[i]
      i += 1
      if i == N: return N
  return i

def solve():
  left = 0
  right = max_k * max_w

  while right - left > 1:
    mid = (left + right) // 2
    v = check(mid)
    if (v >= N):
      right = mid
    else:
      left = mid
  return right


if __name__ == '__main__':
  N, K = map(int, input().split())
  T = [int(input()) for _ in range(N)]

  ans = solve()
  print(ans)



Measured memory_bytes: 10872
import java.util.Scanner;

class Main {

    static char[] alphabet = "abcdefghijklmnopqrstuvwxyz".toCharArray();

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

        long n = sc.nextLong();

        long tmp = n;
        int keta = 1;
        while (true) {
            tmp -= Math.pow(26, keta);
            if (tmp <= 0) {
                break;
            }
            keta++;
        }

        String name = "";
        for (; keta > 0; keta--) {
            int idx = (int)((n - 1) % 26);
            name = alphabet[idx] + name;
            n = (n - 1) / 26;
        }

        System.out.println(name);
    }
}


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

using namespace std;

int main() {
  char s[206];
  scanf("%s", &s);
  int n = strlen(s);
  for (int i=n-2; i>0; i-=2) {
    if (strncmp(s, s+i/2, i/2) == 0) {
      printf("%d\n", i);
      break;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn = 100000;
const LL INF = 1LL << 60;
int n, cnt;
LL a, Min, sum;
int main() {
	scanf("%d", &n);
	Min = INF;
	for(int i = 1; i <= n; i++) {
		scanf("%lld", &a);
		Min = min(Min, abs(a));
		sum += abs(a);
		if(a < 0)cnt++;
	}
	if(cnt & 1)sum -= 2 * Min;
	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 384
import sys
import math

def main(inp):
    N=int(next(inp).split()[0])
    cap = [int(next(inp).split()[0]) for _ in range(5)]
    
    time=math.ceil(N/cap[0])
    
    for i in range(1,5):
        if(cap[i-1]<=cap[i]):
            cap[i]=cap[i-1]
            time+=1
        elif(cap[i-1]>=N):
            time+=math.ceil(N/cap[i])
        else: time+=math.ceil(N/cap[i])-math.ceil(N/cap[i-1])+1
            
    return time
  
print(main(sys.stdin))

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


void swap(int &a,int &b)
{
    int t;
    t=a;
    a=b;
    b=t;
}
int main() {
	// your code goes here
	int n;
	cin>>n;
	int counter=0;
	for(int i=0;i<n;i++)
	{
	    int l,r;
	    cin>>l>>r;
	    counter+=(r-l+1);
	}
	cout<<counter;
	return 0;
}


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

int N, X, m, ans, Min = 1e9;

int main() {
    cin >> N >> X;
    for (int i = 0; i < N; i++) {
        cin >> m;
        X -= m;
        ans++;
        Min = min(Min, m);
    }
    ans += X / Min;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
typedef long long ll;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
const ll INF = 1 << 30;
const ll INFll = 1ll << 60;

ll calc(string s) {
  ll d = 0;
  ll sum = 0;
  for (ll i = 0; i < s.size(); i++) {
    if (s[i] == '+') {
      sum += d;
      d = 0;
    } else {
      d *= 10;
      d += s[i] - '0';
    }
  }
  sum += d;
  return sum;
}

ll msum(string s, ll i) {
  if (i == s.size()) {
    return calc(s);
  }

  ll sum = 0;
  if (s[i - 1] != '+') {
    s.insert(i, "+");
    sum += msum(s, i + 2);
    s.erase(i, 1);
  }
  sum += msum(s, i + 1);
  return sum;
}

int main() {
  string s;
  cin >> s;

  if (s.size() == 1) {
    cout << ll(s[0] - '0') << endl;
    return 0;
  }
  cout << msum(s, 1) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
// 型シノニム
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
// 定数
constexpr ll INF   = 1e16;
constexpr ll INM   = 114514;
constexpr ll MOD   = 1e9 + 7;
constexpr ld EPS   = 1e-12;
constexpr ll dx[4] = {1, 0, -1, 0};
constexpr ll dy[4] = {0, 1, 0, -1};
// 便利関数
void IOS() { ios::sync_with_stdio(false), cin.tie(0); }
template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, ll t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll mod) {
	if (a > 0) return a % mod;
	if (a % mod == 0) return 0;
	ll x = -a / mod + 1;
	a += x * mod;
	return a % mod;
}
ll powm(ll a, ll b, ll m) {
	if (b == 0) {
		return 1;
	} else if (b % 2 == 0) {
		ll d = powm(a, b / 2, m);
		return (d * d) % m;
	} else {
		return (powm(a, b - 1, m) * a) % m;
	}
}
// 本体

ll a[200002] = {};

int main() {
	IOS();
	string s;
	cin >> s;
	reverse(s.begin(), s.end());
	map<ll, ll> mp;
	mp[0]++;
	ll cnt = 1;
	for (int i = 0; i < s.size(); i++) {
		int keta = (int)(s[i] - '0');
		if (i == 0) {
			a[i] = (int)(s[i] - '0');
		} else {
			a[i] = (a[i - 1] + cnt * keta) % 2019;
		}
		cnt *= 10;
		cnt %= 2019;
		mp[a[i]]++;
	}
	ll ans = 0;
	for (auto it = mp.begin(); it != mp.end(); it++) {
		ll unko = (*it).second;
		ans += (unko - 1) * unko / 2;
	}
	dump(ans);
}

Measured memory_bytes: 5256
#include <stdio.h>
int main(void) {
    int height,width,i,j;
    while (1) {
        scanf("%d %d",&height,&width);
        if (height==0&&width==0) break;
        for (i=0; i<height; i++) {
            for (j=0; j<width; j++) {
                if (i==0||i==height-1||j==0||j==width-1) {
                    printf("#");
                } else {
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 572
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>

const long long int Z = 1000000007;
const long long int INF = 1 << 30;
int flag = 0;
using ll = long long;

 ll gcd(ll a, ll 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;
 }

 int main() {
	 int n, a[100][100] = { 0 }, b[100][100] = { 0 }, c[100][100] = { 0 }, d[100][100] = { 0 };
	 std::cin >> n;
	 for (int i = 0;i < n;i++) {
		 int x, y, z, v;
		 std::cin >> x >> y >> z >> v;
		 if (x == 1) {
			 a[y][z] += v;
		 }
		 if (x == 2) {
			 b[y][z] += v;
		 }
		 if (x == 3) {
			 c[y][z] += v;
		 }
		 if (x == 4) {
			 d[y][z] += v;
		 }
	 }
	 for (int i = 1;i <= 3;i++) {
		 std::cout << ' ';
		 for (int j = 1;j <= 10;j++) {
			 std::cout << a[i][j];
			 if (j == 10)break;
			 std::cout << ' ';
		 }
		 std::cout << std::endl;
	 }
	 std::cout << "####################" << std::endl;
	 for (int i = 1;i <= 3;i++) {
		 std::cout << ' ';
		 for (int j = 1;j <= 10;j++) {
			 std::cout << b[i][j];
			 if (j == 10)break;
			 std::cout << ' ';
		 }
		 std::cout << std::endl;
	 }
	 std::cout << "####################" << std::endl;
	 for (int i = 1;i <= 3;i++) {
		 std::cout << ' ';
		 for (int j = 1;j <= 10;j++) {
			 std::cout << c[i][j];
			 if (j == 10)break;
			 std::cout << ' ';
		 }
		 std::cout << std::endl;
	 }
	 std::cout << "####################" << std::endl;
	 for (int i = 1;i <= 3;i++) {
		 std::cout << ' ';
		 for (int j = 1;j <= 10;j++) {
			 std::cout << d[i][j];
			 if (j == 10)break;
			 std::cout << ' ';
		 }
		 std::cout << std::endl;
	 }
	return 0;
}


Measured memory_bytes: 3240
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		int q=sc.nextInt();
		int tokuten[]=new int[n];
		for(int i=0;i<n;i++) {
			tokuten[i]=k-q;
		}
		for(int i=0;i<q;i++) {
			int h=sc.nextInt();
			tokuten[h-1]++;
		}

		for(int i=0;i<n;i++) {
			if(tokuten[i]>0) {
				System.out.println("Yes");
			}else {
				System.out.println("No");
			}
		}

	}

}

Measured memory_bytes: 72628
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    string S;
    cin >> S;
    if (S.find("AC") != string::npos){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
  int x;
  cin >> x;
  int ans = 1;
  for (int b = 2; b <= x; b++) {
    int p = b * b;
    for (int j = 0; ; j++) {
      if (p > x) break;
      ans = max(ans, p);
      p *= b;
    }
  }
  cout << ans << endl;
  return 0;
}

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

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

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

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

const int INF = 1e9;
const int mod = 1e9+7;

int main()
{
    int n;
    cin >> n;
    int ans = 0;
    while(n){
        if(n % 10 == 2) ans++;
        n /= 10;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD = 1000000007;
int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin>>n;
  int g=0,a=0,b=0;
  vector<int> d(n,0);
  for(int i=0; i<n; i++){
    cin>>d[i];
    g=__gcd(g,d[i]);
    if(d[i]%2){a++;}
    else{b++;}
  }
  if(g!=1){
    cout<<"not coprime";
  }
  else{
    if(b>=2){
        cout<<"setwise coprime";
    }
    else{
        map<int,int> k;
        for(int i=0; i<n; i++){
            if(d[i]==1){continue;}
                int j=2;
            for( j=2; j*j<d[i]; j++){
                if(d[i]%j==0){
                    k[j]++;
                    if(k[j]>=2){cout<<"setwise coprime"; return 0;}
                    k[d[i]/j]++;
                    if(k[d[i]/j]>=2){cout<<"setwise coprime"; return 0;}
                }
            }
            if(j*j==d[i]){
                k[j]++;
                    if(k[j]>=2){cout<<"setwise coprime"; return 0;}
            }
            k[d[i]]++;
            if(k[d[i]]>=2){cout<<"setwise coprime"; return 0;}

        }
        cout<<"pairwise coprime";
    }
  }

    return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<pair<int,int>> v(n);
  rep(i,n){
    int x,y;
    cin >> x >> y;
    v[i] = {x,y};
  }
  int now = 0;
  int res = 0;
  for (int i = 0; i < n;i++){
    if (v[i].first == v[i].second) now++;
    else now = 0;
    res = max(res,now);
  }
  if (res >= 3) cout << "Yes" << endl;
  else cout << "No" << endl; 
  

  return 0;
}

Measured memory_bytes: 3624
#    !/usr/bin/env python3
#    encoding: UTF-8
#    Modified: <07/Jul/2019 05:49:12 PM>


#    ✪ H4WK3yE乡
#    Mohd. Farhan Tahir
#    Indian Institute Of Information Technology (IIIT), Gwalior


import sys
import os
from io import IOBase, BytesIO


def main():
    l, r = get_ints()
    ans = float("inf")
    x = set()
    for i in range(l, r + 1):
        _x = i % 2019
        if _x in x:
            break
        x.add(_x)
        y = set()
        for j in range(i + 1, r + 1):
            _y = j % 2019
            if _y in y:
                break
            y.add(_y)
            ans = min(ans, (_x * _y) % 2019)
    print(ans)


BUFSIZE = 8192


class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill():
            pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill()
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        py2 = round(0.5)
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2 == 1:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode("ascii"))
            self.read = lambda: self.buffer.read().decode("ascii")
            self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


def input(): return sys.stdin.readline().strip()


if __name__ == "__main__":
    main()


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

class UF{
public:
  
  int n;
  vector<int> p, rank;

  UF(){};
  UF(int n):n(n),p(n),rank(n,0){ for(int i=0;i<n;i++) p[i] = i; };
  
  int find(int x){
    if( x != p[x] ) p[x] = find(p[x]);
    return p[x];
  }
  
  void unite(int x, int y){
    x = find(x);
    y = find(y);
    if( rank[x] > rank[y] ) p[y] = x;
    else{
      p[x] = y;
      if(rank[x]==rank[y]) rank[y]++;
    }
  }
  
  bool same(int x, int y){ return find(x) == find(y); }
  
};

signed main(){
  
  int n, q;
  cin>>n>>q;
  
  UF uf(n);
  
  while(q--){
    
    int com, x, y;
    cin>>com>>x>>y;
    
    if( com == 0 ) uf.unite( x, y );
    else cout<<uf.same( x, y )<<endl;
    
  }
  
  return 0;
}



Measured memory_bytes: 3244
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<math.h>
#include<map>
typedef long long int ll;
using namespace std;
#define maxn 0x3f3f3f3f

int main()
{
    int n,a;
    scanf("%d",&n);
    int acm=1;
        for(int i=1;i<=n;i++)
        {
            scanf("%d",&a);
            if((a%2==0)&&(a%3)&&(a%5))
            {
                acm=0;
                break;
            }
        }
        if(acm)
            printf("APPROVED\n");
        else
            printf("DENIED\n");
    return 0;
}


Measured memory_bytes: 256
H, W, K = map(int,input().split())
S = list(list(input())for i in range(H))
cake = [[0]*W for i in range(H)]

queue = []
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            queue.append([i,j])
            cake[i][j] = -1
for i in range(K):
    h,w = queue[i]
    U,D,L,R = 0,0,0,0
    while L < w:
        if cake[h][w-L-1]:
            break
        L += 1
    while R+w < W-1:
        if cake[h][w+R+1]:
            break
        R += 1
    while U < h:
        flag = False
        for k in range(w-L,w+R+1):
            if cake[h-U-1][k]:
                flag = True
        if flag:
            break
        U += 1
    while D+h < H-1:
        flag = False
        for k in range(w-L,w+R+1):
            if cake[h+D+1][k] != 0:
                flag = True
        if flag:
            break
        D += 1
    for x in range(h-U,h+D+1):
        for y in range(w-L,w+R+1):
            cake[x][y] = i+1

for i in cake:
    print(*i)

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

int main() {
  string s;
  cin >> s;
  if(s.back() != 's')s+="s";
  else s+="es";
  cout<<s<<endl;
  return 0;
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;


LL dp[100010][4];
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  string S;
  cin >> S;
  int N = SZ(S);

  dp[0][0] = 1;
  REP(i,N){
	bool f = S[i] == '?';
	//REP(j,4) (dp[i+1][j] += dp[i][j]) %= MOD;
	if(S[i] == 'A' || f){
	REP(j,4) (dp[i+1][j] += dp[i][j]) %= MOD;
	  (dp[i+1][1] += dp[i][0]) %= MOD;
	}
	if(S[i] == 'B' || f){
	REP(j,4) (dp[i+1][j] += dp[i][j]) %= MOD;
	  (dp[i+1][2] += dp[i][1]) %= MOD;
	}
	if(S[i] == 'C' || f){
	REP(j,4) (dp[i+1][j] += dp[i][j]) %= MOD;
	  (dp[i+1][3] += dp[i][2]) %= MOD;
	}
  }

  cout << dp[N][3] << endl;

  return 0;
}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1000000007;
int n;
int fpow(int x,int y)
{
	if(y==0) return 1;
	if(y==1) return x;
	int ans=fpow(x,y/2)*fpow(x,y/2)%mod;
	if(y&1) ans=ans*x%mod;
	return ans;
}
signed main()
{
	cin>>n;
	cout<<((fpow(10,n)+fpow(8,n))%mod-fpow(9,n)*2%mod+mod*2)%mod;
	return 0;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#define lli long long int
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
using namespace std;
int main()
{
    fio
    lli n,m;
    cin>>n>>m;
    lli dp[n][m]; char a[n][m];
    memset(dp,0,sizeof(dp));
    lli i,j;
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        {
            cin>>a[i][j];
        }
    }
    for(i=0;i<m;i++)
    {
        if(a[0][i]=='.')
            dp[0][i]=1;
        else
         {
            break;
         }
    }
    for(i=0;i<n;i++)
    {
        if(a[i][0]=='.')
            dp[i][0]=1;
        else
         {
            break;
         }
    }
    for(i=1;i<n;i++)
    {
        for(j=1;j<m;j++)
        {   if(a[i][j]=='.')
            dp[i][j]=(dp[i-1][j]+dp[i][j-1])%mod;
        }
    }
    cout<<dp[n-1][m-1]%mod;


return 0;
}


Measured memory_bytes: 9088
#include <stdio.h>
int main(void)
{
  int Aput[3][10]={0};
  int Bput[3][10]={0};
  int Cput[3][10]={0};
  int Dput[3][10]={0};
  int n;
  int b[10000]={0};
  int f[10000]={0};
  int r[10000]={0};
  int v[10000]={0};
  int i,j,l;

  scanf("%d",&n);
  for (i=0; i<n; i++) {
	scanf("%d",&b[i]);
	scanf("%d",&f[i]);
	scanf("%d",&r[i]);
	scanf("%d",&v[i]);
  }
  /*****************入力***********************/

  for (i=0; i<n; i++) {
	if (b[i]==1) {
	  Aput[f[i]-1][r[i]-1]+=v[i];
	}
	if (b[i]==2) {
	  Bput[f[i]-1][r[i]-1]+=v[i];
	}
	if (b[i]==3) {
 	  Cput[f[i]-1][r[i]-1]+=v[i];
	}
	if (b[i]==4) {
	  Dput[f[i]-1][r[i]-1]+=v[i];
	}
  }

  /*****************************************/

  for (i=0; i<3; i++) {
	for (j=0; j<10; j++) {
	  printf(" %d",Aput[i][j]);
	}
	printf("\n");
  }

  printf("####################\n");

  for (i=0; i<3; i++) {
	for (j=0; j<10; j++) {
	  printf(" %d",Bput[i][j]);
	}
	printf("\n");
  }

  printf("####################\n");

  for (i=0; i<3; i++) {
	for (j=0; j<10; j++) {
	  printf(" %d",Cput[i][j]);
	}
	printf("\n");
  }

  printf("####################\n");

  for (i=0; i<3; i++) {
	for (j=0; j<10; j++) {
	  printf(" %d",Dput[i][j]);
	}
	printf("\n");
  }
  return 0;
}

Measured memory_bytes: 776
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,p,b) for(int i=(p);i<(b);i++)
#define rrep(i,p,b) for(int i=(b)-1;i>=(p);i--)
#define all(p) (p).begin(),(p).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

#define MAX 100010
#define B 15

signed main() {
	cout << fixed << setprecision(8);
	static double dp[MAX][B] = {}; dp[1][1] = 1;
	static double p[B] = {};
	static double ans[MAX] = {};
	double sum = 0;
	rep(i, 1, B)p[i] = pow(0.5, i - 1);
	rep(i, 1, MAX - 1) {
		rep(j, 1, B) {
			if (dp[i][j] == 0)continue;
			sum += dp[i][j] * p[j];
			dp[i + 1][1] += dp[i][j] * (1 - p[j]);
			dp[i + 1][j + 1] += dp[i][j] * p[j];
		}
		ans[i] = sum;
	}
	for (int n; cin >> n&&n;) {
		cout << ans[n] << endl;
	}
	return 0;
}

Measured memory_bytes: 15788
import math
n, m = map(int, input().split())
mod = 1000000007
def prime(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for j in range(4, n+1, 2):
        is_prime[j] = False
    for i in range(3, int(n**0.5) + 1, 2):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def nCr(n, r):
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] //= pivot
                denominator[k] //= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1: 
            result *= numerator[k] % mod
    return result

def nHr(n, r):
    return nCr(n+r-1, r)

prime_list = prime(int(math.sqrt(m)))
divisor_list = {}
while m > 1:
    for i in prime_list:
        if m % i == 0:
            if i in divisor_list:
                divisor_list[i] = divisor_list[i] + 1
            else:
                divisor_list[i] = 1
            m = m // i
            break
        if i == prime_list[-1]:
            divisor_list[m] = 1
            m = 1
            break
ans = 1
for k in divisor_list:
    ans *= nHr(n, divisor_list[k]) % mod
    ans %= mod
print(ans)

Measured memory_bytes: 3444
import java.util.*;

public class Main {

	private static boolean[][] g;
	private static boolean[] visited;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		g = new boolean[n][n];
		int[][] es = new int[m][2];

		for (int i = 0; i < m; i++) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			es[i][0] = a;
			es[i][1] = b;
			g[a][b] = true;
			g[b][a] = true;
		}

		int answer = 0;
		visited = new boolean[n];
		for (int i = 0; i < m; i++) {
			g[es[i][0]][es[i][1]] = false;
			g[es[i][1]][es[i][0]] = false;
			Arrays.fill(visited, false);
			dfs(0);
			boolean isBridge = false;
			for (int v = 0; v < n; v++) {
				if (!visited[v]) {
					isBridge = true;
					break;
				}
			}
			if (isBridge) answer++;
			g[es[i][0]][es[i][1]] = true;
			g[es[i][1]][es[i][0]] = true;
		}

		System.out.println(answer);
	}

	private static void dfs(int v) {
		if (visited[v]) return;
		visited[v] = true;

		for (int i = 0; i < g[v].length; i++) {
			if (g[v][i]) {
				dfs(i);
			}
		}
	}
}


Measured memory_bytes: 24020
N = int(input())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()

i = N//2
if N%2 == 0:
    print(B[i]+B[i-1]-A[i]-A[i-1]+1)
else:
    print(B[i]-A[i]+1)

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

int main() {
    int N,n,sum;
    cin >> N;
    n=N;
    while (n>0){
    sum += n %10;
    n /= 10;
    }
    if (N%sum==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#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>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
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() {
	ll pas[51][51] = {};
	rep(i, 51) {
		rep(j, 51) {
			if (i == 0 || j == 0)pas[i][j] = 1;
			else pas[i][j] = pas[i - 1][j] + pas[i][j - 1];
		}
	}
	int n, a, b; cin >> n >> a >> b;
	ll v[50];
	rep(i, n) {
		cin >> v[i];
	}
	sort(v, v + n, greater<ll>());
	ll sum = 0;
	rep(i, a) {
		sum += v[i];
	}
	cout << fixed << setprecision(7) << sum / (ld)a << endl;
	ll memo = v[a - 1];
	int cnt = 0; int chk = 0;
	rep(i, n) {
		if (memo == v[i]) {
			cnt++; chk = i;
		}
	}
	ll out = 0;
	if (memo == v[0]) {
		for (int i = a - 1; i <= chk && i <= b - 1; i++) {
			int cnt2 = chk - i;
			out += pas[cnt - cnt2][cnt2];
		}
	}
	else {
		int cnt2 = chk - (a - 1);
		out = pas[cnt - cnt2][cnt2];
	}
	cout << out << endl;
	return 0;
}

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

int main()
{
  std::string S;
  std::getline(std::cin, S);
  
  int i = 0;
  char z = S[0];
  for (int x = 1; x < S.size(); ++x)
  {
    i += S[x] == z ? 1 : 0;
    z = z == '0' ? '1' : '0';
  }
  std::cout << i << std::endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

#define ALL(x) x.begin(),x.end()
#define get_tp(t,i) get<i>(t)
#define len(x) (ll)(x.size())
#define ub(a,x) (upper_bound(ALL(a),x)-a.begin())
#define lb(a,x) (lower_bound(ALL(a),x)-a.begin())
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef pair<long long,long long> pllll; //pair<ll,ll>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<int, vector<int>, greater<int> > gpq; //逆順priority_queue
typedef priority_queue<int> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const long double PI=3.1415926535897932;

int main(){
    int N;cin>>N;
    vi ans(100000,0);
    for(int x=1;x<=100;x++){
        for(int y=1;y<=100;y++){
            for(int z=1;z<=100;z++){
                ans[x*x+y*y+z*z+x*y+y*z+z*x]++;
            }
        }
    }
    for(int i=1;i<=N;i++){
        cout<<ans[i]<<endl;
    }
}


Measured memory_bytes: 3708
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e6 + 100;
int n, x, ans, maxx, res, i, j, num[N];
int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int main() {
	cin >> n >> ans;
	num[ans]++;
	for (i = 2; i <= n; i++) {
		cin >> x;
		num[x]++;
		maxx = max(maxx, x);
		ans = gcd(ans, x);
	}
	if (ans != 1) cout << "not coprime\n";
	else {
		for (i = 2; i <= maxx; i++) {
			for (j = i, res = 0; j <= maxx; j += i) res += num[j];
			if (res > 1) {
				cout << "setwise coprime";
				return 0;
			}
		}
		cout << "pairwise coprime\n";
	}
	return 0; 
}


Measured memory_bytes: 7504
using System;
using System.Collections.Generic;
using System.Text;

namespace CSharpTest
{
    class A_WeLoveGolf
    {
        static void Main(string[] args)
        {
            double K = double.Parse(Console.ReadLine());
            string[] AB = Console.ReadLine().Split();
            double A = double.Parse(AB[0]);
            double B = double.Parse(AB[1]);
            if (Math.Ceiling(A / K) > Math.Floor(B / K)) Console.WriteLine("NG");
            else Console.WriteLine("OK");
            return;
        }
    }
}


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

#define LL long long

#define FOR(INDEX, START, END) for (LL INDEX = (START); INDEX < (END); ++INDEX)
#define REP(INDEX, COUNT) for (LL INDEX = 0; INDEX < (COUNT); ++INDEX)

int main()
{
	LL N;
	cin >> N;
	string str;
	cin >> str;

	int r = 0;
	int b = 0;
	REP(i, N) {
		if (str[i] == 'R') {
			++r;
		}
		else {
			++b;
		}
	}

	if (r > b) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}


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

int main() {
  int N, a;

  cin >> N;
  
  vector<int> vec(N);
  
  for(int i = 0; i < N; i++){
    cin >> a;
    vec.at(i) = a;
  }
  
  a = 1;
  for(int i = 0; i < N; i++){
    a = vec.at(a - 1);
    
    if (a == 2){
      cout << i + 1 << endl;
      break;
    }
    
  }
  
  if (a != 2) cout << -1 << endl;
  
}


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

using namespace std;

int main()
{
    int n;
    int ans = 0;

    cin >> n;

    for(int i = 1; i <= n; ++i)
    {
        if((int)log10(i) % 2 == 0)
        {
            ++ans;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
def myAnswer(X1,Y1,X2,Y2):
   sub = X2 - X1
   length =  Y2 - Y1
   X3,Y3 = X1 - length,Y2
   X4,Y4 =  X1 - length,Y1
   X3 += sub
   Y3 += sub
   Y4 += sub
   print(X3,Y3,X4,Y4)

def modelAnswer():
   tmp=1
def main():
   X1,Y1,X2,Y2=map(int,input().split())
   myAnswer(X1,Y1,X2,Y2)


if __name__ == '__main__':
   main()

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

hyouka = []
for i in range(n):
    tmpS, tmpP = input().split()
    ss = ""
    for j in range(10-len(tmpS)):
        ss = ss + "a"
    tmpHyouka = tmpS + ss + str(9999-int(tmpP)-1)
    hyouka.append(tmpHyouka)

ans = sorted(range(len(hyouka)), key=lambda k: hyouka[k])

for i in range(n):
    print(ans[i]+1)

Measured memory_bytes: 3064
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
ok = 0
if ((p[2] -p[0]) == (q[2]-q[0]) == (r[2]-r[0])):
    if ((p[2] -p[1]) == (q[2]-q[1]) == (r[2]-r[1])):
        if ((p[1] -p[0]) == (q[1]-q[0]) == (r[1]-r[0])):
            ok +=1
if((q[0]-p[0]) == (q[1]-p[1]) == (q[2]-p[2])):
    if((r[0]-p[0]) == (r[1]-p[1]) == (r[2]-p[2])):
        if((r[0]-q[0]) == (r[1]-q[1]) == (r[2]-q[2])):
            ok +=1
if (ok==2):
    print('Yes')
else :
    print('No')  

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

int main() {
	string s;
	cin >> s;
	bool app[26];
	rep(i, 26) {
		app[i] = false;
	}

	for (int i = 0; s[i] != '\0'; i++) {
		app[s[i] - 'a'] = true;
	}

	rep(i, 26) {
		if (!app[i]) {
			printf("%c\n", (char)(i + 'a'));
			return 0;
		}
		

	}

	cout << "None" << endl;
	return 0;

}

Measured memory_bytes: 512
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class B
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var X = Scanner.Scan<int>();
            var c500 = X / 500;
            var c5 = X % 500 / 5;

            Console.WriteLine(c500 * 1000 + c5 * 5);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


Measured memory_bytes: 28364
#include<bits/stdc++.h> 
#define int long long 
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
using namespace std; 
void fastio()
{
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int p(int n)
{
    for(int i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return 0;
    }
    return 1;
}
signed main()
{
    fastio();
   int n,c=0,a;
   cin>>n;
   int x=sqrt(n);
    if(p(n)==1)
   cout<<n-1;
   else
   {
   for(int i=x;i>=1;i--)
   {
       if(n%i==0)
       {
           a=i;
           break;
       }
   }
   int zz=n/a;
   cout<<(a+zz)-2;
   }
}

Measured memory_bytes: 3672
/*                    ___          |\    /|           ____   ____   ____  ____
   |     |    /\    /    \ |     | | \  / |    /\    |    \ |    \ |     |    \
   |_____|   /__\   \____  |_____| |  \/  |   /__\   |____/ |____/ |__   |____/
   |     |  /    \       \ |     | |      |  /    \  |      |      |     |   \
   |     | /      \ \____/ |     | |      | /      \ |      |      |____ |    \
*/
#include<bits/stdc++.h>
using namespace std;
#define lb lower_bound
#define ub upper_bound
#define pf push_front
#define pb push_back
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define pi pair<int,int>
#define pl pair<long,long>
#define pll pair<long long,long long>
#define pld pair<long double,long double>
#define gc getchar_unlocked
#define pc putchar_unlocked
#define endl '\n'
#define loop(i,n) for(ll i=0;i<n;i++)
#define mod ((ll)(1e9+7))
#define in(x) scanf("%lld",&x)
#define in2(x,y) scanf("%lld %lld",&x,&y)
#define vl vector<ll>
#define ml unordered_map<ll,ll> 
#define vpll vector<pair<ll,ll>>
#define INF 0x3f3f3f3f
#define mp make_pair

int main()
{
   ll a,b;
   in(a);
   ll ans=0;
   for(ll i=1;i<10;i++)
   for(ll j=1;j<10;j++)
   if(i*j == a) {
       cout<<"Yes"<<endl;
       return 0;
   }
   cout<<"No"<<endl;
   return 0;
} 


Measured memory_bytes: 256
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
        public class Main {
        	static int n ,m;
        	static char[][]arr;
        	static long [][] memo;
        	public static void main(String[] args) throws IOException {
        		Scanner sc =new Scanner(System.in);
        		PrintWriter pw =new PrintWriter(System.out);
        		n=sc.nextInt();m=sc.nextInt();
        		arr=new char[n][];
        		memo =new long[n][m];
        		long mod =1000000000+7;
        		for (int i=0;i<n;++i) {
        			arr[i]=sc.next().toCharArray();
        		}
        		memo[n-1][m-1]=1;
        		for (int i =n-1;i>=0;--i) {
        			for (int j =m-1;j>=0;--j) {
        				if (i+1<n&&arr[i+1][j]!='#')
        					memo[i][j]+=memo[i+1][j]%mod;
        				if (j+1<m&&arr[i][j+1]!='#')
        					memo[i][j]+=memo[i][j+1]%mod;
//        				print(memo);
//        			System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "+i+" "+j);
        			}

        		}
        		pw.print(memo[0][0]%mod);
          		pw.close();
        	}
    		static long gcd(long a, long b) 
    		{ 
    		    if (a == 0) 
    		        return b; 
    		    return gcd(b % a, a); 
    		}
			static class Scanner {
				StringTokenizer stringTokenizer;
				BufferedReader bfBufferedReader;
				public Scanner(InputStream system) {
					bfBufferedReader=new BufferedReader(new InputStreamReader( system));
				}
				 public Scanner(String file) throws Exception {
			            bfBufferedReader = new BufferedReader(new FileReader( file));
			        }			 
			        public String next() throws IOException {
			            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens())
			                stringTokenizer = new StringTokenizer( bfBufferedReader.readLine());
			            return stringTokenizer.nextToken();
			        }
			 
			        public String nextLine() throws IOException {
			            return bfBufferedReader.readLine();
			        }
			 
			        public int nextInt() throws IOException {
			            return Integer.parseInt(next());
			        }
			 
			        public double nextDouble() throws IOException {
			            return Double.parseDouble(next());
			        }
			 
			        public char nextChar() throws IOException {
			            return next().charAt(0);
			        }
			 
			        public Long nextLong() throws IOException {
			            return Long.parseLong(next());
			        }
			 
			        public boolean ready() throws IOException {
			            return bfBufferedReader.ready();
			        }
			 
			        public void waitForInput() throws InterruptedException {
			            Thread.sleep(3000);
			        }
			    }
			public static void print(long [][]d) {
				for (int i=0;i<d.length;++i)
					System.out.println(Arrays.toString(d[i]));
			}
        }

Measured memory_bytes: 36176
#include "bits/stdc++.h"
#define rep(i, j) for (int i = 0; i < j; i++)
#define srep(i, j, k) for (int i = j; i < k; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using ull = unsigned long long;

ll gcd(ll x, ll y);
int fac(ll n, vector<int> num);

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

//�G�X�g���l�X���
vector<ll> estora(vector<ll> num) {
    int sel = 0;
    while (sel < num.size()) {
        int d = num[sel];
        for (int i = 0; i < num.size(); i++) {
            if (num[i] % d == 0 && num[i] != d && d != 1) {
                num.erase(num.begin() + i);
                i--;
            }
        }
        sel++;
    }
    return num;
}

const int INF = 1001001001;

//mint�p�̒萔 (10��9�� + 7)
const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }

//string�@�ɂ��Ē��ׂĂ�����

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans = b / a;

    cout << min(ans, c) << endl;
    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
ll gcd(ll x, ll y) {
    ll num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

/*�f��������*/
//���색�C�u����
//i����ɑf���ɂ��Ă����Ȃ��Ƃ��܂��ł��Ȃ�&&�v�Z�ʃ��o�C
//�G�X�g���l�X��⿂őf����U����Ă����K�v�������肻��
int fac(ll n, vector<int> num) {
    ll kazu = n;
    for (int i = 2; i <= sqrt(n); i++) {
        while (1) {
            if (kazu % i != 0) break;

            kazu /= i;
            num[i]++;
        }
    }
    if (kazu == n && n != 1) return 1;
    int ans = 0;
    if (kazu != 1) ans++;
    for (int i = 2; i <= sqrt(n); i++) {
        for (int j = 1; j <= num[i]; j++) {
            num[i] -= j;
            ans++;
        }
    }
    return ans;
}

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

int main(void){
    int n;
    cin >> n;
    
    int a;
    int cnt, ans = 200;
    int i;
    for(i = 1; i <= n; i++){
        cin >> a;
        cnt = 0;
        while(a % 2 == 0){
            a /= 2;
            cnt++;
        }
        if(cnt < ans){
            ans = cnt;
        }
    }
    
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        BigDecimal a = new BigDecimal(sc.next());
        BigDecimal b = new BigDecimal(sc.next());
        /*a = a.multiply(b);
        a.setScale(0,RoundingMode.DOWN);
        System.out.println(a.toString());*/
        System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN));
    }
}


Measured memory_bytes: 35872
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
vector<int> G[1001];
int vcnt,mcnt,a,b,c2;
bool used[1001];
int dp[1001][1001][2];


void dfs(int v){
	used[v]=true;
	vcnt++;
	mcnt+=G[v].size();
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]]){
			dfs(G[v][i]);
		}
	}
}

int func(int a,int b,int c){
	if(a+b<=1)return 1;
	if(dp[a][b][c]!=-1)return dp[a][b][c];
	int res=0;
	if(c>0){
		res|=1^func(a,b,c-1);
	}
	if(a>0 && b>0){
		res|=1^func(a,b-1,c^1);
	}
	if(a>1){
		res|=1^func(a-2,b+1,c);
	}
	if(b>1){
		res|=1^func(a,b-1,c^1);
	}
	return (dp[a][b][c]=res);
}

int main(void){
	int m=0;
	scanf("%d%*c",&n);
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			char c;
			scanf("%c",&c);
			if(c=='Y'){
				G[i].push_back(j);
				m++;
			}
		}
		scanf("%*c");
	}
	memset(used,false,sizeof(used));
	for(int i=0;i<n;i++){
		if(!used[i]){
			mcnt=0;
			vcnt=0;
			dfs(i);
			if(vcnt%2==1)a++;
			else b++;
			if((vcnt*(vcnt-1)/2-(mcnt/2))%2==1){
				c2^=1;
			}
		}
	}
	memset(dp,-1,sizeof(dp));
	printf("%s\n",func(a,b,c2)==1?"Taro":"Hanako");
	return 0;
}

Measured memory_bytes: 11088
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");

function print(x) {
  console.log(x);
}

let inputString = "";
let currentLine = 0;

process.stdin.on("data", inputStdin => {
  inputString += inputStdin;
});
process.stdin.on("end", () => {
  inputString = inputString.split("\n");
  main();
});
function readline() {
  return inputString[currentLine++];
}

// ************************ Ignore above this Line ******************************
// **************************** Main Code Start *********************************

function main() {

  var ar = readline().split(" ");
  var a = ar[0], b = ar[1];

  print(b + "" + a );

}


Measured memory_bytes: 7500