akhauriyash/Code-Regression huggingface dataset:
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <set>
#define fast ios_base::sync_with_stdio(false)
#define mxn (ll)1e5
#define mod (ll)(1e9+7)
#define mod1 (ll)(998244353)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define crz(v,n) v.clear(),v.resize(n+1,0)
#define print(v) for(ll it=0;it<v.size();it++) cout<<v[it]<<" ";cout<<endl
#define printp(v) for(ll it=0;it<v.size();it++) cout<<v[it].first<<" "<<v[it].second<<endl
using namespace std;
int main(){
	ll n,m,s=0,i,x;cin>>n>>m;for(i=0;i<m;i++) cin>>x,s+=x;
	if(s>n) s=-1; else s=n-s;cout<<s<<endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 10e+6
#define DEKA 1000000007

using namespace std;

int main(){
    string s,t;
    cin >> s >> t;
    int ans=0;
    if(s.at(0)==t.at(0)) ans++;
    if(s.at(1)==t.at(1)) ans++;
    if(s.at(2)==t.at(2)) ans++;
    cout << ans << endl;
}




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

typedef struct{
  char c;
  int num;
  int turn;
}Card;

Card A[N];
int n;
int Partition(Card *A,int p,int r){
  int i,j;
  Card x,exc;
  x = A[r];
  i = p - 1;
  for(j=p;j<r;j++){
    if(A[j].num<=x.num){
      i = i+1;
      exc = A[i];
      A[i]= A[j];
      A[j] = exc;
    }
  }
  exc = A[i+1];
  A[i+1]=A[r];
  A[r]= exc;
  
  return i+1;
}

void Quicksort(Card *A,int p,int r){
  int q;
  if(p<r){
    q = Partition(A,p,r);
    Quicksort(A,p,q-1);
    Quicksort(A,q+1,r);
  }
}

int main(){
  int i,part,p,r;
  char g;
  scanf("%d%c",&n,&g);
  for(i=0;i<n;i++){
    scanf("%c%d%c",&A[i].c,&A[i].num,&g);
    A[i].turn=i;
  }
  p=0;
  r=n-1;
  Quicksort(A,p,r);
  for(i=0;i<n;i++){
    if(A[i].num==A[i+1].num && A[i].turn > A[i+1].turn){
      printf("Not stable\n");
      break;
    }
    else if(i==n-1){
      printf("Stable\n");
    }
  }  
  
  for(i=0;i<n;i++){
    printf("%c %d\n",A[i].c,A[i].num);
  }
  return 0;
}

Measured memory_bytes: 1780
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
from collections import deque

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

if m % 2 == 1:
    print(-1)
    exit()



AB = [[int(x) for x in input().split()] for _ in range(m)]

# representation matrix
repn = [[] for j in range(n + 1)]
for a, b in AB:
    repn[a].append(b)
    repn[b].append(a)


# Minimum Spanning Tree
tree = [set() for i in range(n + 1)]
visited = [False] * (n + 1)
visited[1] = True
q = deque([1])

while q:
    u = q.popleft()
    for v in repn[u]:
        if visited[v]:
            continue
        visited[v] = True
        tree[u].add(v)
        tree[v].add(u)
        q.append(v)


# define directions of the edges other than that of MST
degree = [0] * (n + 1)
ans = []

for a, b in AB:
    if b in tree[a]:
        continue
    ans.append('{} {}'.format(a, b))
    degree[a] += 1


# defining orientations
def dfs(u = 1, parent = None):
    for v in tree[u]:
        if v == parent:
            continue
        dfs(v, u)
        if degree[v] % 2 == 0:
            ans.append('{} {}'.format(u, v))
            degree[u] += 1
        else:
            ans.append('{} {}'.format(v, u))
            degree[v] += 1

dfs()

print('\n'.join(ans))


Measured memory_bytes: 119880
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

#if 0
// greaterが通らないので定義
template<class _Ty>
	struct greater
		: public binary_function<_Ty, _Ty, bool>
	{	// functor for operator<
	bool operator()(const _Ty& _Left, const _Ty& _Right) const
		{	// apply operator< to operands
		return (_Left > _Right);
		}
	};
#endif

int a[100001];
long long b[100001];
long long s[100001];

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

	priority_queue <int>  big_que;
	priority_queue <int, vector<int>, greater<int> > small_que; // 小さい順で取り出す


	for (int i = 1; i <= N; i++) {
		int a;
		cin >> a;
		b[0] += a;
		small_que.push(a);
	}
	for (int i = 1; i <= N; i++) {
		cin >> a[i];
	}
	for (int i = 1; i <= N; i++) {
		int a;
		cin >> a;
		s[N+1] += a;
		big_que.push(a);
	}

	for (int pos = 1; pos <= N; pos++) {
		small_que.push(a[pos]);
		int s = small_que.top();
		small_que.pop();
		b[pos] = b[pos-1] + a[pos] - s;
	}

	for (int pos = N; pos > 0; pos--) {
		big_que.push(a[pos]);
		int b = big_que.top();
		big_que.pop();
		s[pos] = s[pos+1] + a[pos] - b;
	}

	long long max_dif = b[0] - s[N];
	for (int pos = 0; pos <= N; pos++) { // どこで分割するか？
		max_dif = std::max(max_dif, b[pos]-s[pos+1]);
	}

	cout << max_dif << endl;
	return 0;
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl


namespace atcoder {
	template<typename T>
	T ncr(T left, T right) {
		right = min(left - right, right);
		T ans = 1;
		for (T i = 1; i <= right; i++) {
			ans = ans * (left - right + i) / i;
		}
		return ans;
	}

	const int LIMIT = 1000000007;
	const int tenfive = 100000;
}

using namespace atcoder;
using TY = array<lli, 3>;



int main() {
	int N;
	cin >> N;
	vector<TY> A(N);

	for (int i = 0; i < N; i++) {
		cin >> A[i][0] >> A[i][1];
		A[i][2] = A[i][0] + A[i][1];
	}
	sort(A.rbegin(), A.rend(),[](const TY& left, const TY& right) {
		return left[2] < right[2];
	});
	lli l = 0, r = 0;
	for (int i = 0; i < A.size(); i++) {
		if (i % 2 == 0) {
			l += A[i][0];
		}
		else {
			r += A[i][1];
		}
	}
	cout << l - r << endl;
	return 0;
}


Measured memory_bytes: 2560
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    a, b, c, d = map(int, input().split())

    while True:
        c -= b

        if c <= 0:
            print('Yes')
            exit()

        a -= d

        if a <= 0:
            print('No')
            exit()


if __name__ == '__main__':
    main()


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

using P = complex<double>;

const double eps = 1e-7;

double dot(P a, P b) {
  return (a * conj(b)).real();
}

double cross(P a, P b) {
  return (conj(a) * b).imag();
}

int ccw(P a, P b, P c) {
  if(cross(b-a, c-a) > eps) return 1;
  if(cross(b-a, c-a) < -eps) return -1;
  if(dot(b-a, c-a) < -eps) return -2;
  if(dot(a-b, c-b) < -eps) return 2;
  return 0;
}

bool isIntersectedSS(P a1, P a2, P b1, P b2) {
  int a = ccw(b1, b2, a1);
  int b = ccw(b1, b2, a2);
  int c = ccw(a1, a2, b1);
  int d = ccw(a1, a2, b2);

  return a * b <= 0 && c * d <= 0;
}

double distanceSP(P a, P b, P c) {
  if(dot(b-a, c-a) < eps) return abs(c-a);
  if(dot(a-b, c-b) < eps) return abs(c-b);
  return abs(cross(b-a, c-a)) / abs(b-a);
}

double getDistance(P a1, P a2, P b1, P b2) {
  if(isIntersectedSS(a1, a2, b1, b2)) return 0;

  return min({
              distanceSP(a1, a2, b1),
              distanceSP(a1, a2, b2),
              distanceSP(b1, b2, a1),
              distanceSP(b1, b2, a2),
    });
}

bool solve() {
  int N, M, L;
  int x[101], y[101], a[101], r[101];
  P points[101][5];

  cin >> N >> M >> L;

  if (N == 0) return false;

  for(int i=0; i<N; i++) {
    cin >> x[i] >> y[i] >> a[i] >> r[i];
    a[i] += 90;

    for(int j=0; j<5; j++) {
      double sx = cos((j * 72 + a[i]) / 180.0 * M_PI) * r[i] + x[i];
      double sy = sin((j * 72 + a[i]) / 180.0 * M_PI) * r[i] + y[i];
      points[i][j] = P(sx, sy);
    }
  }

  double dist[101][101];

  for(int i=0; i<N; i++)
    for(int j=0; j<N; j++)
      dist[i][j] = (i != j) * 1e17;

  for(int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {

      for(int i2=0; i2<5; i2++) {
        for(int j2=0; j2<5; j2++) {
          dist[i][j] = dist[j][i] =
            min(dist[i][j], getDistance(points[i][i2], points[i][(i2+2)%5],
                                        points[j][j2], points[j][(j2+2)%5])
                );
        }
      }
    }
  }

  for(int k=0; k<N; k++)
    for(int i=0; i<N; i++)
      for(int j=0; j<N; j++)
        dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j]);

  printf("%.10lf\n", dist[M-1][L-1]);


  return true;
}

int main(){
  while(solve());

}



Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> P3;
typedef pair<P ,P> PP;
constexpr ll MOD = ll(1e9) + 7;
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr int MAX_N = int(2e5) + 5;
constexpr double EPS = 1e-9;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i > 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()


int main() {
    int n, p[22],ans = 0;
    cin >> n;
    REP(i,n) cin >> p[i];
    for(int i=0;i<n-2;i++){
        if(p[i] < p[i+1] && p[i+1] < p[i+2])ans++;
        if(p[i] > p[i+1] && p[i+1] > p[i+2])ans++;
    }
    cout << ans << endl;
    return 0;
}



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

int function(int p);

int n,k,*weight;
const long long Max = 1000000000;

int main(){
	cin>>n>>k;
	weight = new int[n];
	for(int i=0;i<n;i++) cin>>weight[i];

	int p, right = Max, left = 0;

	while(left<right){
		p = (right+left)/2;
		if( function(p)<n ) left = p+1;
		else right = p;
		if(right==left) p = (right+left)/2;
	}


	//for(p=0;;p++)
	//	if(function(p)>=n) break;

	cout<<p<<endl;

	delete [] weight;
	cin.sync(); cin.get();
}

int function(int p){
	int count = 0, sum = 0, i = 0, v = 0;
	while(count<k){
		sum += weight[i];
		if(sum>p){
			count++;
			sum = 0;
		}else if(sum==p){
			count++; v++; i++;
			sum = 0;
		}else{
			v++; ++i;
		}
		if(i==n) break;
	}
	return v;
}

Measured memory_bytes: 3104
#include <iostream>
#include <iomanip>

int main()
{
    int a, b;

    std::cin >> a >> b;

    int d, r;
    double f;

    d = a / b;
    r = a % b;

    f = 1.0 * a / b;

    // std::cout << std::scientific << std::setprecision(9) << f << std::endl;
    std::cout << d << " " << r << " " << std::fixed << std::setprecision(5) << f << std::endl;

    return 0;
}



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

using namespace std;

/*

        Bismillahir Rahmanir Rahim
        Problem :
        Problem Link :
        Topics :
        Solver : Masud Parves
        I Love Code More than Sharks Love Blood <3
*/


#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define SZ(a)           (int)a.size()
#define all(a)  a.begin(), a.end()
#define allr(a)  a.rbegin(), a.rend()


#define sf(a)           scanf("%d",&a)
#define sff(a,b)        scanf("%d %d",&a,&b)
#define sfff(a,b,c)     scanf("%d %d %d",&a,&b,&c)

#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)

#define CIN ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define TEST_CASE(t) for(int zz=1 ; zz<=t ; zz++)
#define PRINT_CASE printf("Case %d: ",zz)
#define Debug(x)            cout<<#x " = "<<(x)<<endl
#define NOT_VISITED 0
#define IS_VISITED 1
#define WHITE 0
#define GRAY 1
#define BLACK 2



int fx[4]= {1,-1,0,0};
int fy[4]= {0,0,1,-1};

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N  (1<<pos);}
//int Reset(int N,int pos){return N= N & ~(1<<pos);}
//bool Check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/


const double PI = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9+7;
const int maxn = (int)2e5+5;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<int, ll> pill;
int a[maxn];

int main() {
    CIN
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n;
    cin >> n;
    f1(i,n){
        cin >> a[i];
    }

    int ans=0,cnt=0;
    f1(i,n){
        cnt=0;
        while(i+1<=n  && a[i+1]<=a[i]){
            cnt++;
            i++;
        }
        ans = max(ans , cnt);
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin >> s;

  if (s[0] == s[1] || s[1] == s[2] || s[2] == s[0]) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }

  return 0;
}


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

#define ll long long
#define all x.begin(),x.end()
#define MAX 200005

int n;
double x[1005], y[1005], X, Y, d, e;
double dist(double a, double b) {
	return a*a + b*b;
}
int main()
{
	ios_base::sync_with_stdio(NULL);
	cin.tie(0); cout.tie(0);

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		X+= x[i];
		Y+= y[i];
	}

	X /= n; Y /= n;

	double P = 0.1;

	for(int i=0;i<30000;i++)
	{
		int f = 0;
		d = dist(X - x[0], Y - y[0]);

		for(int j = 1; j < n; j++)
		{
			e = dist(X - x[j], Y - y[j]);

			if (d < e)
			{
				d = e;
				f = j;
			}
		}

		X += (x[f] - X)*P;
		Y += (y[f] - Y)*P;
		P *= 0.999;
	}

	cout << setprecision(15) << fixed << sqrt(d) << endl;
}


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

bool f(int x){
  int digit = 0;
  while(x){
    digit++;
    x /= 10;
  }
  return digit % 2 == 1;
}

int main(){
  int n;
  cin >> n;
  int ans = 0;
  for(int i = 1; i <= n; i++){
    if(f(i)) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll t1,t2,a1,a2,b1,b2;
    cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
    ll d;
    if((d=(b1-a1)*t1+(b2-a2)*t2)==0){
        print("infinity");
        return;
    }
    ll m=(b1-a1)*t1;
    if(m>0&&d>0||m<0&&d<0){
        print(0);
        return;
    }
    if(m<0) m=-m;
    if(d<0) d=-d;
    if(m%d==0){
        print((m/d)*2);
    }else{
        print((m/d)*2+1);
    }
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	fmt.Printf("%d\n", resolve(parseProblem(os.Stdin)))
}

func parseProblem(r io.Reader) (int, int, int, []int, []int) {
	const (
		initialBufSize = 100000
		maxBufSize     = 1000000
	)
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	n, w := scanInt(sc), scanInt(sc)
	ws, vs := make([]int, n), make([]int, n)
	maxValue := 0
	for i := 0; i < n; i++ {
		ws[i] = scanInt(sc)
		vs[i] = scanInt(sc)
		maxValue += vs[i]
	}
	return n, w, maxValue, ws, vs
}

func resolve(n, w, maxValue int, ws, vs []int) int {
	// keep min weight
	states := make([][]int, n+1)
	states[0] = make([]int, maxValue+1)
	for i := 0; i <= maxValue; i++ {
		states[0][i] = inf
	}
	states[0][0] = 0
	for i := 1; i <= n; i++ {
		states[i] = make([]int, maxValue+1)
		for j := 0; j <= maxValue; j++ {
			states[i][j] = inf
		}
		for v := 0; v <= maxValue; v++ {
			if v-vs[i-1] >= 0 {
				changeToMin(&(states[i][v]), states[i-1][v-vs[i-1]]+ws[i-1])
			}
			changeToMin(&(states[i][v]), states[i-1][v])
		}
	}
	result := 0
	for i := 0; i <= maxValue; i++ {
		if states[n][i] <= w {
			result = i
		}
	}
	return result
}

const (
	inf  = math.MaxInt32
	ninf = math.MinInt32
)

func changeToMin(v *int, cand int) (updated bool) {
	if *v > cand {
		*v = cand
		updated = true
	}
	return updated
}

func changeToMax(v *int, cand int) (updated bool) {
	if *v < cand {
		*v = cand
		updated = true
	}
	return updated
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 82304
#include <bits/stdc++.h>
    
using namespace std;
typedef long long ll;
    
int main()
{
    int A, B, K;
    cin >> A >> B >> K;

    vector<int> ans;

    int c = (B < A + K) ? B : A + K;
    if (c < A) { c = A; }
    // cout << "c:" << c << "\n";
    for (int i = A; i < c; i++) {
        ans.push_back(i);
    }
    c = (B < B - K + 1) ? B : B - K + 1;
    if (c < A) { c = A; }
    // cout << "c:" << c << " " << B - K << "\n";
    for (int i = c; i <= B; i++) {
        auto itr = find(ans.begin(), ans.end(), i);
        if (itr == ans.end()) {
            ans.push_back(i);
        }
    }

    for (int i : ans) {
        cout << i << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(ll i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

int main() {
	string str;
	cin >> str;
	int minS = 0;

	char before = str[0];
	for(int i = 0;i < str.size();i++){
		if(str[i] != before){
			minS++;
			before = str[i];
		}
	}

	cout << minS << endl;
	return 0;
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
#ifndef err
#define err(...)(void)0
#endif
using namespace std;
using ll = long long;
using ull = decltype(1ull);
template<class T>int size(T&&a) { return a.size(); }
#define REP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.first,_l##t=a.second;t<_l##t;t++)
#define RREP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.second-1,_l##t=a.first;t>=_l##t;t--)
template<class B>pair<int, B>make_pair(B b) { return{ 0,b }; }
#define rep(t,...)REP(t,make_pair(__VA_ARGS__))
#define rrep(t,...)RREP(t,make_pair(__VA_ARGS__))
#define all(a)begin(a),end(a)
#define rall(a)a.rbegin(),a.rend()

void Calc();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr); cin.exceptions(istream::failbit | istream::badbit);
  cout << fixed << setprecision(15); Calc(); cout.flush(); return 0;
}
template<class A>void amax(A&a, A b) { a = max(a, b); }
template<class A>void amin(A&a, A b) { a = min(a, b); }
struct Scanner {
  template<class A = string>A Next() { A a; cin >> a; return a; }
  template<class A = int>vector<A>Array(int n) { vector<A>a(n); for (A&i : a) cin >> i; return a; }
  string Line() const { string s; getline(cin, s); return s; }
  template<class A>Scanner&operator,(A&a) { a = Next<A>(); return *this; }
  template<class A>operator A() { return Next<A>(); }
}in;

/*---------------------------------------------------------------------*/

void Calc() {
  int now = { 0 };
  string s = in;
  string t[] = { "dreamer","dream","eraser","erase" };
  for (auto& i : t) {
    reverse(all(i));
  }
  reverse(all(s));
  for (; now < s.size();) {
    bool ok = false;
    for (auto& i : t) {
      if (s.substr(now, i.size()) == i) {
        now += i.size();
        ok = true;
        break;
      }
    }
    if (ok == false) {
      cout << ("NO") << endl;
      return;
    }
  }
  cout << ("YES") << endl;
}


Measured memory_bytes: 512
n, m = map(int,input().split())
ypi = []
for i in range(m):
    p, y = map(int,input().split())
    p = str(p)
    p = '0'*(6-len(p)) + p
    ypi.append((y, p, i))
ypi.sort()

p_dict = {}
for y, p, i in ypi:
    p_dict[p] = []

for y, p, i in ypi:
    p_dict[p].append(i)

ans_l = [0]*m
for p, i_l in p_dict.items():
    for j, i in enumerate(i_l):
        j = str(j+1)
        j = '0'*(6-len(j)) + j
        ans_l[i] = p + j

for val in ans_l:
    print(val)





Measured memory_bytes: 48488
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
  int a,b,c;cin>>a>>b>>c;
  if(a==b&&b==c)cout<<"1"<<endl;
  else if(a==b||b==c||a==c)cout<<"2"<<endl;
  else cout<<"3"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>

using namespace std;

#define mod 1000000007

int main(){
  int a[3];
  for(int i = 0; i < 3; i++) cin >> a[i];
  sort(a, a + 3);
  cout << a[0] + a[1] << endl;
}
  

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

const int mod=1000000007;
int n;
int a[30][30],dp[5000000];

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
        }
    }
    dp[0]=1;
    for(int i=0;i<1<<n;i++){
        int c=0;
        for(int j=0;j<n;j++)if(i&(1<<j))c++;
        for(int j=0;j<n;j++){
            if(~i&(1<<j)){
                if(a[c][j]){
                    dp[i+(1<<j)]=(dp[i+(1<<j)]+dp[i])%mod;
                }
            }
        }
    }
    cout<<dp[(1<<n)-1]<<endl;

    return 0;
}

Measured memory_bytes: 10496
#include <iostream>

using namespace std;

int main()
{
    int n,t;
    string s;
    cin >> n >> s;
    if(n==0){ cout << s << endl; }
    else
    {
    for(int i=0;s[i]!='\0';i++)
    {
        t = (int)s[i]+n;
        if(t>90){ t=t-26; }
        cout << (char)t;
    }
    cout << endl;
    }
    return 0;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

template <typename T>
class Basis{
public:
    int sz = 0, dim;
    vector<T> basis;

    // high to low
    void insert(T mask){
        for(int i=dim-1;0<=i;--i){
            if((mask & T(1) << i) == 0) continue;
            if(not basis[i]){
                basis[i] = mask;
                ++sz;
                return;
            }
            mask ^= basis[i];
        }
    }

    //kth highest element
    T kThHighest(T k){
        T res = 0, cnt = T(1) << sz;
        for(int i=dim-1;0<=i;--i){
            if(not basis[i]) continue;
            cnt >>= 1;
            if((k <= cnt and (res & T(1) << i) == 0) or (k > cnt and (res & T(1) << i) > 0)){
                res ^= basis[i];
            }
            if(k > cnt) k -= cnt;
        }
        return res;
    }

    //kth lowest element
    T kThLowest(T k){
        return kThHighest((T(1)<<sz)-k);
    }

    explicit Basis(int _dim=60) : dim(_dim){
        basis.assign(dim, 0);
    }
};

class FXorSum3 {
public:
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        int N;
        in>>N;
        lint xsum = 0;
        vc<lint> A(N);
        for(auto& a : A) in>>a, xsum ^= a;
        Basis<lint> B;
        for(auto& a : A){
            a &= ~xsum;
            B.insert(a);
        }
        out<<xsum+2*B.kThHighest(1)<<'\n';
    }
};


int main() {
	FXorSum3 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3964
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

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


signed main(void) {
    int n,m,k;
    cin >> n >> m >> k;
    vi a(n),b(n);
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    int ans = 0;
    if(k == 1){
        rep(i,n){
            ans = max(ans, a[i]*min(b[i],m) + m - min(b[i],m));
        }
    }else if(k == 2){
        rep(i,n)rep(j,n)if(i != j){
            int t = a[i]*min(b[i],m);
            int left = m - min(b[i],m);
            t += a[j]*min(b[j],left);
            left -= min(b[j], left);
            ans = max(ans, t + left);
        }
    }else if(k == 3){
        rep(i,n)rep(j,n)rep(k,n)if(i != j && i != k && j != k){
            //cout << i << " " << j << " " << k << " " ;
            int t = a[i]*min(b[i],m);
            //cout << min(b[i],m) << " " ;
            int left = m - min(b[i],m);
            t += a[j]*min(b[j],left);
            //cout << min(b[j], left) << " " ;
            left -= min(b[j],left);
            t += a[k]*min(b[k],left);
            left -= min(b[k], left);
            //cout << min(b[k],left) << endl;
            //cout << i << " " << j << " " << k << " " << t << endl;
            ans = max(ans, t + left);
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 3104
N = input()

ans = 0

if len(N) == 1:
    ans = int(N)

else:
    for i in range(1, len(N) + 1, 2):

        dataS = N[i-1]

        if i == 1:
            ans = ans + 9

        elif i % 2 == 1:

            if i == len(N):
                data1 = (int(N[len(N) - i]) - 1)
                data2 = int(N[-(len(N)-1):]) + 1

                ans = ans + data1 *10**(i-1) + data2

            else:
                ans = ans + 9 * 10**(i-1)
            
print(str(ans))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include <atcoder/all>
#define mp make_pair
#define fi first
#define se second
#define INF 10000000000000000LL
#define ll  long long 
const long long  inf =1e18+44;
const int MAX=3e5+9;
const ll MOD=998244353;
const int TOT_PRIMES=1e6+9;
const int MAX_A=71;
const int LN=20;
const double eps=1e-1;
using namespace std;
using namespace atcoder;
int op(int a, int b){
    return max(a,b);
}
int e(){
    return 0;
}
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    segtree<int ,op , e>st(MAX+90);
    int n , k;
    cin>>n>>k;
    int ans = 0;
    int arr[n+1];
    for(int i=1;i<=n;i++)
        cin>>arr[i];
    for(int i=1;i<=n;i++){
        int l = max(0 , arr[i]-k);
        int r = min(MAX , arr[i]+k);
        int mx = st.prod(l,r+1);
        ans  = max(ans, mx);
        st.set(arr[i], mx+1);
    }
    ans = max(ans , st.prod(0, MAX));
    cout<<ans;

}


Measured memory_bytes: 8540
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,i;
    cin>>n;
    int ac=0,wa=0,tle=0,re=0;
    string s[n];
    for(i=0;i<n;i++)
    cin>>s[i];
    for(i=0;i<n;i++)
    {
        if(s[i]=="AC")
        ac++;
        else if(s[i]=="WA")
        wa++;
        else if(s[i]=="TLE")
        tle++;
        else if(s[i]=="RE")
        re++;
    }
    cout<<"AC x "<<ac<<endl;
    cout<<"WA x "<<wa<<endl;
    cout<<"TLE x "<<tle<<endl;
    cout<<"RE x "<<re<<endl;
}

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

using namespace std;

typedef long long ll;

typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;

#define all(x) (x).begin(), (x).end()
#define fi first
#define se second

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b,c;
    cin >> a >> b >> c;
    if(a > b*c) cout<<"No"<<"\n";
    else cout<<"Yes"<<"\n";
    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	int ans = 0;
	int cnt = 0;

	for (int i = 0; i < S.size(); i++) {
		if (S[i] == 'A') cnt++;
		else if (S[i] == 'C') cnt++;
		else if (S[i] == 'G') cnt++;
		else if (S[i] == 'T') cnt++;
		else {
			ans = max(ans, cnt);
			cnt = 0;
		}
		if (i == S.size() - 1) ans = max(ans, cnt);;
	}

	cout << ans << endl;
}

Measured memory_bytes: 3588
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>

typedef unsigned long long int uint64;
typedef long long int          int64;

void get_N (int64 *n)
{
  int cnt;
  
  cnt = scanf("%lld", n);

  return;
}


int main()
{
  int cnt;
  int64 N;
  int64 i;
  int64 result = 0;
  

  get_N(&N);

  for (i=1; i<=N; i++) {
    if ( (1<=i) && (i<=9)) {
      result++;
      continue;
    }
    if ( (100<=i) && (i<=999)) {
      result++;
      continue;
    }
    if ( (10000<=i) && (i<=99999)) {
      result++;
      continue;
    }
  }


  printf("%d", result);

  return 0;
}



Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ls node*2
#define rs node*2+1
#define M 400010
using namespace std;
const double Pi=3.141592653589793238;
int n,x1,x2,y1,y2,len;bool flag;
int b[M],f[M],val[M<<2];
struct point{int x,y;}a[M];
bool cmp1(point a1,point a2) {return a1.x<a2.x;}
bool cmp2(point a1,point a2) {return a1.y<a2.y;}
int get(int x) {int l=1,r=n;while(l<=r){int mid=(l+r)/2;if(b[mid]==x) return mid;else if(b[mid]<x) l=mid+1;else r=mid-1;}}
void update(int node) {val[node]=max(val[ls],val[rs]);}
void insert(int node,int l,int r,int x,int k)
{
	if(l==r) {val[node]=k;return;}
	int mid=(l+r)/2;
	if(x<=mid) insert(ls,l,mid,x,k);
	else insert(rs,mid+1,r,x,k);
	update(node);
}
int query(int node,int l,int r,int l1,int r1)
{
	if(l1<=l&&r1>=r) return val[node];
	if(l1>r||r1<l) return 0;
	int mid=(l+r)/2;
	return max(query(ls,l,mid,l1,r1),query(rs,mid+1,r,l1,r1));
}
int main()
{
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	if(x1>x2) swap(x1,x2),swap(y1,y2);
	flag=y1<=y2;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d%d",&a[i].x,&a[i].y);
	sort(a+1,a+1+n,cmp2);
	for(int i=1;i<=n;i++) b[i]=a[i].y;
	sort(a+1,a+1+n,cmp1);
	for(int i=1;i<=n;i++)
	{
		if(a[i].x>x2||a[i].x<x1) continue;
		if(flag&&a[i].y>=y1&&a[i].y<=y2)
		{
			int r=get(a[i].y);
			f[r]=query(1,1,n,1,r)+1;
			insert(1,1,n,r,f[r]);
		}
		else if(!flag&&a[i].y<=y1&&a[i].y>=y2)
		{
			int r=get(a[i].y);
			f[r]=query(1,1,n,r,n)+1;
			insert(1,1,n,r,f[r]);
		}
	}
	for(int i=1;i<=n;i++)
	{
		if(a[i].x>x2||a[i].x<x1) continue;
		if(flag&&a[i].y>=y1&&a[i].y<=y2) len=max(len,f[get(a[i].y)]);
		else if(!flag&&a[i].y<=y1&&a[i].y>=y2) len=max(len,f[get(a[i].y)]);
	}
	int num=min(abs(x1-x2),abs(y1-y2))+1;double res;
	if(num==len) res=100.0*(abs(x1-x2)+abs(y1-y2))-20.0*len+(len-1)*5*Pi+10*Pi;
	else res=100.0*(abs(x1-x2)+abs(y1-y2))-20.0*len+len*5*Pi;
	printf("%.15lf",res);
	return 0;
}

Measured memory_bytes: 9984
X = int(input())
def add(a,b):
  return a**4+a**3*b+a**2*b**2+a*b**3+b**4
for i in range(-118,120):
  for j in range(-118,120):
    if (i-j)*add(i,j) == X:
      print(i,j)
      quit()

Measured memory_bytes: 9184
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 1000010
#define rep(i,n) for (int i = 0; i < (n); ++i)
const ll mod = 1e9+7;

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

bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second < secondElof.second;
}

int a[20];
int x[20][20], y[20][20];
int n;

int count(int x) {
    if (x==0) return 0;
    return count(x>>1) + (x&1);
}


int main() {
    cin >> n;

    for(int i=1; i<=n; ++i) {
        cin >> a[i];
        for(int k=1; k<=a[i]; ++k) {
            cin >> x[i][k] >> y[i][k];
        }
    }

    int ans = 0;

    for(int bit=0; bit< (1 << n); ++bit) {
        bool flag = true;

        for(int i=1; i<=n; ++i) {
            if (! (bit & (1 << (i-1)))) continue;

            for(int j=1; j<=a[i]; ++j) {
                if (((bit >> (x[i][j]-1)) & 1) ^ y[i][j] ) flag = false;
            }
        }
        if (flag) {
            ans = max(ans, count(bit));
        }
    }

    cout << ans << endl;

}



Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;
int main(){
	while(1){
		int N,Q;
		int cal[100]={0};
		cin >>N >>Q;
		if(N==0&&Q==0) break;
		for(int i=0;i<N;i++){
			int M,D;
			cin >>M;
			for(int j=0;j<M;j++){
				cin >>D;
				cal[D] +=1;
			}
		}
		int maxk=0;
		for(int k=99;k>=1;k--){
			if(cal[k]>=cal[maxk]){maxk=k;}
		}
		if (cal[maxk]>=Q){cout <<maxk << endl;}
		else cout<<0 <<endl;
	}


	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
    int n,k;
    cin>>n>>k;
    set<int>s;
    for(int i=0;i<k;i++)
    {
        int d;
        cin>>d;
        for(int j=0;j<d;j++)
        {
            int a;
            cin>>a;
            s.insert(a);
        }
    }
    cout<<n-s.size();
    return 0;
}   

Measured memory_bytes: 3664
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <math.h>
#define rep(i,ini,n) for(int i=ini;i<n;i++)
using namespace std;
typedef long long ll;

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

    int D, G; // D : max number of question, G : objective
    cin >> D >> G;
    int p[11]; // the number of question
    int c[11]; // completed points
    rep(i,0,D) cin >> p[i] >> c[i];

    int ans = 1e9;

    for(int mask=0;mask<(1<<D);++mask){
        int s=0, num=0, rest_max=-1;
        for(int i=0;i<D;++i){
            if(mask >> i & 1){ // solve completely
                s += 100 * (i+1) * p[i] + c[i];
                num += p[i];
            }else{ // solve one of them
                rest_max = i;
            }   
        }
        if(s < G){ // if total points become above threshold
            int s1 = 100 * (rest_max + 1);
            int need = (G-s+s1-1) / s1;
            if(need >= p[rest_max]){
                continue;
            }
            num += need;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <stack>
#include <limits>
#include <array>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include <numeric>
//#include <tuple>

constexpr long long mod = static_cast<long long>(1e9 + 7);

int main() {
    int N;
    std::cin >> N;
    std::vector<int> a(N);
    for(auto&& val: a)
        std::cin >> val;

    int ans = 0;
    if(a[0] == 1) {
        ++ans;
        std::swap(a[0], a[1]);
    }
    for(int i = 1; i < a.size() - 1; ++i) {
        if(a[i] == i + 1) {
            ++ans;
            std::swap(a[i], a[i + 1]);
        }
    }
    if(a[N - 1] == N) ++ ans;

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define PI 3.1415926535

int main() {
    double a, b, x;
    cin >> a >> b >> x;

    double theta;
    if (x > a * a * b / 2) {
        double air = a * a * b - x;
        air /= a;
        theta = atan(2 * air / (a * a));
    } else {
        x /= a;
        theta = atan(b * b / (2 * x));
    }

    printf("%1.8f\n", theta * 180 / PI);

    return 0;
}


Measured memory_bytes: 4044
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define MOD 1000000007
#define all(c) c.begin(), c.end()
#define peek(v)      \
	for (auto i : v) \
		cout << i << ' ';
#define rep(i, begin, end) \
	for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

ll powof2(ll n)
{
	ll p = 2;
	ll ans = 1;
	while (n)
	{
		if (n & 1)
			ans = ans * p % MOD;
		p = p * p % MOD;
		n >>= 1;
	}
	return ans;
}

void solve()
{
	ll n;
	cin >> n;
	map<ll, ll> m;
	rep(i, 0, n)
	{
		ll x;
		cin >> x;
		m[x]++;
	}
	bool flag = false;
	if (n & 1)
	{
		if (m[0] > 1)
			flag = true;
		else
		{
			rep(i, 1, n)
			{
				if (m[i] == 1 || m[i] > 2)
					flag = true;
				if (flag)
					break;
			}
		}
	}
	else
	{
		if (m[0] > 0)
			flag = true;
		else
		{
			rep(i, 1, n)
			{
				if (m[i] == 1 || m[i] > 2)
					flag = true;
				if (flag)
					break;
			}
		}
	}
	if (flag)
		cout << '0' << endl;
	else
		cout << powof2(n / 2);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	solve();
	cerr << endl << "=> " << 1000 * clock() / CLOCKS_PER_SEC << "ms" << endl;
	return 0;
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#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 a,b,t;
    cin >> a >> b >> t;
    t /=a;
    cout << t * b << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long int a;
  double b;
  cin >> a >> b;
  long long c = round(b*100);
  long long ans = a*c;
  cout << ans/100 << endl;
}

Measured memory_bytes: 3764
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String str;
		char ch;
		int num;
		int len;

		num = scan.nextInt();
		str = scan.next();
		len = str.length();

		for(int i = 0; i < len; i++) {
			System.out.print((char)((str.charAt(i) - 'A' + num) % 26 + 'A'));
		}


	}
}


Measured memory_bytes: 24020
N=int(input())
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

a=num2alpha(N)
print(str.lower(a))

Measured memory_bytes: 8868
import java.util.*;

public class Main {
	static final long MOD = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		init(H+W);
		long ans = 0;
		
		for(int i=0; i<H-A; i++)
			ans = (ans + comb(B+i-1, B-1)*comb(W-B+H-i-2, W-B-1))%MOD;
		
		System.out.println(ans);
		sc.close();
	}
	
	static long fac[],rev[],revfac[];
	
	static void init(int N) {
		fac = new long[N+1];
		rev = new long[N+1];
		revfac = new long[N+1];
		fac[0] = 1;
		rev[0] = 0;
		revfac[0] = 1;
		for(int i=1; i<=N; i++) {
			fac[i] = fac[i-1]*i%MOD;
			rev[i] = pow(i, MOD-2);
			revfac[i] = pow(fac[i], MOD-2);
		}
	}
	static int pow(long a, long b) {
		long ans = 1;
		while(b>0) {
			if((b&1)!=0)
				ans = (ans * a)%MOD;
			a = (a * a)%MOD;
			b>>=1;
		}
		return (int)ans;
	}
	static long comb(int a, int b) {
		if(a<0 || b<0 || a<b)
			return 0;
		return (((fac[a]*revfac[a-b])%MOD)*revfac[b])%MOD;
	}
}


Measured memory_bytes: 14292
from itertools import permutations
from math import sqrt, factorial

N = int(input())
towns = []
for _ in range(N):
    towns.append(list(map(int, input().split())))

def dist(a, b):
    x1, y1 = a[0], a[1]
    x2, y2 = b[0], b[1]
    return sqrt((x1 - x2)**2 + (y1 - y2)**2)

ans = 0
for combo in permutations(range(N)):
    temp = 0
    for i in range(1, N):
        temp += dist(towns[combo[i]], towns[combo[i - 1]])
    ans += temp

print(ans / factorial(N))


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


const int inf = 1e9+7;
vector<vector<int>> dist(201,vector<int>(201,inf));

int main(){
	int n,m,r;
	cin>>n>>m>>r;

	vector<int> towns(r);

	for(int i=0;i<r;i++) cin>>towns[i];

	for(int i=0;i<m;i++){
		int x,y,c;
		cin>>x>>y>>c;
		dist[x][y] = c; 
		dist[y][x] = c;
	}

	for(int k=1;k<=n;k++){
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				dist[i][j] = min(dist[i][k]+dist[k][j],dist[i][j]);
			}
		}
	}

	int ans = 1e9;
	sort(towns.begin(),towns.end());

	do{
		int d = 0;
		for(int i=1;i<(int)towns.size();i++){
			d+=dist[towns[i-1]][towns[i]];
		}
		ans = min(ans,d);
	} while(next_permutation(towns.begin(),towns.end()));

	cout<<ans;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int h, w;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> h >> w;
	FOR(i, h) FOR(j, w) {
		string s;
		cin >> s;
		if (s == "snuke") {
			cout << (char)('A'+j) << i+1 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double h = sc.nextInt();
		double w = sc.nextInt();
		double n = sc.nextInt();

		int a = (int) Math.ceil(n/h);
		int b = (int) Math.ceil(n/w);

		if(a <= b) {
			System.out.println(a);
		}else {
			System.out.println(b);
		}
	}
}


Measured memory_bytes: 23892
H, W, K = map(int, input().split())
X = [list(input()) for _ in range(H)]
MOD = 10 ** 9 + 7
ans = MOD

for bit in range(2 ** (H - 1)):
    n = bin(bit).count("1")
    ctr = [0] * (n + 1)  # Accumulation
    res = 0
    for j in range(W):
        k = 0
        tmp = [0] * (n + 1)  # One column
        for i in range(H):
            tmp[k] += int(X[i][j])
            if bit >> i & 1:
                k += 1

        # Check counts
        if any(v > K for v in tmp):
            res = MOD
            break
        elif any(u + v > K for u, v in zip(ctr, tmp)):
            # Split
            res += 1
            ctr = tmp[:]
        else:
            # Accumulate
            for i in range(n + 1):
                ctr[i] += tmp[i]

    ans = min(ans, res + n)

print(ans)


Measured memory_bytes: 75524
from heapq import*


n = int(input())
A = sorted([-int(x) for x in input().split()], reverse = True)

B = []
a = A.pop()
heappush(B, a)

ans = 0
while A:
    a = A.pop()
    b = heappop(B)
    ans += -b
    heappush(B, a); heappush(B, a)

print(ans)


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

int main() {
  int score[5];
  for (int i = 0; i < 5; i++) { cin >> score[i]; }
  int sum = 0;
  for (int i = 0; i < 5; i++) { sum += max(score[i], 40); }
  cout << sum / 5 << endl;
  return 0;
}


Measured memory_bytes: 3068
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();

		//電車の料金
		long trainCost = n * a;

		//最小
		long minCost = trainCost > b ? b : trainCost;

		System.out.println(minCost);

	}

	/**
	 * 文字列を反転して返す
	 * @param pStr 文字列
	 * @return 反転した文字列
	 */
	public static String myReverse(String pStr) {
		if (pStr.length() < 1) {
			return "";
		}

		StringBuffer sb = new StringBuffer(pStr);
		return sb.reverse().toString();
	}

	/**
	 * 余りを求める。
	 * @param a
	 * @param b
	 * @return 余り。余りがマイナスの時はプラスで返す。
	 */
	public static long myMod(long a, long b) {
		long ret = 0;

		ret = a % b;

		if (ret < 0) {
			ret += b;
		}

		return ret;
	}

	/**
	 * 乗数を求める ※mod対応
	 * @param kisu 基数
	 * @param josu 乗数
	 * @param primeNumMod_0 法 mod値 使わない場合は「0」
	 * @return
	 */
	public static long myPowWithMod(long kisu, long josu, long primeNumMod_0) {

		long ans = 1;

		//乗数が0の場合→1
		if (josu == 0)
			return 1;

		if (primeNumMod_0 == 0) {
			//modを使わないとき

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= kisu;
					josu = josu / 2;
				} else {
					//累乗が奇数の時
					ans *= kisu;
					josu--;
				}
			}

			return ans;

		} else {
			//modを使うとき

			//初めに桁を落とす
			kisu = myMod(kisu, primeNumMod_0);

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= myMod(kisu, primeNumMod_0);
					josu = josu / 2;

				} else {
					//累乗が奇数の時
					ans *= myMod(kisu, primeNumMod_0);
					josu--;

				}
			}

			return myMod(ans, primeNumMod_0);

		}

	}

}


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

BA = []
for i in range(N):
  A,B = map(int,input().split())
  BA.append([B,A])
  
BA.sort()

check = True
sum_A = 0
for j in range(N):
  sum_A += BA[j][1]
  if sum_A > BA[j][0]:
    check = False
    break
    
print("Yes" if check else "No")

Measured memory_bytes: 38204
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

char in[120];
pair<pair<string, int>, int> p[110];

int main(){
    int a;scanf("%d",&a);
    for(int i=0;i<a;i++){
        int t;scanf("%s%d",in,&t);
        string tmp=in;
        p[i]=make_pair(make_pair(in,-t),i);
    }
    std::sort(p,p+a);
    for(int i=0;i<a;i++)printf("%d\n",p[i].second+1);
}


Measured memory_bytes: 256