akhauriyash/Code-Regression huggingface dataset:
N = int(input())
T_arr = []
for _ in range(N):
    T_arr.append(int(input()))
    

import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(T_arr))

Measured memory_bytes: 5332
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
int main(){
	//mahakal(),fast;
	ll n ;
	cin>> n ;
	ll arr[n];
	for(ll i=0;i<n ;i++)cin>>arr[i];
	ll mx=arr[0];		
	for(ll i=1;i<n ;i++){
		if(mx<arr[i]){
			mx=arr[i];
		}
		else if(mx-arr[i]>=2){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;

	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
using namespace std;
typedef long long ll;

const int INF = 1001001001;

int main() {
    int n; cin >> n;
    string s; cin >> s;
    if (n%2 != 0) {
        cout << "No" << endl;
        return 0;
    }
    for (int i = 0; i < n/2; i++) {
        if (s[i] != s[i+n/2]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
from sys  import stdin,stdout

import bisect

import math

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

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

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

def pr(n):
    stdout.write(str(n)+"\n")

def soe(limit):
    l=[1]*(limit+1)
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0

    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a=a%b
        b,a=a,b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r

def check(n,s):
    v=str(n)
    for i in v:
        if i in s:
            return False
    return True
    

    
def solve():
    n,k=mp()
    s=input().split()
    s=set(s)

    while True:
        if check(n,s):
            print(n)
            break
        else:
            n+=1
        

        
        

for _ in range(1):
    solve()
    


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

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

    double W, H, x, y;
    cin >> W >> H >> x >> y;
    cout << fixed << H * W / 2.0 << " ";
    if (x * 2 == W && y * 2 == H)
        cout << 1 << endl;
    else
        cout << 0 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9+7;

int modpow(int m, int n){
  if(n == 0) return 1;
  else if(n%2 == 0) return modpow(m*m%mod, n/2);
  else{
    return modpow(m, n - 1)*m%mod;
  }
}

signed main(){
  int m, n; cin >> m >> n;
  cout << modpow(m, n)%mod << endl;
}


Measured memory_bytes: 3100
S = input()

key = "keyence"

t = -1

for i in range(7):
    if not S[i] == key[i]:
        t = i
        break

if t == -1:
    t = 7

for i in range(1, 8):
    if not S[-i] == key[-i]:
        t += i - 1
        break

if t >= 7:
    print("YES")
else:
    print("NO")



Measured memory_bytes: 9088
public class Main {
 public static void main(String...args) {
  final java.util.Scanner sc = new java.util.Scanner(System.in);
   final int N = sc.nextInt();
   final int[] h = new int[N];
   for(int i = 0; i < N; i++)
     h[i] = sc.nextInt();
   int ans = 0;
   for(int i = 0, pre = 0; i < N; pre = h[i++])
     ans += Math.max(h[i] - pre, 0);
   System.out.println(ans);
 }
}

Measured memory_bytes: 23636
from sys import exit, setrecursionlimit
from itertools import product

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

def argmin(ll):
  ll = list(ll)
  return ll.index(min(ll))

setrecursionlimit(1000000)

(N, K) = reads()
parent = [x-1 for x in reads()]

result = 0
if parent[0] != 0:
  parent[0] = 0
  result += 1

children = [[] for _ in range(N)]
for i in range(1, N):
  children[parent[i]].append(i)

color = [0] * N

def walk(i):
  global result
  for x in children[i]:
    walk(x)
    if color[x] == 1 and parent[x] != 0:
      result += 1
  color[i] = min([K] + [color[x]-1 for x in children[i] if color[x] >= 2])

walk(0)

print(result)


Measured memory_bytes: 109604
def main():
     dic={'R':+1,'L':-1}
     s=input()
     ans=[0 for i in range(len(s))]
     ini_pre=None
     for i in range(len(s)):
          if i==0 or ini!=s[i]:
               ini=s[i]
               now=i
               move=dic[ini]
               while s[now]==ini:
                    now+=move
               if abs(now-i)%2==1:
                    ans[now-move]+=1
               else:
                    ans[now]+=1
          elif ini==s[i]:
               if abs(now-i)%2==1:
                    ans[now-move]+=1
               else:
                    ans[now]+=1
     print(" ".join(list(map(str,ans))))
     
     
if __name__ == '__main__':
     main()

Measured memory_bytes: 50864
#include <bits/stdc++.h>
#define s second
#define f first
#define pb push_back
#define endl '\n'
using namespace std;


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

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const ll MOD = 1e9 + 7;

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

	int N;
	cin >> N;

	map<int,int> M;

	for(int i = 0; i < N; i++){
		int x;
		cin >> x;
		M[x]++;
	}

	bool ok = 1;

	if(N & 1){
		for(auto x : M){
			ok &= (x.s == 2 || (x.f == 0 && x.s == 1));
		}
	}
	else{
		for(auto x : M){
			ok &= (x.s == 2 || (x.f == 1 && x.s == 1));
		}
	}

	if(!ok) cout << 0 << endl;
	else{
		ll ans = 1;
		for(int i = 0; i < N/2; i++) ans = (ans * 2) % MOD;
		cout << ans << endl;
	}

	return 0;
}


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

int main() {
 ll N,M;
 cin >> N >> M;
  if(M >= 2*N){
    cout << N+(M-2*N)/4 << endl;
  }
  else if(M < 2*N){
    cout << M/2 << endl;
  }

}

Measured memory_bytes: 256
#include <stdio.h>
int main (void){
    int x1,x2,x3,x4,y1,y2,y3,y4;
    int x,y;
    scanf("%d %d %d %d",&x1,&y1,&x2,&y2);

    x =x2 -x1;
    y =y2 -y1;

    x3 =x2 -y;
    y3 =y2 +x;

    x =x3 -x2;
    y =y3 -y2;

    x4 =x3 -y;
    y4 =y3 +x;

    printf("%d %d %d %d\n",x3,y3,x4,y4);

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < int(n); i++)
#define rep1(i,n) for (int i = 1; i <= int(n); i++)
#define repR(i,n) for (int i = int(n)-1; i >= 0; i--)
#define rep1R(i,n) for (int i = int(n); i >= 1; i--)
#define loop(i,a,B) for (int i = a; i B; i++)
#define loopR(i,a,B) for (int i = a; i B; i--)
#define all(x) (x).begin(), (x).end()
#define allR(x) (x).rbegin(), (x).rend()
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#ifdef LOCAL
#define dump(...) cerr << "[" << __LINE__ << ":" << __FUNCTION__ << "] ", my_dmp(#__VA_ARGS__, __VA_ARGS__)
void my_dmp(const char*) { cerr << endl; }
template <class T, class... U> void my_dmp(const char *s, T const& x, U const& ...y) { const char *o = "({[", *e = "]})"; for (int i = 0; *s != '\0'; cerr << *s++) { if (count(o,o+3,*s)) i++; if (count(e,e+3,*s)) i--; if (!i && *s == ',') break; } cerr << " = " << x; if (*s == ',') cerr << ", ", s++; my_dmp(s, y...); }
#else
#define dump(...)
#endif
using ll = long long;
#define int ll
template <class T> using pque_max = priority_queue<T>;
template <class T> using pque_min = priority_queue<T, vector<T>, greater<T> >;
template <class T, class = typename T::iterator, class = typename enable_if<!is_same<T, string>::value>::type>
ostream& operator<<(ostream& os, T const& v) { os << "{"; for (auto const& x : v) os << " " << x; return os << " }"; }
template <class T> istream& operator>>(istream& is, vector<T>& v) { for (auto& x : v) is >> x; return is; }
template <class T, class S> ostream& operator<<(ostream& os, pair<T,S> const& p) { return os << "(" << p.first << ", " << p.second << ")"; }
template <class T, class S> istream& operator>>(istream& is, pair<T,S>& p) { return is >> p.first >> p.second; }
struct my_Init { my_Init() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } my_init;

template <class T, size_t d, class = typename enable_if<(d == 0)>::type> constexpr auto make_v(T const& x = {}) { return x; }
template <class T, size_t d, class... U, class = typename enable_if<(d > 0)>::type> constexpr auto make_v(size_t n, U... x) { auto val = make_v<T,d-1>(x...); return vector<decltype(val)>(n, move(val)); }
template <class T> void quit(T const& x) { cout << x << endl; exit(0); }
template <class T> constexpr bool chmin(T& x, T const& y) { if (x > y) { x = y; return true; } return false; }
template <class T> constexpr bool chmax(T& x, T const& y) { if (x < y) { x = y; return true; } return false; }
template <class It> constexpr auto sumof(It b, It e) { return accumulate(b,e,typename iterator_traits<It>::value_type{}); }
const ll INF = (1LL<<62)-1; // ~ 4.6e18
////////////////////////////////

int32_t main() {
    int n; cin >> n;
    int mi = INF;
    for (int x = 1; x*x <= n; x++) {
        if (n%x) continue;
        chmin(mi,x+n/x-2);
    }
    cout << mi << "\n";
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
///...................................*****.................................................///
///        Author :  MD. Rakibul Islam ( mmdrakibul2912@gmail.com )                         ///
///                  Department of Computer Science                                         ///
///                  & Engineering,                                                         ///
///                  Comilla University , Bangladesh.                                       ///
///...................................*****.................................................///
using namespace std;
int main()
{
    long long int n, m=0, a, b, c, d, e, res;
    cin>>n>>a>>b>>c>>d>>e;
    m=min(a,min(b,min(c, min(d,e))));
    res=0;
    if(n%m==0)
        res=n/m;
    else
    {
        res=n/m+1;
    }
    cout<<res+4<<endl;
    return 0;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (H, W) = listOfIntg()
    val S = Array(H) { next().map { if(it == '#') 1 else 0 }.toIntArray() }
    for (h in 0 until H) {
        for (w in 0 until W) {
            if (S[h][w] == 1) {
                var f = false
                if (w >= 1 && S[h][w - 1] == 1) f = true
                if (w < W - 1 && S[h][w + 1] == 1) f = true
                if (h >= 1 && S[h - 1][w] == 1) f = true
                if (h < H - 1 && S[h + 1][w] == 1) f = true
                if (!f) {
                    println("No")
                    return
                }
            }
        }
    }
    println("Yes")
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfIntg(d: Int = 0) = listOfString().map { it.toInt() + d }


Measured memory_bytes: 36016
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[100020];
	for(int i = 1;i <= n;i++){
		cin>>a[i];
	}
	int cnt = 0;
	for(int i = 1;i <= n;i++){
		if(a[a[i]] == i)cnt++;
		//cout << a[i] << endl;
	}

	cout << cnt/2 << endl;
	return 0;
}

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

int h, w, color;
int ps[256];

void fill(int r, int c, int p, int xs[256], int y) {
  int i = (r << 4) | c;
  if( xs[i] != p ) return;
  xs[i] = y;
  int dr[4] = {1, 0, -1, 0};
  int dc[4] = {0, 1, 0, -1};
  for(int k = 0; k < 4; ++k) {
    int nr = r + dr[k];
    int nc = c + dc[k];
    if( not ( 0 <= nr and nr < h and 0 <= nc and nc < w ) ) continue;
    fill(nr, nc, p, xs, y);
  }
}

bool fs[256];
int count2(int r, int c, int p, int xs[256]) {
  int i = (r << 4) | c;
  if( xs[i] != p ) return 0;
  if( fs[i] ) return 0;
  fs[i] = true;
  int dr[4] = {1, 0, -1, 0};
  int dc[4] = {0, 1, 0, -1};
  int res = 1;
  for(int k = 0; k < 4; ++k) {
    int nr = r + dr[k];
    int nc = c + dc[k];
    if( not ( 0 <= nr and nr < h and 0 <= nc and nc < w ) ) continue;
    res += count2(nr, nc, p, xs);
  }
  return res;
}

int count(int r, int c, int p, int xs[256]) {
  for(int i = 0; i < 256; ++i) fs[i] = false;
  return count2(r, c, p, xs);
}


int solve(int x, int xs[256]) {
  if( x == 0 ) return count(0, 0, xs[0], xs);
  int res = -1;
  for(int i = 1; i <= 6; ++i) {
    if( x == 1 and i != color ) continue;
    if( xs[0] == i ) continue;
    int ys[256];
    for(int j = 0; j < 256; ++j) ys[j] = xs[j];
    fill(0, 0, ys[0], ys, i);
    res = std::max(res, solve(x - 1, ys));
  }
  return res;
}

int main() {
  for(;;) {
    scanf("%d %d %d", &h, &w, &color);
    if( h == 0 and w == 0 and color == 0 ) break;
    for(int i = 0; i < h; ++i) {
      for(int j = 0; j < w; ++j) {
        scanf("%d", &ps[(i<<4)|j]);
      }
    }
    int res = solve(5, ps);
    printf("%d\n", res);
  }
  return 0;
}

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

using namespace std;

int main() {
	int n;
	cin >> n;

	vector<int> a(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int ans = 0;
	while (1) {
		for (auto &x: a) {
			if (x % 2 == 0) {
				x /= 2;
			} else {
				cout << ans << endl;
				return 0;
			}
		}
		ans++;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int n;
int a[200007],b[200007],pset[200007];
long long ans=0;
queue <int> q;
int fset(int x){
	if(pset[x]<=0) return x;
	return pset[x]=fset(pset[x]);
}
void unite(int x,int y){
	x=fset(x);
	y=fset(y);
	if(x==y) return;
	if(pset[x]<=pset[y]){
		pset[x]+=pset[y];
		pset[y]=x;
	}
	else{
		pset[y]+=pset[x];
		pset[x]=y;
	}
}
bool cmp(int x,int y){
	return (a[x]<a[y] || (a[x]==a[y] && x<y));
}
int main(){
	ios_base::sync_with_stdio(0);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		pset[i]=-1;
		b[i]=i;
	}
	sort(b+1,b+1+n,cmp);
	for(int i=1;i<=n;i++){
		a[b[i]]=i;
	}
	for(int i=1;i<=n;i++) q.push(a[i]);
	for(int i=1;i<=n;i++){
		//cout<<b[i]<<endl;
		while(1){
			int x=q.front();
			q.pop();
			if(fset(x)!=fset(i)){
				unite(x,i);
			}
			else break;
		}
		ans-=pset[fset(i)]+1;
		pset[fset(i)]++;
		q.push(fset(i));
	}
	cout<<ans<<"\n";
}



Measured memory_bytes: 6080
import collections

# A = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()
N = int(input())
S = [input() for s in range(N)]

c = collections.Counter(S)
cmc = c.most_common()
nmc = c.most_common()[0][1]

ans = []
for cmc_ in cmc:
  if cmc_[1] == nmc:
    ans.append(cmc_[0])
  else:
    break

ans.sort()
[print(ans_) for ans_ in ans]

Measured memory_bytes: 59376
IDENTIFICATION DIVISION.
      PROGRAM-ID. 049A.
      DATA DIVISION.
      WORKING-STORAGE SECTION.
      01 C PIC X(1).
      
      PROCEDURE DIVISION.
      ACCEPT C.
      EVALUATE C
      WHEN "a"
      WHEN "i"
      WHEN "u"
      WHEN "e"
      WHEN "o"
      	DISPLAY "vowel"
      WHEN OTHER
      	DISPLAY "consonant"
	  END-EVALUATE.     
      
      STOP RUN.

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int A, B;
  cin >> A >> B;
  int ans = max(A, B) + min(max(A - 1, B), max(A, B - 1));
  cout << ans << "\n";
  return 0;
}

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

using namespace std;
#define PI 3.1415926535897932384626
#define ll long long
#define ull unsigned long long

#define all(x) x.begin(), x.end()
#define fo(i, n) for (i = 0; i < n; i++)
#define sortall(x) sort(all(x))

#define vi vector<int>
#define vs vector<string>
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, int> pii;
typedef vector<psi> vpsi;
typedef vector<psi> vpci;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
//=======================

const int MOD = 1'000'000'007;
const int N = 2e6 + 13;

//=======================
vi g[N];
int a[N];
int n, m, k;
//=======================

void solve()
{
    cin >> n;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    int s = 0;
    fo(k, n)
    {
        int x, y;
        cin >> x >> y;
        if (sqrt(pow(x, 2) + pow(y, 2)) <= m)
        {
            s++;
        }
    }
    cout << s << endl;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> count(N);
  
  for (int j = 0; j < M; j++) {
    int a, b;
    cin >> a >> b;
    count.at(a - 1) += 1;
    count.at(b - 1) += 1;
  }
  for (int i = 0; i < count.size(); i++) {
    cout << count.at(i) << endl;
  }
}


Measured memory_bytes: 3564
#include <iostream>
main(){int n,x,i;while(std::cin>>n,n){int dat[7]={};for(i=0;i<n;std::cin>>x,x=x/10>6?60:x,dat[x/10]++,i++);for(i=0;i<7;std::cout<<dat[i]<<'\n',i++);}}

Measured memory_bytes: 1160
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())

# 問題数分配列を作成 -> 正解判定用の関数
ac = [False] * n
wa = [0] * n

# まずはテーブルを作成する
for i in range(m):
    p, s = input().split()
    p = int(p) - 1

    if s == "AC":
        # 正解したことのある問題か確認
        ac[p] = True
    else:
        if ac[p] == False:
            wa[p] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)

Measured memory_bytes: 4596
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    n, h = LI()
    ab = LIR(n)
    ab.sort(reverse=True)
    amax = ab[0][0]
    ab.sort(key=lambda x: x[1], reverse=True)
    ans = 0
    hp = 0
    for a,b in ab:
        if b <= amax:
            break
        ans += 1
        hp += b
        if hp >= h:
            break
    ans += max(math.ceil((h-hp)/amax),0)    
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    D()


Measured memory_bytes: 29944
#include <iostream>
using namespace std;
int main(void){
    int i,n,a[31],year;
    a[1] = 1;
    a[2] = 2;
    a[3] = 4;
    for(i = 4; i < 31; i++){
        a[i] = a[i - 3] + a[i - 2] + a[i - 1];  //n[i]は1~30までの通り
    }
    while(true){
        cin >> n;
        if(n == 0){
            break;
        }
        else{
            year = a[n] / 3650;
            cout << year + 1 << endl;
        }
    }
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m, len;
#define inf 1000000000
ll dp[3005][3005];

string solve(string &s, string &t) {
    int i = 0, j = 0;
    string ans = "";
    while(len > 0) {
        if(s[i] == t[j]) {ans += s[i]; ++i, ++j, --len;}
        else {
            if(dp[i][j + 1] > dp[i + 1][j]) ++j;
            else ++i;
        }
    }
    return ans;
}

int dpp(string &s, string &t, int i, int j) {
    if(i >= n || j >= m) return 0;
    if(dp[i][j] != -1) return dp[i][j];
    if(s[i] == t[j]) return dp[i][j] = 1 + dpp(s, t, i + 1, j + 1);
    else return dp[i][j] = max(dpp(s, t, i + 1, j), dpp(s, t, i, j + 1));
}


int main() {
    string s, t;
    cin >> s >> t;
    memset(dp, -1, sizeof dp);
    n = s.size(), m = t.size();
    len = dpp(s, t, 0, 0);
    cout << solve(s, t);
}


Measured memory_bytes: 74592
//auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of };
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//   bitset<ビット数> s(tmp);
//   // (ビット列sに対する処理)
// }
// sort(配列変数.begin(), 配列変数.end());
// do {
//   // 順列に対する処理
// } while (next_permutation(配列変数.begin(), 配列変数.end()));
//const double PI = acos(-1); M_PI
// cout << fixed << setprecision(10);
#include <bits/stdc++.h>
#include <regex>
using namespace std;
#define _GLIBCXX_DEBUG 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end() //sort(all(vec)); ,reverse(all(vec));etc
int main(){
    int n;
    cin>>n;
    vector<int>a(n);
    vector<int>b(n);
rep(i,n){
    b.at(i)=0;
}
a.at(0)=0;
rep(i,n-1){
    cin>>a.at(i+1);
    b.at(a.at(i+1)-1)+=1;
}
rep(i,n){
    cout<<b.at(i)<<endl;
}
}


Measured memory_bytes: 4844
#include <bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
int main()
{
	int n;
	cin>>n;
	int arr[n];
	
	for(int i=0;i<n;i++) {
		cin>>arr[i];
	}
		
    ll ans=0;
	for(int i=0;i<n-1;i++)
		if(arr[i+1]<arr[i]) {
			ans+= arr[i]-arr[i+1];
			arr[i+1]=arr[i];
		}
	cout<<ans;   
}

Measured memory_bytes: 4368
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    ll n, a, b;
    cin >> n >> a >> b;
    VI h(n);
    for (i = 0; i < n; i++) cin >> h[i];
    ll l = 0ll;
    ll r = inf;
    while (r - l > 1) {
        ll mi = l + (r - l) / 2;
        ll cnt = 0;
        for (i = 0; i < n; i++) {
            if (h[i] <= b * mi) continue;
            cnt += (h[i] - b * mi + a - b - 1) / (a - b);
        }
        if (cnt > mi)
            l = mi;
        else
            r = mi;
    }
    cout << r << endl;
}

Measured memory_bytes: 4000
mod = 10 ** 9 + 7

def pow(x, n, mod = 10 ** 9 + 7)
  return 1 if n == 0
  return pow(x**2 % mod, n / 2, mod) if (n % 2) == 0
  return pow(x**2 % mod, n / 2, mod) * x % mod if (n % 2) == 1
end

# Permutation: n * (n-1) * …… * (n-k+1) (mod p); O(k)
def prm(n, k, m = 10**9+7)
  (0...k).inject(1){|res,i| res * (n-i) % m }
end

# combination: nPk / k! (mod p), note: p must be a prime number
def cmb(n, k, m = 10**9+7)
  k = n - k if k > n - k
  return prm( n, k, m ) * pow( prm(k, k), m-2, m ) % m
end

n,a,b = gets.split.map(&:to_i)

#何も選ばない1通りを除く
ans = pow(2,n,mod) - 1 - cmb(n,a) - cmb(n,b)
ans %= mod

puts ans

Measured memory_bytes: 1788
#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
#include <stdio.h>
#include<set>
#include<string>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<queue>
#include<stack>
#define ll long long
using namespace std;
long double pi = 3.14159265358979323846;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

char arr[11][11];

bool check() {
	for (int i = 1; i <= 10; i++)
		for (int j = 1; j <= 10; j++)
		{
			
			if (j <= 6)
			{
				
				bool b = 1;
				for (int k = j; k <= j + 4; k++)
					if (arr[i][k] != 'X')
					{
						b = 0;
						break;
					}
				if (b)
					return 1;
			}
			if (i <= 6) {
				
				bool b = 1;
				for (int k = i; k <= i + 4; k++)
					if (arr[k][j] != 'X')
					{
						b = 0;
						break;
					}
				if (b)
					return 1;
			}
			bool bo = 1;
			for (int a = i, b = j; a <= i + 4 && b <= j + 4; a++, b++)
			{
				
				if (a > 10 || b > 10)
				{
					bo = 0;
					break;
				}
				if (arr[a][b] != 'X')
				{
					bo = 0;
					break;
				}
			}
			if (bo)
				return 1;
		}
	return 0;

}

int main()
{
	int arr[] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
	int n;  cin >> n;
	cout << arr[n - 1];
			
	return 0;
}

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

#define      pb    push_back
#define      ff    first
#define      ss    second
#define      ll    long long int
#define      endl  "\n"
#define      FASTIO        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);


#define      TEST    int t ; cin >> t ; while( t -- )

const ll big = 10e7 + 11 ;

int  main (  ) {

    FASTIO ;

    ll ans = 0 ;

    int n ;
    cin >> n ;

    for( int i = 1 ; i <= n ; i++ ){
        if( i % 3 == 0 || i % 5 == 0 ) ;
        else  ans += i ;
    }

    cout << ans  ;


    return  0 ;
}


Measured memory_bytes: 3620
//103
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<algorithm>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<functional>

using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>

int H, W, h, w, A, B, C;
string s;

int main() {
	cin >> A >> B >> C;
	//int ans = max(A, max(B, C)) * 10 + A + B + C - max(A, max(B, C));
	cout << max(A,max(B,C))-min(A, min(B, C)) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

int main(void){
  int n,m,i,j,sum,k=0,max;
  int a[1000],b[1000];
  while(1){
    max = 0;
    scanf("%d",&n);
    scanf("%d",&m);
    if(n == 0 && m == 0){
      break;
    }
    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	if(i != j){
	  sum = a[i] + a[j];
	  if(sum > max && sum <= m){
	    max = sum;
	    b[k]=max;
	  }
	}
      }
    }
    k++;
  }
  for(i=0;i<k;i++){
    if(b[i] == 0){
      printf("NONE\n");
    }else{
      printf("%d\n",b[i]);
    }
  }
return 0;
}



Measured memory_bytes: 2032
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CStep solver = new CStep();
        solver.solve(1, in, out);
        out.close();
    }

    static class CStep {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = in.readIntArray(n);

            long answer = 0;
            int max = 0;
            for (int x : a) {
                if (x > max) {
                    max = x;
                } else {
                    answer += max - x;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] readIntArray(int n) {
            int[] x = new int[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextInt();
            }
            return x;
        }

    }
}



Measured memory_bytes: 54904
while True:
    l = input().split()
    if (l[1] == "?"):
        break
    elif(l[1] == "+"):
        print(int(l[0]) + int(l[2]))
    elif(l[1] == "-"):
        print(int(l[0]) - int(l[2]))
    elif(l[1] == "*"):
        print(int(l[0]) * int(l[2]))
    elif(l[1] == "/"):
        print(int(l[0]) // int(l[2]))

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

ll n, m, ans;
ll fact[2222222];
ll dp[1111111];
ll dp2[1111111];

long long mod_div(long long a,long long b){
	long long tmp = MOD - 2,c = b,ret = 1;
	while(tmp > 0){
		if(tmp & 1){
			ret *= c;ret %= MOD;
		}
		c *= c;c %= MOD;tmp >>= 1;
	}
	return a*ret%MOD;
}

ll nHr(ll n, ll r){
	ll A = n - 1;
	ll B = r;
	return mod_div(fact[A + B], fact[A] * fact[B] % MOD);
}

ll nCr(ll n ,ll r){
	if(r > n){
		return 0;
	}
	return mod_div(fact[n], fact[n - r] * fact[r] % MOD);
}

void init(){
	fact[0] = 1;
	for(ll i = 1;i < 2222222;i++){
		fact[i] = fact[i-1] * i % MOD;
	}
}

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

	cin >> n >> m;

	REP(i, 1111111){
		dp2[i] = nHr(n - 1, i);
		if(i){
			dp2[i] = (dp2[i] + dp2[i-1]) % MOD;
		}
	}
	REP(i, 1111111){
		dp2[i] = (dp2[i] * n) % MOD;
	}

	dp[0] = 1;
	for(ll i = 1;i < 1111111;i++){
		dp[i] = nHr(n, i);
		if(i > m){
			dp[i] = (dp[i] - dp2[i - (m+1)] + MOD) % MOD;
		}
	}

	for(ll i = 0;i <= m;i++){
		if((3 * m - i) % 2) {
			continue;
		}
		ll now_m = (3 * m - i) / 2;
		ll now_one = i;
		ll now = dp[now_m] * nCr(n, i);
		if(now_m >= m && i){
			ll tmp = nHr(n - 1, now_m - m) * nCr(n - 1, i - 1) % MOD;
			tmp = tmp * n % MOD;
			now = (now + MOD - tmp) % MOD;
		}
		//cout << i << " " << now_m << " " << dp[now_m] << " " << now << endl;
		ans = (ans + now) % MOD;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 34944
var
  i:longint;
  st:string;
 begin
   readln(st);
   for i:=length(st) downto 1 do
   if st[i]='F' then
   if (pos('C',st)<>0) and (pos('F',st)<>0) and (pos('C',st)<i) then
   begin
     writeln('Yes');
     halt;
   end;
   writeln('No'); 
 end.


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

int main(){
  int N; cin >> N;
  vector<int> A(N+1);
  A.at(0)=-1;
  for(int i=1;i<N+1;i++){
    cin >> A.at(i);
  }
  vector<int> B(N+1);
  B.at(0)=-1;
  for(int i=N;i>N/2;i--){
    B.at(i)=A.at(i);
  }
  int count=0;
  for(int i=N/2;i>=1;i--){
    for(int j=2;j<=N/i;j++){
      count+=B.at(i*j);
    }
    if(count%2==A.at(i)){
      B.at(i)=0;
    }
    else B.at(i)=1;
    count=0;
  }
  for(int i=1;i<N+1;i++){
    if(B.at(i)==1){
      count++;
    }
  }
  cout << count << endl;
  for(int i=1;i<N+1;i++){
    if(B.at(i)==1){
       cout << i << endl;
    }
  }
}      
  

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

typedef vector<int> vec;
typedef vector<vec> mat;

mat multi(const mat& A, const mat& B, int mod) {
  mat C(A.size(), vec(B[0].size()));
  for(int i = 0; i < A.size(); i++) {
    for(int j = 0; j < B.size(); j++) {
      for(int k = 0; k < B[0].size(); k++) {
	(C[i][k] += A[i][j]*B[j][k]) %= mod;
      }
    }
  }
  return C;
}

mat power(mat A, int n, int mod) {
  mat B(A.size(), vec(A.size()));
  for(int i = 0; i < A.size(); i++) B[i][i] = 1;
  while(n > 0) {
    if(n & 1) B = multi(B, A, mod);
    A = multi(A, A, mod);
    n >>= 1;
  }
  return B;
}

int dy[] = {-1, -1, 0, 0, 1, 1};
int dx[] = {-1, 0, -1, 1, 0, 1};
//int xx[40], yy[40];
//int mas[40][40];
int xx[100], yy[100];
int mas[40][40];

signed main(){
  int N, M, L;
  int tt = 0;
  while(cin >> N >> M >> L, N || M || L) {
    tt++;
    int num = 0;
    int s = 0, t = N-1;
    //vector<pair<int, int> > pos;
    //map<pair<int, int>, int> id;
    memset(xx, -1, sizeof(xx));
    memset(yy, -1, sizeof(yy));
    memset(mas, -1, sizeof(mas));
    for(int i = 0; i < N+N-1; i++) {
      if(i < N) t++;
      else s++;
      for(int j = s; j < t; j++) {
	//cout << num << " " << xx[num] << endl;
	//assert(xx[num] == -1);
	yy[num] = i, xx[num] = j;
	//cout << xx[num] << " " << j << endl;
	mas[i][j] = num;
	//pos.push_back(make_pair(i, j));
	//id[make_pair(i, j)] = num;
	num++;
      }
    }
    mat X(num, vec(1, 0));
    for(int i = 0; i < num; i++){
      cin >> X[i][0];
    }

    mat A(num, vec(num, 0));
    for(int i = 0; i < num; i++) {
      int x = xx[i], y = yy[i];
      //int x, y; tie(x, y) = pos[i];
      //cout << x << " " << xx[i] << endl;
      //assert(x == xx[i] && y == yy[i]);
      for(int j = 0; j < 6; j++) {
	int nx = x + dx[j], ny = y + dy[j];
	if(0 <= nx && nx < N+N-1 &&
	   0 <= ny && ny < N+N-1 &&
	   mas[ny][nx] != -1) {
	  //assert(id.count(make_pair(ny, nx)));
	  A[i][mas[ny][nx]] = 1;
	}
      }
      A[i][i] = 1;
    }

    auto res = power(A, L, M);
    auto ans = multi(res, X, M);
    int out = 0;
    for(int i = 0; i < ans.size(); i++) out += ans[i][0];
    cout << "Case " << tt << ": " << out << endl;
  }
  return 0;
}

Measured memory_bytes: 3256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1000000000;

int main() {
  //
  ll n, t;
  cin >> n >> t;
  vl a(n);
  rep(i, n) cin >> a[i];
  pll m = {a[n - 1], 1};
  pll profit = {0, 0};
  for (int i = n - 2; i >= 0; i--) {
    if (a[i] > m.first) {
      m = {a[i], 1};
    } else if (a[i] == m.first) {
      m.second++;
    } else {
      if (m.first - a[i] > profit.first) {
        profit.first = m.first - a[i];
        profit.second = 1;
      } else if (m.first - a[i] == profit.first) {
        profit.second++;
      }
    }
  }
  cout << profit.second << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
//#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> pll;
typedef long double ldouble;
typedef pair<double, double> pdd;

const double PI = acos(-1);
const double EPS = 1e-9;

const int MX = 100005;
const int MM = 1000000007;

int N;
int D[MX];

int main()
{
	scanf("%d", &N);
	int ch = -1, ans = 0;
	for(int i = 1; i <= N; i++) scanf("%d", D+i);
	for(int i = 1; i <= N; i++){
		if( ch == -1 ) ch = 0, ans++;
		else if( D[i] < D[i-1] ) ch |= 1;
		else if( D[i] > D[i-1] ) ch |= 2;
		if( ch == 3 ) ch = 0, ans++;
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static final String LEFT = "LEFT";
    public static final String RIGHT = "RIGHT";
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            if ("H".equals(strArr[0])) {
                if ("H".equals(strArr[1])) {
                    System.out.println("H");
                } else {
                    System.out.println("D");
                }
            } else {
                if ("H".equals(strArr[1])) {
                    System.out.println("D");
                } else {
                    System.out.println("H");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

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

int a,b;

int main(){
    cin>>a>>b;
    int x=min(a,b);
    int y=max(a,b);
    if((y-x)%2!=0){
        cout<<"IMPOSSIBLE"<<endl;
    }
    else{
        cout<<(y-x)/2+x<<endl;
    }
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  int d[N];
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  
  int ans = 0;
  for (int i = 0; i < N-1; i++) {
    for (int j = i+1; j < N; j++) {
      ans += (d[i] * d[j]);
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<list>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
#define MK make_pair
const ll E=1e18+7;
const ll MOD=1000000007;






int main(){
    string s;
    cin>>s;
    ll k;
    cin>>k;
    char j='1';
    for(int i=0;i<k;i++){
        if(s[i]!=j){j=s[i]; break;}
    }
    cout<<j<<endl;
    
    return 0;
}


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

#define f(i,a,b) for(int i=a;i<b;i++)
#define f1(i,a,b) for(int i=a;i<=b;i++)
#define int long long
using namespace std;
#define mod 1000000007
signed main()
{

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

    int d, t,s; cin >> d >> t >> s;
    double r = (double)d / s;
    if(r <= t)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3648
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.stdio;
import std.string;
import std.typecons;

immutable int NA = -1;

int solve (bool [] a, bool [] b)
{
	if (!any (b))
	{
		return (any (a)) ? NA : 0;
	}
	auto n = a.length.to !(int);

	auto b5 = b ~ b ~ b ~ b ~ b;
	auto lo = new int [n];
	auto hi = new int [n];
	foreach (i; 0..n)
	{
		if (a[i])
		{
			int p = i;
			while (!b5[p + n * 2])
			{
				p -= 1;
			}
			lo[i] = i - p;

			int q = i;
			while (!b5[q + n * 2])
			{
				q += 1;
			}
			hi[i] = q - i;
		}
		else
		{
			lo[i] = int.max;
			hi[i] = int.max;
		}
	}
	debug {writeln ("lo = ", lo);}
	debug {writeln ("hi = ", hi);}

	alias Pair = Tuple !(int, q{x}, int, q{y});

	int res = int.max / 2;
	foreach (delta; 0 - n * 1..1 + n * 1)
	{
		int cur = abs (delta);
		Pair [] p;
		foreach (i; 0..n)
		{
			int ca = a[i];
			int cb = b5[i + delta + n * 2];
			if (ca && !cb)
			{
				int clo = lo[i];
				if (delta < 0)
				{
					clo = max (0, clo - abs (delta));
				}
				int chi = hi[i];
				if (delta > 0)
				{
					chi = max (0, chi - abs (delta));
				}
				p ~= Pair (clo, chi);
				cur += 1;
			}
			if (!ca && cb)
			{
				cur += 1;
			}
		}

		sort (p);
		debug {writeln (delta, ": ", cur, ", ", p);}
		int maxLo = (p.empty) ? 0 : p[$ - 1].x;
		int maxHi = 0;
		int add = maxLo + maxHi;
		while (!p.empty)
		{
			maxHi = max (maxHi, p.back.y);
			p.popBack ();
			maxLo = (p.empty) ? 0 : p[$ - 1].x;
			add = min (add, maxLo + maxHi);
		}
		res = min (res, cur + add * 2);
		debug {writeln ("res = ", res);}
	}

	return res;
}

void main ()
{
	string s;
	while ((s = readln.strip) != "")
	{
		string t = readln.strip;
		auto a = s.map !(q{a == '1'}).array;
		auto b = t.map !(q{a == '1'}).array;
		writeln (solve (a, b));
	}
}


Measured memory_bytes: 5372
n, m = gets.split.map(&:to_i)
x = Array.new(m)
y = Array.new(m)
idxs = Array.new(m)
cnt = Array.new(n, 1)

m.times do |i|
    x[i], y[i] = gets.split.map(&:to_i)
    idxs[i] = i
end

idxs.sort_by!{|i| y[i]}

ans = Array.new(m)
m.times do |i|
   ii = idxs[i]
   ans[ii] = ("%06d" % x[ii]) + ("%06d" % (cnt[x[ii] - 1]))
   cnt[x[ii] - 1] += 1
end

m.times do |i|
    puts ans[i]
end

Measured memory_bytes: 14016
#include <cmath>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int k;
  cin >> k;

  int mod = 7;
  int cnt = 1;
  rep(i, k) {
    if (mod % k == 0) break;
    ++cnt;
    mod = (mod * 10 + 7) % k;
  }
  if (mod % k == 0) cout << cnt << endl;
  else cout << -1 << endl;

  return 0;
}

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

int main(){
  int n;
  cin >> n;
  int d[n];
  for(int i = 0;i < n;i++){
    cin >> d[i];
  }
  /**/
  long ans = 0;
  for(int i = 0;i < n;i++){
    for(int j = i + 1;j < n;j++){
      ans += d[i]*d[j];
    }
  }

  cout << ans << endl;
      
  return 0;
}


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

#define all(x) (x).begin(),(x).end()
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)

typedef long long ll;
const ll MOD = 1e9 + 7;
const int MAX = 2010000;

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

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

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main()
{   
    ll x, y;
    cin >> x >> y;

    if ((x+y)%3 || (2*x < y) || (2*y < x)) {
        cout << 0 << endl;
        return 0;
    }

    ll tmp_x=0, tmp_y=0;

    tmp_x = (2*y - x) / 3;
    tmp_y = (2*x - y) / 3;
    
    COMinit();
    cout << COM(tmp_x + tmp_y, tmp_x) << endl;

    return 0;
}



Measured memory_bytes: 47488
import java.util.*;
public class Main {
    public static void main(String[] args) {
        int a=0;
        int b=0;
        int c=0;
        int d=0;
        Scanner scan = new Scanner(System.in);
        a=scan.nextInt();
        b=scan.nextInt();
        c=scan.nextInt();
        d=scan.nextInt();
        while (true){
            c=c-b;
            a=a-d;
            //System.out.println("aoki:="+c);
            //System.out.println("takahasi:="+a);
            //System.out.println("  ");






            if(c<=0){
                System.out.println("Yes");
                break;
            }
            else if(a<=0){
                System.out.println("No");
                break;
            }

        }


    }


}



Measured memory_bytes: 35776
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()
    K = int(input())

    N = len(S)
    sub = set()
    for i in range(N):
        for j in range(1, K + 1):
            sub.add(S[i:i + j])

    sub = sorted(sub)
    ans = sub[K - 1]

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 4464
#include <algorithm>
#include <iostream>
#include <cstdio>

template <typename T>
void read(T& x)
{
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar());
    for (x = 0; isdigit(ch); x = x * 10 + (ch ^ 48), ch = getchar());
}

int main()
{
    int x = 0, cnt = 0;
    for (read(x); x; read(x))
        std::cout << "Case " << ++cnt << ": " << x << std::endl;
    return 0;
}


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

int main()
{
  int n;
  cin >> n;
  vector<double> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  for (int i = 1; i < n; i++) {
    a.at(i) = 0.5 * (a.at(i) + a.at(i - 1));
  }
  cout << a.at(n - 1) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[2000005];
int main()
{
    /*int n;
    cin >> n;
    cout << n+n*n+n*n*n << endl;*/
    string s,t;
    cin >> s>> t;
    int ans=0;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]!=t[i])
            ans++;
    }
    cout << ans << endl;
}


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

int main() {

  int n;
  cin >> n;
  int flag;
  int x;
  x=0;

int l, i=1, a[n];
a[0]= 0;
  while(cin>>l){
        a[i] = l;
      flag = 0;  
   for(int k=i-1;k >= 0;k--){  
          
   if(a[i] < a[k]){
       flag=1;
      break;
   }
        }
  if(flag==0){x=x+1;}
  i++;
  }
 
 cout << x;

}

Measured memory_bytes: 256
#include<bits/stdc++.h> 
using namespace std;
int main(int argc, char const *argv[])
{
	int x, ans = 0;
	cin >> x;
	for (int i = 1800; i >= 400; i-=200)
	{
		ans ++;
		if (x >= i)
			break;
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 3636
N = gets.chomp.to_i

counter = Array.new(100, 0)

for i in 1..N
  s = i.to_s
  if s[0] != '0' && s[-1] != '0'
    x = "#{s[0].to_i}#{s[-1].to_i}".to_i
  	counter[x] += 1
  end
end

c = 0
for i in 1..9
  for j in 1..9
    x = i * 10 + j
    y = i + j * 10
    c += counter[x] * counter[y]
  end
end
puts c

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
#define reset(a,b)	memset(a,b,sizeof(a))
int main()
{
	int chos[303],num[303],a[303][303],i,j,k,l,n,m,ans=410;
	cin>>n>>m;
	for(i=0;i<n;i++)
		for(j=0;j<m;j++)	cin>>a[i][j];
	reset(chos,0);
	for(i=0;i<m;i++)
	{
		reset(num,0);
		for(j=0;j<n;j++)
			for(k=0;k<m;k++)
				if(chos[a[j][k]]==0)
				{
					num[a[j][k]]++;
					break;
				}
		for(j=1,k=0,l=0;j<=m;j++)
		{
			if(num[j]>k)
			{
				k=num[j];
				l=j;
			}
		}
		ans=min(ans,k);
		chos[l]=-1;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640