akhauriyash/Code-Regression huggingface dataset:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>
using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];


const double pai = 3.1415926535897;
const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];


int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}
//x未満の要素数を返す二分探索関数
int b_s(vector<int>&vecxx, int xx) {
	if (xx < vecxx[0]) { //x以下の要素数を返させる時は"<"に変える
		return 0;
	}
	if (vecxx.back() <= xx) { //x以下の要素数を返させる時は"<="に変える
		return vecxx.size();
	}
	int aa1 = 0, aa2 = vecxx.size() - 1, aa3;
	while (aa1 + 1 < aa2) {
		aa3 = (aa1 + aa2) / 2;
		if (vecxx[aa3] > xx) { //x以下の要素数を返させる時は">"に変える
			aa2 = aa3;
		}
		else {
			aa1 = aa3;
		}
	}
	return aa2;
}
template<typename T>
void vecout(vector<T>& vec) { for (T t : vec) cout << t << " "; cout << endl; }


// テーブルを作る前処理
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;
	}
}
//n個を1個以上のx組のグループに分ける重複組み合わせはcom(n-1,x-1)
//グループが0個でもいいときはnにxを足す
// 二項係数計算
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;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		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;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}





signed main() {
	int a;
	long double d,b;
	cin >> a >> b;
	d = a * b;
	a = d;
	cout << a << endl;
}


Measured memory_bytes: 3732
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n,l;
    cin>>n>>l;
    vector<string>s(n);
    rep(i,n){
        cin>>s[i];
    }
    sort(s.begin(), s.end());
    string ans;
    rep(i,n){
        ans+=s[i];
    }
    cout<<ans<<endl;
}

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

#define ll long long int
#define db double
#define fl float
#define endl '\n'

#define mod (ll)(1000000007)
#define mod1 (ll)998242353
#define mod2 (ll)998244353
#define PI 3.1415926535897932384626433832795

#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp(x,y) make_pair(x,y)
#define pb push_back
#define pob pop_back

#define Sort(v) sort(v.begin(),v.end())
#define Sortd(v) sort(v.begin(),v.end(),greater<>())

#define f(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<n;i++)
#define rf(i,n) for(int i=n-1;i>=0;--i)
#define rf1(i,n) for(int i=n-1;i>=1;--i)
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repn(i,a,b) for(int i=a;i<=b;++i)

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef priority_queue<int> pqi;
typedef priority_queue<ll> pql;

//nC2
ll C2(ll n){
    ll ans= max(((n*(n-1))/2),(ll)0);
    return ans;
}
//square
ll sq(ll n){
    return n*n;
}

//GCD
ll gcd(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    if(b==0){
        return a;
    }    
    else{
        return gcd(b,a%b);
    }
}

//sort pair by second values
bool sortsec(const pair<ll,ll> &a, const pair<ll,ll> &b){ 
    return (a.second < b.second); 
}


//Binary Exponentiation
ll BinExp(ll a, ll b, ll m){
    a%=m;
    ll res =1;
    while(b>0){
        if(b&1){
            res = (res * a)%m;
        }
        a=(a*a)%m;
        b>>=1;
    }
    return res;
}


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


    string s,t,x;
    cin>>s;
    cin>>t;
    int cnt=0,ans=t.length();
    for(int i=0;i<=s.length()-t.length();++i){
        cnt=0;
        x=s.substr(i,t.length());
        f(j,t.length()){
            if(t[j]!=x[j])cnt++;
        }
        ans=min(ans,cnt);

    }
    cout<<ans<<endl;

    


    return 0;
}



Measured memory_bytes: 3660
import sys
import numpy as np
from math import ceil

def S(): return sys.stdin.readline().rstrip().split(' ')
def Ss(): return list(S())
def I(): return _I(Ss())
def Is(): return list(I())
def _I(ss): return map(int, ss) if len(ss) > 1 else int(ss[0])

n = I()
print(ceil(n / 1000) * 1000 - n)

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

using namespace std;

typedef long long ll;

const double pi = 3.14159265358979323846;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define MOD 1000000007LL
#define PS(p) cout << setprecision(15) << fixed << p << endl;
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
#define ALL(c) c.begin(), c.end()
#define CIN(v) cin >> v;
#define COUT(v) cout << v << "\n";

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

  int N;
  string S, T;

  CIN(N >> S >> T);

  for (int i = 0; i < N; i++) {
    cout << S[i] << T[i];
  }
  cout << endl;

  return 0;
}


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

int main() {
    int s; cin >> s;
    set<int> suretu; vector<int> v;
    suretu.insert(s); v.push_back(s);
    auto itr = v.begin();
    int count = 1;
    int index = 0;
    while(true) {
        int ch = v[index] % 2 == 0 ? (int)(v[index] / 2) : v[index] * 3 + 1;
        count++;
        auto findit = suretu.find(ch);
        if(findit != suretu.end())
            break;
        suretu.insert(ch); v.push_back(ch);
        itr++;
        index++;
    }
    cout << count << endl;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
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

class UnionFind():
    def __init__(self, n):
        self.n = n
        # parents[i]: 要素iの親要素の番号
        # 要素iが根の場合、parents[i] = -(そのグループの要素数)
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    # 要素xが属するグループの要素数を返す
    def size(self, x):
        return -self.parents[self.find(x)]
    def same(self, x, y):
        return self.find(x) == self.find(y)
    # 要素xが属するグループに属する要素をリストで返す
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    # 全ての根の要素をリストで返す
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    # グループの数を返す
    def group_count(self):
        return len(self.roots())
    # 辞書{根の要素: [そのグループに含まれる要素のリスト], ...}を返す
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    # print()での表示用
    # all_group_members()をprintする
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N, M = MAP()

uf = UnionFind(N)

for _ in range(M):
    A, B = MAP()
    uf.union(A-1, B-1)

print(uf.group_count()-1)


Measured memory_bytes: 13784
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  int H, W, N;

  cin >> H >> W >> N;

  int t = max(H, W);

  cout << (N + t - 1) / t << endl;

  return 0;
}


Measured memory_bytes: 256
package main
 
import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

func main(){
    
    N := nextInt()
    h := nextInts(N)
    
    dp := make([]int, N)
    for i:=0;i<N;i++ {
        dp[i] = 0
    }
    dp[1] = Abs(h[0]-h[1])
    
    for i:=2;i<N;i++ {
        dp[i] = Min([]int{dp[i - 1] + Abs(h[i] - h[i - 1]),
                          dp[i - 2] + Abs(h[i] - h[i - 2])});
    }
    
	fmt.Println(dp[N-1])
}

/* templates */


func Max(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Min(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
 
func Abs(a int) int {
    if a < 0 {
        return -a
    }
    return a
}
 
type Pair struct {
    a, b int
}
 
type Pairs []Pair
 
func (p Pairs) Len() int {
    return len(p)
}
 
func (p Pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}
 
func (p Pairs) Less(i, j int) bool {
    return p[i].b < p[j].b
}
 
var nextReader func() string
 
func init() {
    nextReader = NewScanner()
}
 
func NewScanner() func() string {
    r := bufio.NewScanner(os.Stdin)
    r.Buffer(make([]byte, 1024), int(1e+11))
    r.Split(bufio.ScanWords)
    return func() string {
        r.Scan()
        return r.Text()
    }
}

func nextString() string {
    return nextReader()
}
 
func nextInt64() int64 {
    v, _ := strconv.ParseInt(nextReader(), 10, 64)
    return v
}
 
func nextInt() int {
    v, _ := strconv.Atoi(nextReader())
    return v
}
 
func nextInts(n int) []int {
    r := make([]int, n)
    for i := 0; i < n; i++ {
        r[i] = nextInt()
    }
    return r
}

func nextStrings(n int) []string {
    r := make([]string, n)
    for i := 0; i < n; i++ {
        r[i] = nextString()
    }
    return r
}

func nextFloat64() float64 {
    f, _ := strconv.ParseFloat(nextReader(), 64)
    return f
}


Measured memory_bytes: 2688
package main

import (
	"fmt"
)

type dice struct {
	t, s, e, w, n, b int
}

// サイコロ1
func main() {
	var t, s, e, w, n, b int
	fmt.Scan(&t, &s, &e, &w, &n, &b)
	d := dice{t: t, s: s, e: e, w: w, n: n, b: b}

	var cmds string
	fmt.Scan(&cmds)
	for _, v := range cmds {
		switch string(v) {
		case "E":
			d.t, d.e, d.w, d.b = d.w, d.t, d.b, d.e
		case "W":
			d.t, d.e, d.w, d.b = d.e, d.b, d.t, d.w
		case "S":
			d.t, d.s, d.b, d.n = d.n, d.t, d.s, d.b
		case "N":
			d.t, d.s, d.b, d.n = d.s, d.b, d.n, d.t
		}
	}
	fmt.Println(d.t)
}



Measured memory_bytes: 1128
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

def main():
    w = input()
    if len(w)%2!=0:
        print('No')
        return
    s = sorted(w)
    for i in range(0,len(s),2):
        if s[i]!=s[i+1]:
            print('No')
            return
    print('Yes')
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 63980
from collections import deque

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0]*n
        self.size = [1]*n
    
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        else:
            if self.rank[x] < self.rank[y]:
                self.par[x] = y
                self.size[y] += self.size[x]
            else:
                self.par[y] = x
                self.size[x] += self.size[y]
            
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
    
    def same_check(self, x, y):
        return self.find(x) == self.find(y)
    
    def tree_size(self, x):
        return self.size[self.find(x)]
    


N, M = map(int, input().split())
bridge = [[int(_) for _ in input().split()] for _ in range(M)]
uf = UnionFind(N+1)
anslist = deque()
ans = N*(N-1)//2
anslist.append(ans)


for i in range(M-1):
    island1 = bridge[M-i-1][0]
    island2 = bridge[M-i-1][1]
    if uf.find(island1) != uf.find(island2):
        ans -= uf.tree_size(island1) * uf.tree_size(island2)
    
    anslist.append(ans)
    uf.unite(bridge[M-i-1][0], bridge[M-i-1][1])

for _ in range(M):
    print(anslist.pop())

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

int main()
{
    int A, B, C, D;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    if (A > B) A = B;
    if (C > D) C = D;
    cout << A + C << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}
ll prime(ll x) {
	ll i;
	if (x < 2)return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (i = 3; i*i <= x; i += 2) {
		if (x%i == 0) return 0;
	}
	return 1;
}
ll MOD = 1e9+7;
ll cnt[1010];
ll divide(ll m )
{
	while (m != 1) {
		for (ll i = 2; ; i++)
			if (m % i == 0){
				m /= i;
				cnt[i]++;
              	break;
			}
	}   
}
int main(){
  ll N;
  cin>>N;
  ll ans=1;
    for (ll i = 1; i <= N; i++){
		divide(i);
	}
  	for (ll i = 2; i <= N; i++){
		if (cnt[i]){
			ans *= (cnt[i] + 1);
			ans %= MOD;
		}
	}
 cout << ans << endl;
}

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

alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']






accm = 1

name = ""
for i in range(1, 20):

    start = accm
    end = pow(26, i)
    accm += end

    if n >= start and n <= accm - 1:

        hoge = n - start


        #print(i, n - start)

        remen = hoge

        for k in reversed(range(0, i)):
            temp = remen // pow(26, k)
            remen = remen % pow(26, k)
            #print(temp, remen)

            #print(temp, end=" ")
            #remen = remen % pow(26, k)
            name += alpha[temp]
            #print(alpha[temp], end=" ")


print(name)

Measured memory_bytes: 9192
def run(a, b):
    return (a-1)*(b-1)


def read_line():
    a, b = input().split()
    a = int(a)
    b = int(b)
    return (a, b)


def main():
    a, b = read_line()
    print(run(a, b))


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
N, W = map(int, input().split())
dp = [0] + [-1]*(W+1)
for i in range(N):
    v, w = map(int, input().split())
    for j in range(0, W-w+1):
        if dp[j] > -1 and dp[j+w] < dp[j] + v:
            dp[j+w] = dp[j] + v

print(max(dp))

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

int main() {
	int arr[5];
	int ans=0;
	for(int i=0; i<5;i++){
	    cin>>arr[i];
	    if(arr[i]==0)ans=i+1;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3596
i  = list(map(int,input().split()))
a = i[0]
b = i[1]
c = i[2]
d = i[3]

def gcd(n,m):
    x = min(n,m)
    y = max(n,m)
    while x != 0:
        x1 = x
        x = y%x
        y = x1
    return y

l = (c*d)//gcd(c,d)

count = (b - b//c - b//d + b//l) - ((a-1) - (a-1)//c - (a-1)//d + (a-1)//l)
print(count)

Measured memory_bytes: 3064
use v5.18;
use warnings;

chomp(my $word = <STDIN>);
my @words = split '', $word;
my @stack;

for my $char (@words) {
  if ($char eq 0) {
    push @stack, 0;
  }
  elsif ($char eq 1) {
    push @stack, 1;
  }
  elsif ($char eq 'B') {
    pop @stack;
  }
}

say @stack;


Measured memory_bytes: 640
#include <iostream>
#define llint long long
#define mod 1000000007

using namespace std;

llint N;
llint T[100005], A[100005];
llint v[100005];

int main(void)
{
	cin >> N;
	for(int i = 0; i < N; i++) cin >> T[i];
	for(int i = 0; i < N; i++) cin >> A[i];
	
	llint prev = 0;
	for(int i = 0; i < N; i++){
		if(T[i] != prev){
			v[i] = T[i];
			prev = T[i];
		}
	}
	prev = 0;
	for(int i = N-1; i >= 0; i--){
		if(A[i] != prev){
			if(v[i] != 0 && v[i] != A[i]){
				cout << 0 << endl;
				return 0;
			}
			v[i] = A[i];
			prev = A[i];
		}
	}
	
	llint ans = 1, m;
	for(int i = 0; i < N; i++){
		m = min(T[i], A[i]);
		if(m < v[i]){
			cout << 0 << endl;
			return 0;
		}
		if(v[i] == 0){
			ans *= m;
			ans %= mod;
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2560
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var n = nm[0];
        var m = nm[1];
        var nums = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        Array.Sort(nums);
        Array.Reverse(nums);

        var needs = new [] { int.MaxValue, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
        var dp = new int[n + 1];
        var ds = new int[n + 1];
        for (int i = 1; i < dp.Length; i++)
        {
            dp[i] = int.MinValue;
            for (int j = 0; j < nums.Length; j++)
            {
                var r = i - needs[nums[j]];
                if (r < 0)
                {
                    continue;
                }

                if (dp[i] < dp[r] + 1)
                {
                    dp[i] = dp[r] + 1;
                    ds[i] = nums[j];
                }
            }
        }
        
        var s = new StringBuilder();
        while (n > 0)
        {
            s.Append((char)('0' + ds[n]));
            n -= needs[ds[n]];
        }
        Console.WriteLine(s);
    }
}


Measured memory_bytes: 13396
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <random>
#include <cassert>
#include <numeric>
#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;

ll y[10000005];

int main() {
    int h, w; cin >> h >> w;
    char a[h][w];
    rep(i,h) rep(j,w) cin >> a[i][j];

    vector<int> haji(h),owa(h);
    rep(i,h){
        rep(j,w){
            if(a[i][j] == '#') {
                haji[i] = j;
                break;
            }
        }
        for(int j = w-1; j >= 0;j--){
            if(a[i][j] == '#'){
                owa[i] = j;
                break;
            }
        }
    }
    rep(i,h-1){
        if(owa[i] != haji[i+1]){
            cout << "Impossible" << endl;
            return 0;
        }
    }
    cout << "Possible" << endl;
}


Measured memory_bytes: 3624
s = input()
ws = ['dream', 'dreamer', 'erase', 'eraser']

# 後ろから見ていかないと dream + erase を dreamかdreamerかわかんない
while len(s) > 0:
  # print(s)
  for i in range(4):
    w = ws[i]
    if s.endswith(w):
      s = s[:-len(w)]
      break
  else:
    break

if len(s) > 0:
  print('NO')
else:
  print('YES')

Measured memory_bytes: 133752
H, W = map(int, input().split())
N = int(input())
a = [int(i) for i in input().split()]
ary = [[0]*W for _ in range(H)]
s = 1
h, w = 0, 0
for i, n in enumerate(a):
    while n > 0:
        ary[h][w] = i+1
        w += s
        if w < 0:
            w = 0
            s = 1
            h += 1
        elif w >= W:
            h += 1
            w = W-1
            s = -1
        n -= 1
for a in ary:
    print(*a)


Measured memory_bytes: 42096
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef LOCAL
    #define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define debug(...) 42
    #define eprintf(...) 42
#endif
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define FOREACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIGN(x) (((x)>0)?1:(((x)<0)?-1:0))
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; }
typedef long long ll;
#define vv(t) vector< t > 
#define CHC(mp, x) if(mp.end() != mp.find(x))
#define CHCV(mp, x) if(mp.end() != find(ALL(mp), x))
template<typename T>
inline T lcm(T a, T b) {return a / __gcd(a, b) * b;}
#define fi first
#define se second
#pragma endregion

void Main();
void solve(long long a, long long b);

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

void Main(){
    long long a;
    scanf("%lld",&a);
    long long b;
    scanf("%lld",&b);
    solve(a, b);
}

void solve(long long a, long long b){
    cout << ((a*b)%2?"Odd\n":"Even\n");
}



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

int a[3],m[3];

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

void solve(){
    int ans=1;
    for(int i=0;i<3;i++){
        int cnt=0;
        int p=1;
        do{
            p=(p*a[i])%m[i];
            cnt++;
        }while(p!=1);
        ans=lcm(ans,cnt);
    }

    cout<<ans<<endl;
}

signed main(){
    while(true){
        bool flag=false;
        for(int i=0;i<3;i++){
            cin>>a[i]>>m[i];
            flag|=a[i]|m[i];
        }

        if(flag)solve();
        else break;
    }
    return 0;
}

Measured memory_bytes: 1156
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main(){
	int q, num1, num2;
	string str, str2, str3;//str1=最初の文字列 str2=条件当てはめる
	cin >> str >> q;

	for (int i = 0; i < q; i++){
		cin >> str2 >> num1 >> num2;
		if (str2 == "replace"){
			cin >> str3;
			str = str.replace(num1, num2-num1+1, str3);
		}

		else if (str2 == "reverse"){
			while (num1<=num2){
				char tmp;
				tmp = str[num1];
				str[num1] = str[num2];
				str[num2] = tmp;
				num1++;
				num2--;
			}
		}

		else if (str2 == "print"){
			cout << str.substr(num1, num2-num1+1) << endl;
		}
	}

	return 0;
}


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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)x.size())
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}


/*{
}*/

using vi = vector<int>;
using vvi = vector<vi>;
using P = pair<int,int>;

//constexpr int mod = 1e9+7;
//constexpr int inf = 1<<30;

bool dp[100][100][32000];

signed main(){
  int h, w;
  cin >> h >> w;

  vvi a(h, vi(w)), b(h, vi(w));
  rep(i, 0, h) rep(j, 0, w) cin >> a[i][j];
  rep(i, 0, h) rep(j, 0, w) cin >> b[i][j];

  {
    int d = abs(a[0][0]-b[0][0]);
    dp[0][0][16000+d] = dp[0][0][16000-d] = true;
  }

  rep(i, 0, h) rep(j, 0, w) rep(k, 0, 32000) if(dp[i][j][k]){
    if(j+1 < w){
      int d = abs(a[i][j+1]-b[i][j+1]);
      dp[i][j+1][k+d] = dp[i][j+1][k-d] = true;
    }
    if(i+1 < h){
      int d = abs(a[i+1][j]-b[i+1][j]);
      dp[i+1][j][k+d] = dp[i+1][j][k-d] = true;
    }
  }

  int ans = 1e9;
  rep(k, 0, 32000){
    if(dp[h-1][w-1][k]) chmin(ans, abs(16000-k));
  }
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 248704
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define EPS 1e-9
#define ll long long
#define Pll pair<ll, ll>
#define Pii pair<int, int>
 
using namespace std;
struct edge{int from, to; ll cost;};

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

    int n, p;
    vector<int> v;
    while(true){
        cin >> n;
        if(n == 0) break;
        
        rep(n){
            cin >> p;
            v.push_back(p);
        }
        sort(all(v));
        cout << accumulate(v.begin()+1, v.end()-1, 0) / (n-2) << endl;
        v.clear();
    }
}

Measured memory_bytes: 3020
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T>
inline bool chmin(T &a, const T b) { return a > b && (a = b, true); }

template<class T>
inline bool chmax(T &a, const T b) { return a < b && (a = b, true); }

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	vector<vector<int>> d(N, vector<int>(N, INF));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			char c;
			cin >> c;
			if(c == '1') d[i][j] = 1;
		}
	}

	// 2部グラフなら一番遠い点との距離+1、そうでないなら-1が答えとなる

	vector<int> visited(N, -1);

	auto dfs = [&](auto &&f, auto now) -> bool {
		
		bool res = true;
		for (int i = 0; i < N; i++) {
			if (d[now][i] == 1) {
				if (visited[i] == -1) {
					visited[i] = (visited[now] ^ 1);
					res &= f(f, i);
				}
				else if ((visited[now] ^ visited[i]) == 0) return false;
			}
		}

		return res;

	};

	visited[0] = 0;
	if (!dfs(dfs, 0)) {
		cout << -1 << "\n";
		return 0;
	}

	for (int k = 0; k < N; k++) {
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				chmin(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i == j) continue;
			chmax(ans, d[i][j]);
		}
	}

	cout << ans + 1 << "\n";

	return 0;
}

Measured memory_bytes: 480
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define forr(i,a,n) for (int i = (a); i < (n); ++i)
#define rforr(i,a,n) for (int i = (a); i > (n); --i)
#define ALL(x) x.begin(),x.end()
#define LEN(X) ((int)(X).size())
#define CASET int _T; cin >> _T; forr(caset,0,_T)
#define int long long

main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    
    int n,x; cin >> n >> x;
    int a[2001]; forr(i,0,n) cin >> a[i];

    int cost = LLONG_MAX;
    int mincost[2000][2000];

    forr(i,0,n) {
        mincost[i][0] = a[i];
        forr(off,1,n) {
            mincost[i][off] = min(mincost[i][off-1], a[(i+off)%n]);
        }
    }    

    forr(off,0,n) {
        int sum = 0;
        forr(i,0,n) sum += mincost[i][off];
        cost = min(cost,sum+off*x);
    }
    cout << cost << '\n';


        
}

Measured memory_bytes: 31488
n = int(input())
h = list(map(int, input().split()))
maxl = [0]*n

for i in range(n-2,-1,-1):
  if h[i] >= h[i+1]:
    maxl[i] = maxl[i+1]+1
  else:
    maxl[i] = 0
  
tmp_max = max(maxl)
print(tmp_max)


Measured memory_bytes: 15020
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

signed main(){
    string s;
    cin >> s;
    bool f = false;
    s = s + "!?";
    rep(i, 0, s.size()){
        if(s[i] == s[i + 1]){
            cout << i + 1 << ' ' << i + 2 << endl;
            return 0;
        }
        if(s[i] == s[i + 2]){
            cout << i + 1 << ' ' << i + 3 << endl;
            return 0;
        }
    }
    cout << -1 << ' ' << -1 << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int H, W, N;
    cin >> H >> W >> N;
    printf("%d\n", (N+max(H, W)-1)/max(H, W));
    return 0;
}


Measured memory_bytes: 256
num = list(input())
length = len(num)
last = int(num[length  - 1])
if last == 2 or last == 4  or last == 5  or last == 7 or last == 9 :
    print("hon")
elif last == 0 or last == 1 or last == 6 or last == 8:
    print("pon")
else :
    print("bon")      


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

using namespace std;
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define rep(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define frep(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define fwr(x) { cout << x << '\n'; }

typedef complex<ld> cplex;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int inf = 1e9 + 7;
const ll linf = 1ll * inf * inf;
const int N = 10000000;
const int M = 1000000;
const int multipleTest = 0;
const double pi = acos(-1);

int n;

ll pw[M];
int f[N];

ll calc(int x) {
    if (x < M) return pw[x];
    else {
        if (x & 1) return calc(x - 1) * 10 % inf;
        else {
            ll tmp = calc(x >> 1);
            return tmp * tmp % inf;
        }
    }
}

void solve() {
    cin >> n;
    
    ll res = 0;
    
    pw[0] = 1;
    rep(i, 1, M) {
        pw[i] = pw[i - 1] * 10ll;
        if (pw[i] >= inf) pw[i] %= inf;
    }
    
    int last_j = 0;
    int cnt = 0;
    for (int i = 1; i < N; ++i) {
        if (i == pw[last_j]) {
            ++last_j;
            cnt++;
        }
        f[i] = cnt + f[i - 1];
    }
    
    
    int j = N - 1;
    for (int i = 1; i < N; ++i) {
        if (f[N - 1] - f[i - 1] >= n) {
            j = max(j, i);
            while (j < N - 1 && f[j] - f[i - 1] < n) ++j;
            while (j > i && f[j] - f[i - 1] > n) --j;
            if (f[j] - f[i - 1] == n) {
                ++res;
            }
        } else {
            int tmp = n - (f[N - 1] - f[i - 1]);
            if (!(tmp & 7)) {
                ++res;
            }
        }
    }
    
    for (int sl = 1; sl <= n / 8; ++sl) {
        if (n % sl == 0) {
            int digits = n / sl;
            ll tmp = calc(digits) - calc(digits - 1);
            res += tmp - sl + 1;
        } else {
            ++res;
        }
    }
    
    res %= inf;
    if (res < 0) res += inf;
    
    cout << res << '\n';
}

int main() {
#ifdef _LOCAL_
    freopen("inp.txt", "r", stdin);
    //    freopen("out.txt", "w", stdout);
#endif
    
    int Test = 1;
    if (multipleTest)
        cin >> Test;
    
    for(int i = 0; i < Test; ++i) {
        //        printf("Case #%d: ", i + 1);
        solve();
    }
#ifdef _LOCAL_
    cout<< "\n" << 1.0 * clock() / CLOCKS_PER_SEC << "\n";
#endif
}


Measured memory_bytes: 47232
#include <stdio.h>

int main() {
    int n,count=0,max=0;
    scanf("%d",&n);
    int h[n];
    for (int i=0; i<n; i++) {
        scanf("%d",&h[i]);
    }
    for (int i=0; i<n; i++) {
        if (max <= h[i]) {
            count++;
            max=h[i];
        }
    }
    printf("%d\n",count);
    
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(2147483647)

def main():
  N = int(input())
  dic = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0
  }
  for _ in range(N):
    dic[input()] += 1
  print(f'AC x { dic["AC"]}')
  print(f'WA x { dic["WA"]}')
  print(f'TLE x { dic["TLE"]}')
  print(f'RE x { dic["RE"]}')


if __name__=='__main__':
  main()

Measured memory_bytes: 9152
fun divCount(x: Int): Int {
  var count = 0
  var currentX = x
  while (currentX % 2 == 0) {
    count++
    currentX /= 2
  }
  return count
}

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val xs = readLine()!!.split(" ").map(String::toInt)
  val ans = xs.map(::divCount).min()!!
  println(ans)
}

Measured memory_bytes: 37708
#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;

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

  int N, M;
  cin >> N >> M;

  VI qs(M);
  cin >> qs;
  vector<bool> used(N+1);

  VI ans;
  for(int i=M-1;i>=0;--i){
	int x = qs[i];
	if(used[x]) continue;
	ans.PB(x);
	used[x] = true;
  }

  FOR(i,1,N+1)
	if(!used[i])
	  ans.PB(i);
  for(int x: ans) cout << x << endl;

  return 0;
}



Measured memory_bytes: 4300
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long int ll;

const ll INF = (ll)2e18;
const ll MOD = 1000000007LL;

ll S[100010];
ll dp[100010];
int main() {
    ll N, A, B; scanf("%lld%lld%lld", &N, &A, &B);
    if(A > B) swap(A, B);
    S[0] = S[1] = -INF;
    for(int i=0; i<N; i++) scanf("%lld", &S[i+2]);

    dp[1] = 1;
    int ptr = 1;
    int ub = 0;
    for(int i=2; i<N+2; i++) {
        if(S[i] - S[i-2] < A) {
            printf("0\n");
            return 0;
        }
        // current: i
        // prev: i-1

        // 二つ目の山に入れる
        int lb = ptr - 1;
        while(S[i] - S[ub+1] >= B) ub++;
        ll val = (lb >= ub ? 0 : dp[ub]);

        // 一つ目の山に入れる
        ll diff = S[i] - S[i-1];
        if(diff < A) {
            // dp[i-2] 以前の要素は全て 0 になる
            // 0 でない値が格納されているインデックスの下限は i-1 になり、
            // その値について、累積を解除
            ptr = i-1;
            dp[i-1] = (dp[i-1] - dp[i-2] + MOD) % MOD;
        }
        dp[i] = (dp[i-1] + val) % MOD;
    }

    printf("%lld\n", dp[N+1]);
    return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,e=0;
    cin>>a;
    int b[a];
    for(int i=0;i<a;i++) {
        cin>>b[i];
    }
    sort(b,b+a);
    for(int i=0;i<a;i++){
        if(b[i]!=b[i+1]) e++;
    }
    cout<<e<<endl;
}


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

typedef long long ll;

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    
    ll ans=0;
    vector<ll> cnt(N,0);
    int j=0;
    for(int i=0; i<N; i++){
        if(A[i]==0){
            j++;
        } else {
            cnt[j] += A[i];
        }
    }
    
    for(int i=0; i<N; i++){
        ans += cnt[i]/2;
    }
    
    cout << ans << endl;
}


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

int main() {
	int n,h_n;
	long long half = 10000000000;
	cin >> n;
	vector<long long>b(n + 1,0);
	
	for (int i = 1; i <= n; i++) {
		cin >> b.at(i);
		b.at(i) += b.at(i - 1);
	}

	for (int i = 1; i <= n; i++) {
		if (llabs((b[n] - b[i]) - (b[i] - b[0])) < half) {
			half = llabs((b[n] - b[i]) - (b[i] - b[0]));
			h_n = i;
		}
	}
	cout << half << endl;
}


Measured memory_bytes: 1792
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	a := readInt()
	b := readInt()
	t := readInt()
	fmt.Println((t / a) * b)
}

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

func readInt() int {
	i, e := strconv.Atoi(read())
	if e != nil {
		panic(e)
	}
	return i
}


Measured memory_bytes: 640
#include <stdio.h>
int main()
{
  int x,y,z,i,count;

  scanf("%d %d %d",&x,&y,&z);

  count=0;

  for(i=x;i<=y;i++)
  {
    if(z%i==0) count++;
  }

  printf("%d\n",count);
  return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

static const ull MAX = 1000000000000000000;

int main() {
    int N;
    cin >> N;
    vector<ull> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    ull ans = 1;
    sort(A.begin(), A.end());
    for (int i = 0; i < N; i++) {
        if (ans > 0) {
            if ( (MAX + (ans - 1)) / ans < A.at(i)) {
                cout << -1 << endl;
                return 0;
            }
        }
        ans *= A.at(i);
        if (ans > MAX) {
            cout << -1 << endl;
            return 0;
        } 
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main(void) {
    long n, k;
    cin >> n >> k;

    vector<long> a(n);
    for(auto &x: a) cin >> x, x--;

    vector<long> b(n+1);
    for(int i=1; i<=n; i++)
        b[i] = (b[i-1] + a[i-1]) % k;

    map<long,long> m;
    long r = 0;
    for(int i=0; i<=n; i++) {
        r += m[b[i]], m[b[i]]++;
        if(i>=k-1)
            m[b[i-(k-1)]]--;
    }

    cout << r << endl;
}


Measured memory_bytes: 15872
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let xs: Vec<usize> = (0..n).map(|_| sc.cin::<usize>() - 1).collect();
    let ys: Vec<usize> = (0..n).map(|_| sc.cin()).collect();
    let zs: Vec<usize> = (1..n).map(|_| sc.cin()).collect();
    let mut ans = 0;
    for i in 0..n {
        ans += ys[xs[i]];
        if i > 0 && xs[i - 1] + 1 == xs[i] {
            ans += zs[xs[i-1]];
        }
    }
    put!(ans);
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


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

#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()

typedef long long ll;

const char nl = '\n' ;
const ll MOD = 1e9 + 7;
int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0);
   int r, c; cin >> r >> c;
   char a[r+2][c+2];
   for(int i = 0; i < r+2; i++)
   {
      for(int j = 0; j < c+2; j++)
         a[i][j] = '#';
   }
   for(int i = 1; i <=r; i++)
   {
      for(int j = 1; j <= c; j++)
         cin >> a[i][j];
   }

   for(int i = 0; i <= r+1; i++)
   {
      for(int j = 0; j <= c+1; j++)
         cout << a[i][j];
      cout << nl;
   }


}


Measured memory_bytes: 3608
-- half-and-half.hs --- Half and Half

-- author: Seong Yong-ju <sei40kr@gmail.com>

solve :: Int -> Int -> Int -> Int -> Int -> Int
solve a b c x y =
  a_min * p + b_min * q + c2_min * r2
  where
    a_min = min a $ 2 * c
    b_min = min b $ 2 * c
    c2_min = min (2 * c) (a + b)
    r2 = min x y
    p = x - r2
    q = y - r2

main :: IO ()
main = do
  [a, b, c, x, y] <- map (read :: String -> Int) . words <$> getLine
  print $ solve a b c x y


Measured memory_bytes: 508
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(list(map(int,input().split())))
ans = 0
for i in range(N):
  S = 0
  for j in range(M):
    S += B[j]*A[i][j]
  S += C
  if S > 0:
    ans += 1
print(ans)

Measured memory_bytes: 3188
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
s = [0 for x in a] + [0]

r = 0
for i in range(n):
    s[i] = min(a[i], b[i] + r)
    r = min(b[i], b[i] + r - s[i])
else:
    s[n] = min(a[n], r)

print(sum(s))


Measured memory_bytes: 18468
s = input()
t = 'keyence'

idx = 0
for i in range(len(s)):
    if i < len(t):
        if s[i] != t[i]:
            idx = i
            break
    elif i == len(t):
        print('YES')
        exit()

for i in range(idx,len(s)):
    if s[:idx] + s[i:] == t:
        print('YES')
        exit()

print('NO')


Measured memory_bytes: 3060
s = input()

def remove_word_from_string(string, word):
  return ''.join(string.split(word))

# listの順番は、語尾がrのワードを先にしないと最終的にrが残ってしまう
# これだとワードの種類が多くなったときなどに使えなくなってしまうので
# もっと良い方法はないものだろうか...
ls = ["eraser", "erase", "dreamer", "dream"]

for word in ls:
  s = remove_word_from_string(s, word)
  
ans = "YES" if s == '' else "NO"

print(ans)

Measured memory_bytes: 3444
#include <iostream>
#include <array>

int main(){
  std::array<int, 4> a = {};
  std::array<int, 4> b = {};
  int hit = 0;
  int blow = 0;
  int N = 0;

  while(N <= 50 && std::cin >> a[0] >> a[1] >> a[2] >> a[3] && std::cin >> b[0] >> b[1] >> b[2] >> b[3]){
    

    for(int i = 0;i < 4;++i){
      for(int j = 0;j < 4;++j){
	if(a[i] == b[j] && i == j)
	  ++hit;
	if(a[i] == b[j] && i != j)
	  ++blow;
      }
    }
    std::cout << hit << " " << blow << std::endl;

    hit = 0;
    blow = 0;
    ++N;
  }
}



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

int main(){

    int n,k;
    cin>>n>>k;

    vector<int> d(k);

    rep(i,k)cin >> d[i];

    for(int i=n;;i++){
        int t=i;
        bool f=true;
        while(t>0){
            int te=t%10;
            rep(j,k){
                if(te==d[j]){
                    f=false;
                    break;
                }
            }
            t/=10;
        }
        if(f){
            cout << i << endl;
            break;
        }
    }

    return 0;
}

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

int main() {
  int n, x;
  cin >> n >> x;
  vector<int> m(101, 0);
  
  int mn = 1001001000, add = 0;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    add += m[i];
    if (m[i] < mn) mn = m[i];
  }
  int d = n + (x-add) / mn;
  
  cout << d << endl;
  
}



Measured memory_bytes: 256