akhauriyash/Code-Regression huggingface dataset:
n, m, l = map(int, input().split())

A = [[int(s) for s in input().split()] for i in range(n)]
B = [[int(s) for s in input().split()] for i in range(m)]

for x in range(n):
    o = []
    for y in range(l):
        sum = 0
        for z in range(m):
            sum += A[x][z] * B[z][y]
        o.append(str(sum))
    print(" ".join(o))

Measured memory_bytes: 8452
#include <stdio.h>

typedef long long ll;

ll lcm(ll a, ll b);
ll gcd(ll a, ll b);

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

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


int main(){
    int n,i;
    ll ans,t;

    scanf("%d",&n);

    ans=1;
    for(i=0;i<n;i++){
        scanf("%lld",&t);
        ans=lcm(ans,t);
    }

    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void){
    int a, b;

    scanf("%d %d", &a, &b);

    if(a == b){
        printf("Draw\n");
    }else if(a == 1){
        printf("Alice\n");
    }else if(b == 1){
        printf("Bob\n");
    }else{
        printf(a > b ? "Alice\n" : "Bob\n");
    }

    return 0;
}

Measured memory_bytes: 1684
#include <stdio.h>
int main(void){
    // Your code here!
    
    int n,time;
    scanf("%d %d",&n,&time);
    
    int i,j,c[n+1],t[n+1];
    for(i=0; i<n; ++i) scanf("%d %d",&c[i],&t[i]);
    
    int emp;
    for(i=0; i<n;++i){
        for(j=0; j<n;++j){
           
           if(c[i] < c[j]){
               
               emp = t[i];
               t[i] = t[j];
               t[j] = emp;
               
               emp = c[i];
               c[i] = c[j];
               c[j] = emp;
               
           } 
            
        }
    }
    
    
    //for(i=0; i<n;++i) printf("%d %d\n",c[i],t[i]);
    
    for(i=0; i<n; ++i){
        
        if(t[i] <= time){
            printf("%d",c[i]);
            break;
        }
        
        else if(i == n-1) printf("TLE");
        
    }
    
    
    
    return 0;
}


Measured memory_bytes: 128
while True:
    n=int(input())
    if n==0:
        break;
    elif n==1:
        print(input())
        continue;
    li=[input() for i in range(n)]
    index=0
    def pls(depth):
        k=0
        global index
        while len(li[index])>depth and li[index][depth-1]=='.':
            if (not li[index][depth]=='+') and (not li[index][depth]=='*'):
                k+=int(li[index][depth])
                index+=1
            elif li[index][depth]=='+':
                index+=1
                k+=pls(depth+1)
            elif li[index][depth]=='*':
                index+=1
                k+=prd(depth+1)
            if index==n:
                return k    
        else:
            return k
    def prd(depth):
        k=1
        global index
        while len(li[index])>depth and li[index][depth-1]=='.':
            if (not li[index][depth]=='+') and (not li[index][depth]=='*'):
                k*=int(li[index][depth])
                index+=1
            elif li[index][depth]=='+':
                index+=1
                k*=pls(depth+1)
            elif li[index][depth]=='*':
                index+=1
                k*=prd(depth+1)
            if index==n:
                return k
        else:
            return k
    if li[0]=='+':
        index+=1
        print(pls(1))
    elif li[0]=='*':
        index+=1
        print(prd(1))

Measured memory_bytes: 7632
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const long long inf2=0x3f3f3f3f3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
int dp[111][100011];
int n,k;
int a[101];
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=0;i<=k;i++)dp[0][i]=1;
	for(int i=1;i<=n;i++){
		for(int j=0;j<=k;j++){
			dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;
			if(j>=a[i]+1)dp[i][j]=(dp[i][j]+mod-dp[i-1][j-a[i]-1])%mod;
		}
		for(int j=0;j<k;j++)dp[i][j+1]=(dp[i][j+1]+dp[i][j])%mod;
	}
	printf("%d\n",(dp[n][k]-dp[n][k-1]+mod)%mod);
	return 0;
}

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

int n, m, q;
vector<int> a, b, c, d;
int ans = 0;

void dfs(vector<int> A) {
    if (A.size() == n+1) {
        int now = 0;
        rep(i,q){
            if (A[b[i]] - A[a[i]] == c[i]) now += d[i];
        }
        ans = max(ans, now);
        return;
    }

    A.push_back(A.back());
    while (A.back() <= m) {
        dfs(A);
        A.back()++;
    }
}

int main(void) {
    cin >> n >> m >> q;
    a = b = c = d = vector<int>(q);
    rep(i,q) cin >> a[i] >> b[i] >> c[i] >> d[i];
    
    dfs(vector<int>(1,1));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define int      long long int
#define MOD      1000000007
#define pb       push_back
#define pf		 push_front
#define vi       vector<int>
#define mi  	 map<int,int>
#define umi		 unordered_map<int,int>
#define pii      pair<int,int>
#define ff 		 first
#define ss 		 second
#define inf		 1e18
#define case	int t;cin>>t;while(t--)
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
int powm(int x, int y, int m = MOD) {
	x = x % m; int res = 1; while (y)
	{if (y & 1)res = res * x; res %= m; y = y >> 1; x = x * x; x %= m;} return res;
}
int modi(int a, int m = MOD) {return powm(a, m - 2, m);}
void pre()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int mx(int BITree[], int index)
{
	int m = 0;
	index = index + 1;
	while (index > 0)
	{
		m = max(m, BITree[index]);
		index -= index & (-index);
	}
	return m;
}
void upd(int BITree[], int n, int index, int val)
{
	index = index + 1;
	while (index <= n)
	{
		BITree[index] = max(BITree[index], val);
		index += index & (-index);
	}
}
int32_t main()
{	pre();
	//case
	{	int n;
		cin >> n;
		int h[n], p[n];
		for (int i = 0; i < n; i++)
			cin >> h[i];
		for (int i = 0; i < n; i++)
			cin >> p[i];
		int bit[n + 2] = {0}, dp[n + 2] = {0}, as = 0;

		for (int i = 0; i < n; i++)
		{	int vl = mx(bit, h[i] - 1);
			dp[i] = p[i] + vl;
			//cout << vl << " " << dp[i] << endl;
			upd(bit, n, h[i], dp[i]);
			as = max(as, dp[i]);
		}
		cout << as << endl;

	}
	return 0;
}

Measured memory_bytes: 6528
INF = 101010101

n, m = gets.split.map(&:to_i)
ds = Array.new(n){Array.new(n, INF)}
n.times{|i| ds[i][i] = 0}
es = readlines.map{|s| s.split.map(&:to_i)}
es.each{|e|
	ds[e[0] - 1][e[1] - 1] = ds[e[1] - 1][e[0] - 1] = e[2]
}
n.times{|k|
	dk = ds[k]
	n.times{|i|
		di = ds[i]
		t = di[k]
		next if t == INF
		n.times{|j|
			u = t + dk[j]
			di[j] = u if di[j] > u
		}
	}
}
puts es.count{|e| ds[e[0] - 1][e[1] - 1] != e[2]}


Measured memory_bytes: 2044
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define inf (int)(3e18)
#define P pair<int,int>
#define mod (int)(1e9+7)

template<class T> inline void chmin(T &a, T b) {
	a = min(a, b);
}
template<class T> inline void chmax(T &a, T b) {
	a = max(a, b);
}

int mod_pow(int x, int y, int m = mod) {
	int res = 1;
	x %= m;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i;
		res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)
		return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod ;
}
int perm[1000005];
void init_perm(){
	perm[0]=1;
	REP(i,1000005)perm[i]=perm[i-1]*i%mod;
}
int nCk(int x,int y){
	return perm[x]*mod_pow(perm[x-y],mod-2)%mod*mod_pow(perm[y],mod-2)%mod;
}

signed main() {
	init_perm();
	int n,k;cin>>n>>k;
	chmin(k,n-1);
	int ans=0;
	rep(i,k+1){
		int era=nCk(n,i);
		int p=nCk(n-1,n-i-1);
		ans+=era*p;
		ans%=mod;
	}
	cout<<ans<<endl;
}



Measured memory_bytes: 8192
n = int(input())
i = 1

listS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listH = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
listD = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]


while i < n+1:
    a, b = input().split()
    b = int(b)
    if a == 'S':
        listS.append(b)
    elif a == 'H':
        listH.append(b)
    elif a == 'C':
        listC.append(b)
    else:
        listD.append(b)
    i += 1

listSdup = [x for x in set(listS) if listS.count(x) == 1]
listHdup = [x for x in set(listH) if listH.count(x) == 1]
listCdup = [x for x in set(listC) if listC.count(x) == 1]
listDdup = [x for x in set(listD) if listD.count(x) == 1]

for i in range(len(listSdup)):
    print('S ' +  str(listSdup[i]))
for i in range(len(listHdup)):
    print('H ' +  str(listHdup[i]))
for i in range(len(listCdup)):
    print('C ' +  str(listCdup[i]))
for i in range(len(listDdup)):
    print('D ' +  str(listDdup[i]))    


Measured memory_bytes: 5616
// g++ -std=c++14

/*

Today might be the chance to grasp the chance to let your talent bloom.
May be tomorrow, the day after, or next year...
May be even when you are 30. I'm not sure if physique has anything to do with it
but if you think that it will never come, it probably never will.

- Tooru Oikawa.

*/


#include<bits/stdc++.h>

typedef long long ll;
typedef long double lld;
using namespace std;

#define endl "\n"
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define all(c) c.begin(),c.end()
#define inf 1000000000000000001
#define pii pair<int, int>
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
ll l=v.size();for(ll i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

#define int ll

void solve() {
    int k,x;
    cin >> k >> x;
    int num = k * 500LL;
    if(num >= x) cout << "Yes\n";
    else cout << "No\n";


}
int32_t main(){ _
    ll t;
    // cin >> t;
    t = 1;
    while(t--) solve();
}

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

int main(){
  string S;
  cin >> S;
  string divide[4]={"dream","dreamer","erase","eraser"};
  
  reverse(S.begin(),S.end());
  for(int i=0;i<4;i++) reverse(divide[i].begin(),divide[i].end());
  
  bool can =true;
  for(int i=0;i<S.size();){
    bool can2=false;
    for(int j=0;j<4;j++){
      string d=divide[j];
      if(S.substr(i,d.size()) == d){
        can2=true;
        i+=d.size();
      }
    }
    if(!can2){
      can=false;
      break;
    }
  }
  
  
  if(can) cout << "YES" << endl;
  else cout << "NO" << endl;
}

  
  
  


Measured memory_bytes: 512
#include <iostream> 
#include <vector> 
#include <algorithm> 
#include <bits/stdc++.h> 
#include <stdlib.h> 
#include <stdio.h> 
#include <functional> 
#include<math.h> 
#include<cstring>
using namespace std;
int main(void){
    // Your code here!
   int N;
   cin >> N;
   vector<int> vec(N);
   for(int i = 0; i < N; i++) cin >> vec.at(i);
   sort(vec.begin(),vec.end());
   reverse(vec.begin(),vec.end());
   long long int tate = 0, yoko = 0;
   int l = 0;
   
   for(int i = 0; i < N; i++){
       if( i+1 < N && vec.at(i) == vec.at(i+1)){
           tate = vec.at(i);
           vec.at(i+1) = -1;
           l++;
           if(l == 2) break;
           yoko = tate;
       }
       
   }
   cout << tate * yoko << endl;
   
}


Measured memory_bytes: 640
#include <stdio.h>
int a[10];
int dfs(int l,int r,int i){
  if(i==10)return 1;
  if(a[i]>l&&dfs(a[i],r,i+1))return 1;
  if(a[i]>r&&dfs(l,a[i],i+1))return 1;
  return 0;
}
int main(){
  int n;
  scanf("%d",&n);
  for(;n;n--){
    scanf("%d %d %d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9]);
    dfs(0,0,0)?printf("YES\n"):printf("NO\n");
  }
  return 0;
}

Measured memory_bytes: 0
## preprocessing
f = {0:1}
mod = 10**9 + 7
for i in range(1,3000):
    f[i] = i * f[i-1] % mod

def c(n, r):
    if n<r:
        return 1
    num = f[n]
    den = (f[r] * f[n-r]) % mod
    return (num * pow(den, mod-2, mod)) % mod

def solve(n):
    k = 1
    ans = 0
    while n - 2*k - 1 >= k-1:
        ans = (ans + c(n-2*k-1, k-1)) % mod
        k+=1

    return ans
    
    
s = int(input())

print(solve(s))


Measured memory_bytes: 9080
#include <vector>
#include <cstdio>
using namespace std;
typedef pair<int,int>pii;
main(){
	int n,x,i;
	for(;scanf("%d%d",&n,&x),n;printf("%d\n",x)){
		vector<pii>v;
		v.push_back(make_pair(x,1));
		for(i=1;i<n;i++){
			pii p=v.back();
			scanf("%d",&x);
			if(x==p.first)v.back().second++;
			else if(v.pop_back(),i&1){
				pii q=make_pair(0,0);
				if(v.size())q=v.back(),v.pop_back();
				v.push_back(make_pair(x,q.second+p.second+1));
			}else{
				v.push_back(p),v.push_back(make_pair(x,1));
			}
		}
		for(x=i=0;i<v.size();i++)if(!v[i].first)x+=v[i].second;
	}
}

Measured memory_bytes: 1032
#include <algorithm>
#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i <(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
const int INF=1000100010;
int main(){
  int n;cin>>n;
  string s[n];
  set<string> st;
  rep(i,n){
    cin>>s[i];
    st.insert(s[i]);
 }
 int ans=0;
 ans=st.size();
 cout<<ans<<endl;
}

Measured memory_bytes: 25484
n = int(input())
points = [list(map(int, input().split())) for _ in range(n)]
points = [[p[0] - points[0][0], p[1] - points[0][1]] for p in points[1:]]
print(sum([(points[i][0]*points[i+1][1] - points[i+1][0]*points[i][1]) / 2 for i in range(len(points) - 1)]))




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

int main()
{
	vector<int> sta;	// stack<int> sta; ??§??????	????????????push_back()???????????????push()??? pop_back()???????????????pop()?????????
	char c;
	while (cin >> c) {
		if (isdigit(c)) {
			int a;
			cin.putback(c);
			cin >> a;
			sta.push_back(a);
		}
		else {
			int a = sta.back(); sta.pop_back();
			int b = sta.back(); sta.pop_back();
			switch (c) {
			case '+':
				sta.push_back(b + a);
				break;
			case '-':
				sta.push_back(b - a);
				break;
			case '*':
				sta.push_back(b * a);
				break;
			}
		}
	}
	cout << sta[0] << endl;
	return 0;
}

Measured memory_bytes: 3160
import sys
import math

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    ans = int(math.floor(n / 1.08))

    if math.floor(ans * 1.08) == n:
        print(ans)
    elif math.floor((ans + 1) * 1.08) == n:
        print(ans + 1)
    else:
        print(":(")

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
import math

A, B, H, M = map(int, input().split())

h_rad = math.radians((H * 60 + M) / 2)
m_rad = math.radians(M * 6)

hx, hy = (A * math.sin(h_rad), A * math.cos(h_rad))
mx, my = (B * math.sin(m_rad), B * math.cos(m_rad))

d = ((hx - mx)**2 + (hy - my)**2)**0.5

print(d)


Measured memory_bytes: 9432
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;

/*
int calc(vi v,vi l){
int x = 0,y = 0,z = 0;
int cnt = 0;
rep0(i,l.size()){
if(v[i] == 1){
if(x != 0 and l[i] != 0){
cnt++;
}
x += l[i];
}
if(v[i] == 2){
if(y != 0 and l[i] != 0){
cnt++;
}
y += l[i];
}
if(v[i] == 3){
if(z != 0 and l[i] != 0){
cnt++;
}
z += l[i];
}
}
return abs(a-x)+abs(b-y)+abs(c-z)+cnt*10;
}
*/
int n,a,b,c;
int dfs(int cnt,int x,int y,int z,vi len){
  if(cnt == n){
    if(min({x,y,z}) > 0){
      return abs(x-a)+abs(y-b)+abs(z-c)-30;
    }else{
      return 10000;
    }
  }
  int i = dfs(cnt+1,x+len[cnt],y,z,len)+10;
  int j = dfs(cnt+1,x,y+len[cnt],z,len)+10;
  int k = dfs(cnt+1,x,y,z+len[cnt],len)+10;
  int l = dfs(cnt+1,x,y,z,len);
  return min({i,j,k,l});
}

int main(){
  cin >> n >> a >> b >> c;
  vi l(n);
  rep0(i,n){
    cin >> l[i];
  }
  /*
  int ans = INT_MAX;
  for(int i = 0; i < (1 << 2*n); i++){
  vi v(n);
  rep0(j,n){
  v[j] = (i >> j*2) & 3;
}
ans = min(ans,calc(v,l));
}
*/

cout << dfs(0,0,0,0,l);
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  
  int counter = 0;
  for (int n: A) {
    while (n % 2 == 0) {
      counter++;
      n /= 2;
    }
  }
  cout << counter << endl;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, s) = (v[0], v[1]);
    let a = read_vec::<usize>();
    let mut dp = vec![vec![0; s + 1]; n + 1];
    for i in 0..n {
        dp[i][0] = 1;
    }
    for i in 0..n {
        for si in 0..s + 1 {
            dp[i + 1][si] += dp[i][si];
            dp[i + 1][si] %= 998244353;
            if si + a[i] <= s {
                dp[i + 1][si + a[i]] += dp[i][si];
                dp[i + 1][si + a[i]] %= 998244353;
            }
        }
    }
    debug!(dp[n][0]);
    let ans = (1..n + 1)
        .map(|i| dp[i][s])
        .fold(0, |s, x| (s + x) % 998244353);
    println!("{}", ans);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 41212
while 1:
    (H, W) = [int(i) for i in input().split()]
    if H == W == 0:
        break
    for i in range(H):
        for j in range(W):
            if (i + j) % 2 == 0:
                print('#', end="")
            else:
                print('.', end="")
        print()
    print()


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

typedef double du ;
typedef string st ;
typedef long long ll ;

int main ()
{
    char s ;
    cin >> s ;
    if (s != 'z')
    {
        s += 1 ;
        cout << s << endl ;
    }

    return 0 ;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int,int> P;
struct E {int to,cost;};
int N,M,L,K,A,H,l,x,y,t;

int main() {
	while (cin>>N>>M>>L>>K>>A>>H, N) {
		vector<vector<E>> G(N*101+M+1);
		rep(i,L){
			cin >> l;
			rep(j,M){
				G[l*101+j].push_back(E{l*101+j+1,1});
			}
		}
		rep(i,K){
			cin>>x>>y>>t;
			rep(j,M-t+1){
				G[y*101+j+t].push_back(E{x*101+j,t});
				G[x*101+j+t].push_back(E{y*101+j,t});
			}
		}
		vector<int> d(N*101+M+1, 1e9);
		priority_queue<P,vector<P>,greater<P>> que;
		que.push(P(0, H*101+M));
		while (!que.empty()) {
			P p = que.top(); que.pop();
			if (d[p.second] <= p.first) continue;
			d[p.second] = p.first;
			for (E &e: G[p.second]) {
				if(d[e.to] > p.first+e.cost){
					que.push(P(p.first+e.cost, e.to));
				}
			}
		}
		int mn = *min_element(d.begin()+A*101, d.begin()+A*101+M+1);
		if (mn == 1e9) cout << "Help!\n";
		else cout << mn << endl;
	}
}


Measured memory_bytes: 5676
S = input()

def check(t):
  if len(t) >= 5 and (t[-5:] == 'dream' or t[-5:] == 'erase'):
    return True,t[:-5]
  elif len(t) >=6 and t[-6:] == 'eraser':
    return True,t[:-6]
  elif len(t) >= 7 and t[-7:] == 'dreamer':
    return True,t[:-7]
  else:
    return False,t

while(len(S) > 0):
  flag,S = check(S)
  if not flag:
    print('NO')
    exit()
print('YES')

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

int main() {
	int N, L, i, sum;

	scanf("%d %d", &N, &L);

	sum = (L - 1) * (N - 1);

	for (i = 1; i <= N; i++) {
		sum = sum + i;
	}

	if (L >= 0) {
		sum--;
	}
	else if(abs(L - 1) > N) {
		sum = sum - N;
	}
	else {
		sum = sum - abs(L - 1);
	}

	printf("%d", sum);

	return 0;
}

Measured memory_bytes: 128
//
//  main.c
//  q_03
//
//  Created by k19104kk on 2020/08/29.
//  Copyright © 2020 AIT. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {
    long long n;
    scanf("%lld", &n);
    
    long long ai[n];
    
    for (int i=0; i<n; i++) {
        scanf("%lld", &ai[i]);
    }
    
    long long result = 0;
    long long initial = 0;
    
    long long waru = 1000000007;
    
    for (int i=0; i<n-1; i++) {
        initial += ai[i]%waru;
        result += (initial%waru) * (ai[i+1]%waru);
        result %= waru;
    }
    
    printf("%lld\n", result);
    return 0;
}


Measured memory_bytes: 3208
N = int(input())

towns = []
for i in range(N):
    x, y = map(int, input().split())
    towns.append((i, x, y))

# x, y座標の値でソートして、隣接する街の間の道を、edgesに追加する
edges = []
for xy in [1, 2]:
    towns.sort(key=lambda t: t[xy])
    for i in range(N - 1):
        edges.append((towns[i + 1][xy] - towns[i][xy], towns[i][0], towns[i + 1][0]))

# costでソートする
edges.sort()

# 素集合データ構造
parent = [i for i in range(N)]
rank = [0 for i in range(N)]

def find(v):
    if parent[v] != v:
        parent[v] = find(parent[v])
    return parent[v]

def union(a, b):
    rootA = find(a)
    rootB = find(b)

    if rootA == rootB:
        return
    if rank[rootA] < rank[rootB]:
        parent[rootA] = rootB
    else:
        parent[rootB] = rootA
        if rank[rootA] == rank[rootB]:
            rank[rootA] += 1

# 最小全域木を求める（クラスカル法）
numTree = N
ans = 0
for cost, v1, v2 in edges:

    if find(v1) != find(v2):
        union(v1, v2)
        ans += cost
        numTree -= 1

    if numTree == 1:
        break

print(ans)


Measured memory_bytes: 47980
package main

import (
	"fmt"
)

func main() {
	var a, b, c, x int
	fmt.Scan(&a, &b, &c, &x)

	count := 0
	for i := 0; i <= a; i++ {
		for j := 0; j <= b; j++ {
			sum := i * 500 + j * 100
			if sum == x {
				count++
				continue
			}

			if sum > x {
				break
			}

			diff := x - sum
			if (diff / 50) <= c {
				count++
				continue
			}
		}
	}

	fmt.Println(count)
}


Measured memory_bytes: 512
def s():
 def b(M,x,y,n=1):
  M[x][y]=0;a=n
  for p,q in[(-1,0),(0,-1),(1,0),(0,1)]:
   if M[x+p][y+q]:
    t=b(M,x+p,y+q,n+1)
    if a<t:a=t
  M[x][y]=1
  return a
 for e in iter(input,'0'):
  n,m=int(e),int(input())
  P=[[0]*(n+2)for _ in[0]*(m+2)]
  for i in range(m):P[i+1][1:-1]=map(int,input().split())
  print(max(b(P,i,j)for i in range(1,m+1)for j in range(1,n+1)if P[i][j]))
if'__main__'==__name__:s()


Measured memory_bytes: 5728
import decimal
a, b, c = map(int, input().split())
d = 0.5
decimal.getcontext().prec = 2750
a = decimal.Decimal(a)
b = decimal.Decimal(b)
c = decimal.Decimal(c)
d = decimal.Decimal(d)
if a ** d + b ** d < c ** d:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 5076
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int a, b;
    cin >> a >> b;
    if(a%2 == 0 || b%2==0){
        cout << "No";
        return 0;
    }
    else if(a%2==1 && b%2==1){
        cout << "Yes";
        return 0;
    }
    else{
        cout << "No";
        return 0;
    }
}

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

using namespace std;

int main(void){
  char tmp;
  string str;
  int times;

  while(getline(cin, str)){
	if(str.empty()) break;
	istringstream iss(str);

	for(int j=0;j<str.size();){
	  iss >> tmp;
	  j++;
	  if(tmp != '@'){
		cout << tmp;
	  }else{
		iss >> tmp;
		j++;
		times = tmp - '0';
		iss >> tmp;
		j++;
		for(int i=0;i<times;i++){
		  cout << tmp;
		}
	  }
	}
	cout << endl;
  }
}

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

int main()
{
    char ch;
    cin >> ch;
    if(ch == 'A')
        cout << 'T' << endl;
    else if(ch == 'T')
        cout << 'A' << endl;
    else if(ch == 'G')
        cout << 'C' << endl;
    else
        cout << 'G' << endl;
}

Measured memory_bytes: 256
a = [int(i) for i in raw_input().split()]
b = [int(i) for i in raw_input().split()]
c = [(a[i]/100.0,b[i]/100.0,(a[i]+b[i])/100.0,a[i]*1.0/(a[i]+b[i])) for i in range(len(a)) if a[i]+b[i]>0]
n = len(c)
c.sort(key=lambda item: item[3], reverse=True)
u = [0] * n
res = 1
for i in range(n):
    du = min(res / (c[i][2]), 1)
    u[i] = du
    res -= du * c[i][2]
    if res <=0:
        break
ans = 0
for i in range(n):
    ans += c[i][0] * u[i]

print ans


Measured memory_bytes: 2696
/* Copyright 2016 AcrossTheSky */
#include <iostream>
#include <cstdio>
#include <utility>
#include <cassert>
#include <map>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <sstream>
#include <fstream>
#include <string>
#include <cmath>
#include <algorithm>
#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define PER(i, a, b) for (int i = (a); i >= (b); --i)
#define RVC(i, c) fot (int i = 0; i < (c).size(); ++i)
#define RED(k, u) for (int k = head[(u)]; k; k = edge[k].next)
#define SQR(k) (k) * (k)
#define lowbit(x) ((x) & (-(x)))
#define CL(x, v) memset(x, v, sizeof x)
#define MP std::make_pair
#define PB push_back
#define FR first
#define SC second
#define rank rankk
#define next nextt
#define link linkk
#define index indexx
#define abs(x) ((x) > 0 ? (x) : (-(x)))
using namespace std;
typedef long long LL; typedef pair<int, int> PII;

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

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

template<class T> inline
void read(T *a) {
    char c;
    while (isspace(c = getchar())) {}
    bool flag = 0;
    if (c == '-') flag = 1, *a = 0;
    else
        *a = c - 48;
    while (isdigit(c = getchar())) *a = *a * 10 + c - 48;
    if (flag) *a = -*a;
}

const int mo = 1000000007;
template<class T>
T pow(T a, T b, int c = mo) {
    T res = 1;
    for (T i = 1; i <= b; i <<= 1, a = 1LL * a * a % c) if (b & i) res = 1LL * res * a % c;
    return res;
}
/*======================= TEMPLATE =======================*/
const int N = 3001;
int c[N][N];
int f[N][N];
char s[N], t[N], t2[N];
int n, m;
int l[N], r[N];
int k;
int dp() {
    f[0][0] = 1;
    REP(i, 1, n) l[i] = l[i - 1] + (t[i] == '1');
    REP(i, 1, n) r[i] = r[i - 1] + (t2[i] == '1');
    REP(i, 1, n) {
        REP(j, l[i], r[i]) {
            f[i][j] = (f[i][j] + f[i - 1][j]) % mo;
            if (j)
                f[i][j] = (f[i][j] + f[i - 1][j - 1]) % mo;
        }
    }
    return f[n][k];
}
int main() {
    cin >> n >> m;
    k = 0;
    scanf("%s", s + 1);
    REP(i, 1, n) if (s[i] == '1') ++k;
    REP(i, 1, m) read(l + i), read(r + i);
    REP(i, 0, n) {
        c[i][0] = c[i][i] = 1;
        REP(j, 1, i - 1) c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mo;
    }
    REP(i, 1, n) t[i] = s[i];
    REP(i, 1, m) sort(t + l[i], t + r[i] + 1);
    REP(i, 1, n) t2[i] = s[i];
    REP(i, 1, m) sort(t2 + l[i], t2 + r[i] + 1, greater<char>());
    cout << dp() << endl;
    return 0;
}


Measured memory_bytes: 40064
<?php
fscanf(STDIN, "%d", $N);
$xx = $yy = [];
for ($i = 0; $i < $N; $i++) {
    fscanf(STDIN, "%d %d", $x[$i], $y[$i]);
}
$ans = $N;
$xx = $yy = [];
for ($i = 0; $i < $N; $i++) {
    for ($j = $i + 1; $j < $N; $j++) {
        $xx[] = $x[$i] - $x[$j];
        $yy[] = $y[$i] - $y[$j];
    }
}
$modal = array_pad(array(), $N, 1);
foreach ($xx as $k => $dummy) {
    $a = $modal;
    for ($i = 0; $i < $N; $i++) {
        for ($j = $i + 1; $j < $N; $j++) {
            if ($y[$i] - $y[$j] === $yy[$k] && $x[$i] - $x[$j] === $xx[$k]) {
                $a[$j] = 0;
            }
            if ($y[$j] - $y[$i] === $yy[$k] && $x[$j] - $x[$i] === $xx[$k]) {
                $a[$i] = 0;
            }
         }
    }
    $ans = min($ans, array_sum($a));
}
printf("%d", $ans);

Measured memory_bytes: 4604
import java.io.*;
import java.util.*;
import java.math.*;
import java.util.concurrent.*;

class Main
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	
    public static void main(String args[]) throws Exception
    {
		int n=sc.nextInt();long k=sc.nextLong();long[] a=new long[n],b=new long[n];
		
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextLong();b[i]=sc.nextLong();
		}
		
		List<Long> list=new ArrayList<>();list.add(k);long now=0;
		
		for(int i=29;i>=0;i--)
		{
			if((k&(1<<i))!=0)
			{
				long add=(1<<i)-1;
				
				list.add(now|add);
				
				now=now+(1<<i);
			}
		}
		
		long max=0;
		
		for(int i=0;i<list.size();i++)
		{
			long curr=0;now=list.get(i);
			
			List<Integer> list2=new ArrayList<>();
			
			for(int j=29;j>=0;j--)
			{
				if((now&(1<<j))==0)
				{
					list2.add(j);
				}
			}
			
			for(int j=0;j<n;j++)
			{
				boolean add=true;
				
				for(int x:list2)
				{
					if((a[j]&(1<<x))!=0)
					{
						add=false;break;
					}
				}
				
				if(add)
				{
					curr+=b[j];
				}
			}
			
			max=Math.max(max,curr);
		}
		
		out.println(max);out.close();
    }
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;

int main(){

  ll n;cin>>n;
  ll a[n];rep(i,0,n)cin>>a[i];
  out(*min_element(a,a+n)<<" "<<*max_element(a,a+n)<<" "<<accumulate(a,a+n,(ll)0));


  return 0;
}



Measured memory_bytes: 3192
package main

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

func min(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	n, a, b := nextInt(), nextInt(), nextInt()
	ans := a*(n/(a+b)) + min(n%(a+b), a)
	puts(ans)
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

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

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

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

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
def main():
    c = [[int(s) for s in input().split()] for _ in range(3)]
    if solve(c):
        print('Yes')
    else:
        print('No')

def solve(c):
    for i in range(1, 3):
        for j in range(1, 3):
            if c[i][j] - c[i][0] != c[0][j] - c[0][0]:
                return False
    
    return True

main()


Measured memory_bytes: 3060
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

string a,b,c;
char nextP;
bool gameover;

void func(char n){
  if(n=='a'){
    if(a.size()==0){
      gameover = true;
      return;
    }
    nextP = a[0];
    a.erase(a.begin());
  }
  if(n=='b'){
    if(b.size()==0){
      gameover = true;
      return;
    }
    nextP = b[0];
    b.erase(b.begin());
  }
  if(n=='c'){
    if(c.size()==0){
      gameover = true;
      return;
    }
    nextP = c[0];
    c.erase(c.begin());
  }
  
}

int main(){
  cin >> a >> b >> c;
  gameover = false;
  nextP = 'a';
  while(gameover==false){
    func(nextP);
  }
  
  printf("%c",toupper(nextP));
  
  return 0;
}

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

int main() {
  int n, count = 0;
  cin >> n;
  int bars[n];
  for (int i = 0; i < n; i++) {
    cin >> bars[i];
  }
  
  for (int i = 0; i < n - 2; i++) {
    int a = bars[i];
  	for (int j = i + 1; j < n - 1; j++) {
      int b = bars[j];
      for (int k = j + 1; k < n; k++) {
        int c = bars[k];
        if (a != b && b != c && c != a && a < b + c && b < c + a && c < a + b) {
          count++;
        }
      }
    }
  }
  
  cout << count;
  
  return 0;
}

Measured memory_bytes: 3620
//package src.com.jetman.atcoder;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @description:
 * @author: Jetman
 * @create: 2020-08-29 14:39
 **/
public class Main {

    Scanner sc = new Scanner(System.in);

    long MOD = 1000000000 + 7;

    int[] fa;
    int fa(int p) {
        return fa[p] == p ? p : (fa[p] = fa(fa[p]));
    }

    private void slove() {

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

        fa = new int[n+1];
        for (int i = 0; i < n; i++) {
            fa[i] = i;
        }
        for (int i = 0; i < m ; i++) {
            int l = sc.nextInt();
            int r = sc.nextInt();
            int lfa = fa(l);
            int rfa = fa(r);
            if (lfa != rfa) {
                fa[rfa] = lfa;
            }
        }

        int[] nums = new int[n+1];
        for (int i = 1; i <= n; i++) {
            int ifa = fa(i);
            nums[ifa]++;
        }

        long ans = 0;

        System.out.println(Arrays.stream(nums).max().getAsInt());

    }

    public static void main(String[] args) {
        new Main().slove();
    }
}


Measured memory_bytes: 60812
def main():
    a = int(input())
    lists= [int(input()) for _ in range(a)]
 
    temp = lists.copy()
    first = max(temp)
    temp.remove(first)
    second = max(temp)
 
    for i in range(a):
        if lists[i] == first:
            print(second)
        else:
             print(first)
 
if __name__ == '__main__' :
    main()

Measured memory_bytes: 14100
#include <iostream>
#include<bits/stdc++.h>
#define  ll long long
 using namespace std;
int dp[3000003][3],sum[3000003][3];
int main()
{
  int t;
  cin>>t;
  string s;
  cin>>s;
  if(t>=3200)cout<<s;
  else cout<<"red";
return 0;
}

Measured memory_bytes: 384
#include<stdio.h>

int main()
{
  int i,n[10000],count=1,temp;

  while(1){
    scanf("%d",&n[count]);
    if(n[count]==0)
      break;
    count++;
  }

  for(i=1;i<count;i++)
    printf("Case %d: %d\n",i,n[i]);
  
  return 0;
}

Measured memory_bytes: 636
n = gets.to_i
nums = gets.split.map(&:to_i)
count = 0
for i in 0..n-2
  minid = i
  for k in i..n-1 do
    if nums[minid] > nums[k]
      minid = k
    end
  end
  #print i != minid
  if i != minid
    nums[minid], nums[i] = nums[i], nums[minid]
    count += 1
  end
  #puts nums.join(" ")
end
puts nums.join(" "), count


Measured memory_bytes: 6876
#include<stdio.h>

int binarySearch(int A[],int n,int key){
    int left=0,right=n,mid=(left+right)/2;
    while (left<right){
        mid=(left+right)/2;
        if (A[mid]==key){
            return 1;
        }else if (A[mid]<key){
            left=mid+1;
        }else {
            right=mid;
        }
    }
    return 0;
}

int main(){
    int i,n,A[1000000],q,key,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    
    scanf("%d",&q);
    for (i=0;i<q;i++){
        scanf("%d",&key);
        if(binarySearch(A,n,key)) sum++;
    }
    printf("%d\n",sum);
    return 0;
}


/*global version*/
/*
#include<stdio.h>
int A[1000000],n;


int binarySearch(int key){
    int left=0;
    int right=n;
    int mid;
    while (left<right){
        mid=(left+right)/2;
        if (A[mid]==key){
            return 1;
        }else if (A[mid]<key){
            left=mid+1;
        }else {
            right=mid;
        }
    }
    return 0;
}

int main(){
    int i,q,key,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    
    scanf("%d",&q);
    for (i=0;i<q;i++){
        scanf("%d",&key);
        if(binarySearch(key)) sum++;
    }
    printf("%d\n",sum);
    return 0;
}

*/


Measured memory_bytes: 2092
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod =1e+9+7;

const int dy[4]={0,1,0,-1};
const int dx[4]={1,0,-1,0};
const ll INF=1e10;

int main(){
    ll d,s,t; cin>>d>>s>>t;
    if(s*t>=d)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}














































































Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>
#include <random>
#include <list>
#include <numeric>
#include <chrono>
#include <set>


#define rep(i,p,q) for(ll i = p;i < q;i++)
#define ll long long

using namespace std;

vector<vector<ll>> graph;
vector<ll> query;
vector<ll> ans;
vector<ll> visited;


const long long MAX_N = 1 << 17;

long long dat[2 * MAX_N - 1];

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

ll pow(ll a, ll b) {
	vector<ll> d = vector<ll>((ll)(log(b)) + 2);
	d[0] = a;
	rep(i, 1, d.size()) d[i] = d[i - 1] * d[i - 1];
	ll ret = 1;
	rep(i, 0, log(b) + 1) {
		if (b & 1 << i) ret *= d[i];
	}
	return ret;
}

//144 C
int main(void) {
	ll n;
	cin >> n;
	ll ans = 1e13;
	rep(i, 1, sqrt(n) + 1) {
		if (n % i == 0) {
			ans = min(ans, i + n / i - 2);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

int main() {
	int A,B,C,X,ans=0;
	cin>>A>>B>>C>>X;
	for(int i=0;i<A+1;i++)
	{
		for(int j=0;j<B+1;j++)
		{
			for(int k=0;k<C+1;k++)
			{
				if(i*500+j*100+k*50==X)ans++;
			}
		}
	}
	cout<<ans;
	}

Measured memory_bytes: 256
# ABC 79
def main():
    MAX = 10**6
    H,W = list(map(int, input().split()))
    costs = [list(map(int, input().split())) for i in range(10)]
    to_ones = [MAX] * 10
    to_ones[1] = 0
    visited = set([1])
    un_visited = set([i for i in range(10)])
    un_visited.remove(1)

    while len(un_visited) > 0:
        target = 0
        min_val = MAX
        for i in visited:
            for j in un_visited:
                if costs[j][i] < min_val:
                    min_val = costs[j][i]
                    target = j

        visited.add(target)
        un_visited.remove(target)
        to_ones[target] = min_val

        for x in un_visited:
            costs[x][target] += min_val
        
    A_cnts = [0] * 11 # -1 -> 10

    for i in range(H):
        A = list(map(int, input().split()))
        for a in A:
            A_cnts[a] += 1
    
    res = 0
    for i in range(10):
        if i == 1:
            continue
        res += A_cnts[i] * to_ones[i]

    print(res)


if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define INF 1e9
#define All(x) (x).begin(),(x).end()
#define F first
#define S second
#define Cout(x) cout << (x) << endl
typedef long long ll;
using namespace std;

int main(){
    ll z=0;
    ll a,b,k;
    cin>>a>>b>>k;
    if(a>=k){
        cout<<a-k<<" "<<b<<endl;
    }else{
        cout<<0<<" "<<max(b-(k-a),z)<<endl;
    }
}

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

#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
#define e_b emplace_back
#define all(x) (x).begin(),(x).end()
#define uniq(x) ((x).erase(unique(all(x)),(x).end()))
#define sz(x) ((int)(x).size())

#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)

#ifdef LOCAL//compile with -DLOCAL
#define debug(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = "<<(x)<<endl
#define debug_vec(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = ";\
  rep(i,sz(x)){cerr<<x[i]<<" ";}cerr<<endl
#define debug_mat(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = "<<endl;\
  rep(i,sz(x)){rep(j,sz(x[i])){cerr<<x[i][j]<<" ";}cerr<<endl;}cerr<<endl
#else
#define debug(x) void(0)
#define debug_vec(x) void(0)
#define debug_mat(x) void(0)
#endif

template<class T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

ll N,K;
vector<ll> A;
ll S=0;

bool isOK(ll g){
  vector<ll> mod1(N);
  vector<ll> mod2(N);
  rep(i,N){
    ll tmp=A.at(i)%g;
    mod1.at(i)=tmp;
    mod2.at(i)=g-tmp;
  }
  sort(all(mod1));
  sort(all(mod2));
  reverse(all(mod2));

  vector<ll> sum1(N+1,0);
  vector<ll> sum2(N+1,0);
  REP(i,1,N+1)  sum1.at(i)=sum1.at(i-1)+mod1.at(i-1);
  for(int i=N-1;i>=0;i--) sum2.at(i)=sum2.at(i+1)+mod2.at(i);

  ll cnt=1e18;
  rep(i,N+1)  chmin(cnt,max(sum1.at(i),sum2.at(i)));
  if(cnt<=K)  return true;
  else  return false;
}

int main(){
  ios_base::sync_with_stdio(false);cin.tie(0);
  cin >> N >> K;
  A.resize(N);
  rep(i,N){
    cin >> A.at(i);
    S+=A.at(i);
  }

  ll ans=0;
  for(ll i=1;i*i<=S;i++){
    if(S%i!=0)  continue;
    if(isOK(i))  chmax(ans,i);
    if(isOK(S/i))  chmax(ans,S/i);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3604
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>

using namespace std;

int main(){

        int height,width;

        while(true){
                cin >> height >> width;
                if(height == 0 && width == 0)break;

                for(int i = 1; i <= height; i++){
                        for(int j = 1; j <= width; j++){
                                if(i != 1 && i != height && j != 1 && j != width)
                                        cout << ".";
                                else 
                                        cout << "#";
                        }
                        cout << "\n";
                }
                cout << "\n";
        }

        return 0;
}

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

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n; cin >> n;
	vector<int> a(n);
	REP(i, n) cin >> a[i];
	sort(a.begin(), a.end());
	int mid = a[n - 1] / 2;
	auto itr = lower_bound(a.begin(), a.end(), mid);
	if (*itr == a[n - 1])
		cout << a[n - 1] << ' ' << a[n - 2] << '\n';
	else {
		int index = distance(a.begin(), itr);
		if (abs(mid - a[index]) <= abs(mid - a[index - 1]))
			cout << a[n - 1] << ' ' << a[index] << '\n';
		else
			cout << a[n - 1] << ' ' << a[index - 1] << '\n';
	}
    return 0;
}


Measured memory_bytes: 3720
#include <stdio.h>

int main(void)
{
  int n;
  char s[51];
  int cnt = 0;
  
  scanf("%d%s", &n, s);
  
  for (int i = 0; i < n-2; i++)
    if (s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C')
      cnt++;
  
  printf("%d", cnt);
  
  return 0;
}

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

int main() {
  int n; cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int maxV = a.front(), minV = a.front();
  int maxI = 1, minI = 1;
  int plus = 0, minus = 0;
  if (a.front() > 0) plus++;
  else if (a.front() < 0) minus++;
  bool flag = true;
  for (int i = 1; i < n; i++) {
    if (a[i-1] > a[i]) flag = false;
    if (maxV < a[i]) {
      maxV = max(maxV, a[i]);
      maxI = i + 1;
    }
    else if (minV > a[i]) {
      minV = min(minV, a[i]);
      minI = i + 1;
    }
    if (a[i] > 0) plus++;
    else if (a[i] < 0) minus++;
  }

  if (flag) {
    cout << 0 << endl;
    return 0;
  }
  if (abs(maxV) >= abs(minV)) {
    cout << minus + n - 1 << endl;
    for (int i = 1; i <= n; i++)
      if (a[i-1] < 0) cout << maxI << ' ' << i << endl;
    for (int i = 1; i < n; i++)
      cout << i << ' ' << i + 1 << endl;
  }
  else {
    cout << plus + n - 1 << endl;
    for (int i = 1; i <= n; i++)
      if (a[i-1] > 0) cout << minI << ' ' << i << endl;
    for (int i = n; i > 1; i--)
      cout << i << ' ' << i - 1 << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>

using namespace std;

int gcd (int a , int b) {
   if (b == 0) return a;
   return gcd(b, a % b);
}

int main() {
   int N;
   cin >> N;
   int a;
   int ans;
   for (int i = 0; i < N; i++) {
      cin >> a;
      if (i == 0) ans = a;
      else ans = gcd(a, ans);
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 256