akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll

template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
const int MAX_N = 100010;
const int MAX_H = 10010;

int H, N;
vector<int> A, B;

int dp[MAX_H];
// モンスターの体力が h の時の最小消費魔力
ll dfs(int h) {
    if(h <= 0) {
        return 0;
    }

    ll& ret = dp[h];
    if(~ret) { return ret; }
    ret = LLINF;

    REP(i, N) {
        chmin(ret, dfs(h - A[i]) + B[i]);
    }

    return ret;
}

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

    cin >> H >> N;
    A.resize(N);
    B.resize(N);
    REP(i, N) {
        cin >> A[i] >> B[i];
    }

    MINUS(dp);
    ll ans = dfs(H);
    printf("%lld\n", ans);

    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

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

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000

ll const mod = 1e9+7;

ll kaijyo(ll l){
  ll ans = 1;
  while(l){
    ans = (ans*l)%mod;
    l--;
    // cout<<ans<<endl;
  }
  return ans%mod;
}
ll n,m,v,i;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>m;

  if(abs(n-m) > 1){
    cout<<0<<endl;return;
  }
  if(abs(n-m)==0)cout<<2*kaijyo(n)%mod*kaijyo(m)%mod<<endl;
  else cout<<kaijyo(n)%mod*kaijyo(m)%mod<<endl;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <sstream>
#include <cstdio>

using namespace std;


int diceset(int num[7])
{
    int i;
    for (i=1; i<7; i++)
    {
        cin >> num[i];
    }
    return num[7];
}

int diceroll(int num[7], char direction)
{
        if(direction == 'N') 
    {
        int tmp = num[1];
        num[1] = num[2];
        num[2] = num[6];
        num[6] = num[5];
        num[5] = tmp;
    }
    else if(direction == 'W')
    {
        int tmp = num[1];
        num[1] = num[3];
        num[3] = num[6];
        num[6] = num[4];
        num[4] = tmp;
    }
    else if(direction == 'E')
    {
        int tmp = num[1];
        num[1] = num[4];
        num[4] = num[6];
        num[6] = num[3];
        num[3] = tmp;
    }
    else if(direction == 'S')
    {
        int tmp = num[1];
        num[1] = num[5];
        num[5] = num[6];
        num[6] = num[2];
        num[2] = tmp;
    }

    return num[7];
}

int diceroll2(int num[7])
{
    int tmp = num[2];
    num[2] = num[3];
    num[3] = num[5];
    num[5] = num[4];
    num[4] = tmp;
    
    return num[7];
}

int main()
{
    int num[7];
    diceset(num);
    int q;
    int a,b;
    char direction;
    cin >> q;
    for (int i=0; i<q; i++)
    {
        cin >> a >> b;

        if(a == num[2]) 
        {
            direction = 'N';
            diceroll(num, direction);
        }
        else if(a == num[3])
        {
            direction = 'W';
            diceroll(num, direction);
        }
        else if(a == num[4]) 
        {
            direction = 'E';
            diceroll(num, direction);
        }
        else if(a == num[5]) 
        {
            direction = 'S';
            diceroll(num, direction);
        }
        else if(a == num[6]) 
        {
            direction = 'N';
            diceroll(num, direction);
            diceroll(num, direction);
        }

        if(b == num[3])
        {
            diceroll2(num);
        }
        else if(b == num[4])
        {
            for(int j=0; j<3; j++)
            {
                diceroll2(num);
            }
        }
        else if(b == num[5])
        {
            for(int j=0; j<2; j++)
            {
                diceroll2(num);
            }
        }
        cout << num[3] << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define Ma7moud_7amdy                 \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define Open_Sesame Open()
#define all(v) ((v).begin()), ((v).end())
#define allr(v) ((v).rbegin()), ((v).rend())
#define clr(arr, x) memset(arr, x, sizeof arr)
#define endl "\n"
#define Accepted 0
#define watch(x) cout << #x << " = " << x << endl;
#define RT(x) return cout << (x), 0;
#define sc(a) scanf("%d", &a)
#define pr(a) printf("%d", a)
#define scll(x) scanf("%I64d", &x)
#define prll(x) printf("%I64d", x)
#define scan(s) scanf("%[^\n]%*c", &s)
#define print(s) printf("%s", s.c_str()); // print string
#define sz(v) v.size()
typedef long long ll;
typedef vector<int> vi;
const int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
const int dy[] = { 0, 1, 0, -1, 1, -1, 1, -1 };
const int Mx = INT_MAX;
const int Mn = INT_MIN;
const ll MX = LLONG_MAX;
const ll MN = LLONG_MIN;
const double PI = acos(-1.0);
void Open()
{
#ifndef ONLINE_JUDGE
	freopen("Input.txt", "r", stdin);
	freopen("Output.txt", "w", stdout);
#endif
}
const double EPS = -1e-2;
const ll mod = ll(1e9 + 7);
const int N = 2000 + 5;

//“Nobody but you have to believe in your dreams to make them a reality.” ― Germany Kent

vector<int>p, q, r;

int main() {

	Ma7moud_7amdy;
	//Open_Sesame;
	ll sum = 0;
	int x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	p = vector<int>(a), q = vector<int>(b), r = vector<int>(c);

	for (int& i : p)cin >> i;
	for (int& i : q)cin >> i;
	for (int& i : r)cin >> i;


	sort(allr(p)), sort(allr(q)), sort(allr(r));
	for (int i = 0; i < x; i++) sum += p[i];
	for (int i = 0; i < y; i++) sum += q[i];
	x--, y--;
	for (int i = 0; i < c; i++) {
		if (x >= 0 && y >= 0) {
			if (sum <= sum - p[x] + r[i] && sum - p[x] + r[i] >= sum - q[y] + r[i]) {
				sum = sum - p[x] + r[i];
				x--;
			}
			else if (sum <= sum - q[y] + r[i] && sum - q[y] + r[i] >= sum - p[x] + r[i]) {
				sum = sum - q[y] + r[i];
				y--;
			}
			else break;
		}
		else if (x >= 0) {
			if (sum <= sum - p[x] + r[i] ) {
				sum = sum - p[x] + r[i];
				x--;
			}
			else break;
		}
		else if (y >= 0) {
			if (sum <= sum - q[y] + r[i] ) {
				sum = sum - q[y] + r[i];
				y--;
			}
			else break;
		}
		else break;
	}
	cout << sum;

}

Measured memory_bytes: 1408
//In the Name of God
//Ya Ali

#include <bits/stdc++.h>

#define err(A) cout << #A << " = " << (A) << endl

using namespace std;

int sumdig(int x)
{
  int ret = 0;
  while (x)
    {
      ret += x % 10;
      x /= 10;
    }
  return ret;
}

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

  int n;

  cin >> n;

  int ans = 200;

  for (int i = 1; i < n; i ++)
    ans = min(ans, sumdig(i) + sumdig(n - i));

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


Measured memory_bytes: 256
import copy
import heapq
from collections import deque
n=int(input())
left=[]
middle=deque([])
right=[]
A=list(map(int,input().split()))
for i in range(n):
  heapq.heappush(left,A[i])
c=sum(left)
for i in range(n):
  middle.append(A[n+i])
for i in range(n):
  heapq.heappush(right,A[2*n+i]*-1)
d=sum(right)
l=deque([0])
m=copy.copy(middle)
for i in range(n):
  a=left[0]
  b=m[0]
  l.append(l[-1]+max(0,b-a))
  if b-a>0:
    heapq.heapreplace(left,b)
  m.popleft()
m=copy.copy(middle)
r=deque([0])
for i in range(n):
  a=right[0]*-1
  b=m[-1]
  r.append(r[-1]+max(0,a-b))
  if a-b>0:
    heapq.heapreplace(right,b*-1)
  m.pop()
ans=0
for i in range(n+1):
  a=l[0]+r[-1]
  if a>ans:
    ans=a
  l.popleft()
  r.pop()
print(c+d+ans)

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

int main()
{
  int n,m,c;
  cin >> n >> m >> c;
  vector<int> b(m);
  for (int i = 0; i < m; i++)
  {
    cin >> b[i];
  }
  vector<vector<int> > a(n);
  for (int i = 0; i < n; i++)
  {
    for (int j = 0; j < m; j++)
    {
      int tmp;
      cin >> tmp;
      a[i].push_back(tmp);
    }
  }
  
  int cnt = 0;

  for (int i = 0; i < n; i++)
  {
    int tmp = 0;
    for (int j = 0; j < m; j++)
    {
      tmp += a[i][j]*b[j];
    }
    tmp+=c;
    if(tmp>0) cnt++;
  }
  cout << cnt << 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++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353,INF=1e18;



int main() {
    ll r,d,x;
    cin>>r>>d>>x;
    rep(i,10){
        x=r*x-d;
        cout<<x<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long 
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define i_os ios::sync_with_stdio(0);  cin.tie(0);  cout.tie(0);
#define INF (ll)1e18 + 100
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/
#define o_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define o_setll tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
typedef tree<pair<ll, ll>,null_type,less<pair<ll, ll>>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set1;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

int main() 
{
	ll a;
	cin>>a;
	cout<<a + a*a + a*a*a<<endl;
	return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int a,b,t;
    cin >> a >> b >> t;
    int tm = t/a;
    cout << b*tm << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007

using namespace std;

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

	ll n,W;
	cin>>n>>W;
	ll weg[n];
	ll val[n];
	ll dp[n+1][W+1];
	for(ll i=0;i<n;i++){
		cin>>weg[i]>>val[i];
	}

	for(ll i=0;i<=n;i++){
		for(ll w=0;w<=W;w++){
			if(i==0 || w==0){
				dp[i][w]=0;
			}
			else if(w>=weg[i-1]){
				dp[i][w] = max(val[i-1]+dp[i-1][w-weg[i-1]] , dp[i-1][w]);
			}
			else{
				dp[i][w] = dp[i-1][w];
			}
		}
		//cout<<i<<endl;
	}
	
	cout<<dp[n][W]<<endl;	

	return 0;
}

Measured memory_bytes: 79104
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

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

void Forward(const string &text, unsigned &cursor, bool is_char) {
	if(is_char) {
		if(cursor < text.size()) ++cursor;
	}
	else {
		while(cursor < text.size() && isblank(text[cursor])) ++cursor;
		while(cursor < text.size() && !isblank(text[cursor])) ++cursor;
	}
}

void Backward(const string &text, unsigned &cursor, bool is_char) {
	if(is_char) {
		if(cursor > 0) --cursor;
	}
	else {
		while(cursor > 0 && isblank(text[cursor - 1])) --cursor;
		while(cursor > 0 && !isblank(text[cursor - 1])) --cursor;
	}
}

void Insert(string &text, unsigned &cursor, const string &target) {
	const string insert_text = target.substr(1, target.size() - 2);
	text.insert(cursor, insert_text);
	cursor += insert_text.size();
}

void Delete(string &text, unsigned cursor, bool is_char) {
	if(is_char) {
		if(cursor < text.size()) text.erase(text.begin() + cursor);
	}
	else {
		unsigned idx = cursor;
		Forward(text, idx, false);
		if(idx == 0 || isblank(text[idx - 1])) return;
		text.erase(text.begin() + cursor, text.begin() + idx);
	}
}

string solve() {
	string text;
	getline(cin, text);

	int n;
	cin >> n;
	cin.ignore();

	unsigned cursor = 0;
	rep(i, n) {
		string line;
		getline(cin, line);

		const unsigned idx_space = line.find(' ');
		const string command = line.substr(0, idx_space);
		const string target = line.substr(idx_space + 1);

		switch(command[0]) {
		case 'f': Forward(text, cursor, target[0] == 'c'); break;
		case 'b': Backward(text, cursor, target[0] == 'c'); break;
		case 'i': Insert(text, cursor, target); break;
		case 'd': Delete(text, cursor, target[0] == 'c'); break;
		default: assert(false);
		}
	}

	text.insert(text.begin() + cursor, '^');
	return text;
}

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

	int t;
	cin >> t;
	cin.ignore();
	while(t--) cout << solve() << endl;

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1232
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a,b,c;
    while(~scanf("%d%d%d",&a,&b,&c)){
        if(a==b) printf("%d\n",c);
        else if(a==c) printf("%d\n",b);
        else if(b==c) printf("%d\n",a);
    }
return 0;}


Measured memory_bytes: 256
"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = inputList[0];
    if (N.endsWith("3")) {
        console.log("bon");
    } else if (N.endsWith("0") || N.endsWith("1")|| N.endsWith("6")|| N.endsWith("8")) {
        console.log("pon");
    } else {
        console.log("hon");
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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



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

  int ans = 1;
  int c = 0;
  for(int i = 1; i <= N; i++){
    int e = 0;
    int j = i;
    while(true){
      if (j % 2 != 0) break;
      e++;
      j /= 2;
    }
    if ( c < e) {
      c = e;
      ans = i;
    }
  }

  cout << ans << endl;


  return 0;
}








Measured memory_bytes: 3632
#! /usr/bin/env python3
import math 


if __name__ == "__main__":
    n = int(input())
    l = list(map(int,input().split()))
    if 0 in l :
        print("0")
    else :
        flag = 1
        prod = 1
        for i in range(n) :
            prod = prod * l[i]
            if prod > int(math.pow(10,18)) :
                flag = 0 
                break 
        if flag == 0 :
            print("-1")
        else :
            print(prod)


Measured memory_bytes: 22620
//
//  main.cpp
//  C-Vacation
//
//  Created by David Chong on 10/30/19.
//  Copyright © 2019 David Chong. All rights reserved.
//

#include <iostream>
#include <vector>

using namespace std;



int solve(vector<int> & aVec, vector<int> & bVec, vector<int> & cVec, int n) {

    vector<int> dpA(n);
    vector<int> dpB(n);
    vector<int> dpC(n);
    
    dpA[0] = aVec[0];
    dpB[0] = bVec[0];
    dpC[0] = cVec[0];

    
    for(int i = 1; i < n; i++) {
        
        dpA[i] = max(dpB[i-1], dpC[i-1]) + aVec[i];
        dpB[i] = max(dpA[i-1], dpC[i-1]) + bVec[i];
        dpC[i] = max(dpA[i-1], dpB[i-1]) + cVec[i];
        
    }
    
//    printf("%i %i %i\n", dpA.back(), dpB.back(), dpC.back());
    
    return max(max(dpA.back(), dpB.back()), dpC.back());
}

int main(int argc, const char * argv[]) {
    
//    freopen("input.in", "r", stdin);
    
    int n;
    
    cin >> n;
    
    vector<int> aVec(n);
    vector<int> bVec(n);
    vector<int> cVec(n);
    
    
    for(int i = 0; i < n; i++) {
        cin >> aVec[i] >> bVec[i] >> cVec[i];
    }
    
    
    printf("%i\n", solve(aVec, bVec, cVec, n));
    
    return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<cstring>
#define MAX_N 100+10
using namespace std;
char Map[MAX_N][MAX_N];
int dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
int W,H;
int ans;
void dfs(int x,int y,const char tree)
{
    Map[x][y]='.';
    for(int i=0;i<4;i++)
    {
        int nx=x+dx[i],ny=y+dy[i];
        if(nx>=0&&nx<H&&ny>=0&&ny<W&&Map[nx][ny]==tree)
        {
            dfs(nx,ny,tree);
        }
    }
}
int main()
{
    while(cin>>H>>W,W!=0||H!=0)
    {
        ans=0;
        for(int i=0;i<H;i++)
            for(int j=0;j<W;j++)
            {
                cin>>Map[i][j];
            }
        for(int i=0;i<H;i++)
        {
            for(int j=0;j<W;j++)
            {
                if(Map[i][j]!='.')
                {
                    dfs(i,j,Map[i][j]);
                    ans++;
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int main(){
    int K, S; cin >> K >> S;
    int count=0;
    for (int i=0; i<=K; i++){
        for (int j=0; j<=K; j++){
            if (S-i-j<=K && S-i-j>=0) {
                count++;
                //cout << i << ' ' << j << ' ' << S-i-j << endl;
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		String result = "";
		if (N == 1) {
			result = "Hello World";
		} else {
			int A = reader.nextInt();
			int B = reader.nextInt();
			result = Integer.toString(A + B);
		}


		reader.close();
		System.out.print(result);
	}
}



Measured memory_bytes: 24916
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n=0;
	int m=0;
	int p=0;
	int ac=0;
	int wa=0;
	string s;
	map<int,int> table;
	cin>>n>>m;
	vector<int>	w(n);
	fill(w.begin(),w.end(),0);
	for(int i=0;i<n;i++)
	{
		table[i]=0;
	}
	for(int i=0;i<m;i++)
	{
		cin>>p>>s;
		if(table[p]==1) continue;
		if(s=="WA")
		{
			w[p]+=1;
		}
		else if(s=="AC")
		{
			table[p]=1;
			ac+=1;
			wa+=w[p];
		}
	}
	cout<<ac<<" "<<wa;
	return 0;
}


Measured memory_bytes: 5376
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rng(a) a.begin(),a.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  sort(rng(a));
  int max = a[n-1];
  double half = max/2.0;
  int min;
  double num = 1001001001.0;
  for(auto p :a) {
    if(num>abs((double)half-p)) {
      num = abs((double)half-p);
      min = p;
    }
  }
  cout << max << " " << min << endl;
  return 0;
}

Measured memory_bytes: 3684
import java.io.*;
import java.util.*;
import java.lang.*;
 
public class Main {
    public static void main(String[] args) {
         Scanner scanner = new Scanner(System.in);
        int d = scanner.nextInt();
        int t = scanner.nextInt();
        int s = scanner.nextInt();
        if(s*t>=d){System.out.println("Yes");}
        else{System.out.println("No");}
    }
}

Measured memory_bytes: 35788
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fi first
#define sc second
#define ALL(x) x.begin(), x.end()
#define RALL(X) x.begin(), x.end()
#define FOR(i, n, k) for(i=0; i<n; i+=k)
#define FO(i, n, k) for(i=1; i<=n; i+=k)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define N 100005
#define mid ((l+r)/2)
#define dbg(x) (cerr << #x << " : " << x << endl)
#define endl "\n"
#define MOD 100000009

using namespace std;

typedef long long int lli;

int main(){
	ios_base::sync_with_stdio(false);
	int n, x;
	cin >> n >> x;
	vector <int> l(n);
	for(int &x: l) cin >> x;
	for(int i=1; i<n; i++) l[i] += l[i-1];
	int res = upper_bound(ALL(l), x) - l.begin();	
	cout << res+1;
	return 0;
}

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

using namespace std;

using ll = long long int;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vs = vector<string>;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

const int dx[] = { -1, 0, 1, 0 };
const int dy[] = { 0, 1, 0, -1 };

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	string s;
	cin >> s;

	if (s.size() < 4) {
		cout << "No" << endl;
		return 0;
	}

	if (s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I') {
		cout << "Yes" << endl;
		return 0;
	}

	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [int(input()) for _ in range(N)]
current = 0
visited = {0}
ans = 0

while True:
    current = A[current] - 1
    ans += 1

    if current in visited:
        print(-1)
        break

    if current == 1:
        print(ans)
        break

    visited.add(current)

Measured memory_bytes: 15908
#include <bits/stdc++.h>
 
using namespace std;
          
#define endl        "\n"
#define int         long long
#define all(v)      v.begin(),v.end()
#define sz(v)       (int)v.size()
#define pii         pair<int,int>
#define fi          first
#define se          second
#define mod         1e9+7
#define forn(i,a,b) for(int i=a;i<b;i++)
#define deb(x)      cout << #x << ' ' << x << endl
#define clock       cerr << 1000 * (double)clock() / (double)CLOCKS_PER_SEC << "ms" << endl;

void solve(){
	int x;
	cin>>x;
	forn(i,-2001,2001){
		forn(j,-2001,2001){
			if(i*i*i*i*i-j*j*j*j*j==x){
				cout<<i<<" "<<j<<endl; return;
			}
		}
	}
}
 
int32_t main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int t = 1;
    //cin >> t;
    while (t--) solve();
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0,(i##_len)=(n);(i)<(i##_len);(i)++)
#define rep2(i,a,b) for(ll (i)=(a),(i##_len)=(b);(i)<=(i##_len);(i++))
#define rrep(i,n) ll(i)=(n);ll now=-1;while((i)--&&(now++||1))
#define Yes(n) cout<<((n)?Yes:No)<<"\n"
#define vll vector<ll>
#define pb push_back
using namespace std;
using ll = long long;

static inline void ignore_ret(int x) {}
template<class T> bool chmax(T&a,const T&b){if(a<b){a=b;return true;}return false;}
template<class T> bool chmin(T&a,const T&b){if(a>b){a=b;return true;}return false;}
template<class T> T abs(T x){return max(x,-x);}
template<class T> T gcd_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=gcd(r,v.at(i));return r;}
template<class T> T lcm(T m,T n) {return m*n/gcd(m,n);}
template<class T> T lcm_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=lcm<T>(r,v.at(i));return r;}
template<class T> T factorial(T n){if(n==0)return 1;T r=1;for(T i=2;i<=n;i++)r*=i;return r;}
template<class T> T nCr(T n,T k){return factorial<T>(n)/(factorial<T>(k)*factorial<T>(n-k));}
template<class T> T dot_product(vector<T>u,vector<T>v){T r=0;for(T i=0;i<u.size();i++)r+=u.at(i)*v.at(i);return r;}
template<class T> T sum(vector<T>v){return reduce(all(v),0LL);}

// Template ends here

void solve(ll N, string S){
    ll x = 0, max = 0;
    rep(i, N) chmax(max,(S.at(i) == 'I') ? (++x) : (--x));
    cout << max << "\n";
}

int main() {
    ll N;
    ignore_ret(scanf("%lld",&N));
    string S;
    cin >> S;
    solve(N, S);
    return 0;
}

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

using namespace std;

#ifdef DGC
#include "debug.h"
#else
#define debug(...)
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second



int main()
{
	#ifdef DGC
		//freopen("a.txt", "r", stdin);
		//freopen("b.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n;
	cin >> n;
	vector<int> a(1<<n);
	for (auto &i : a) cin >> i;

	multiset<int> s, x;
	for (auto i : a) s.insert(i);

	x.insert(-*s.rbegin());
	s.erase(s.find(*s.rbegin()));

	bool ok = true;
	for (int k = 0; k < n; ++k)
	{
		vector<int> add;
		for (auto i : x)
		{
			auto it = s.lower_bound(-i);
			if (it == s.begin())
			{
				ok = false;
				break;
			}
			it = prev(it);

			add.push_back(*it);
			s.erase(it);
		}

		for (auto i : add)
			x.insert(-i);
	}

	if (ok)
		cout << "Yes\n";
	else
		cout << "No\n";

	return 0;
}


Measured memory_bytes: 14328
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define pii pair<int, int>
#define ff first
#define ss second
using namespace std;

const int INF = 1LL << 40;
const int MOD = 1e9 + 7;
const int N = 1001;
char a[N][N];
int dp[N][N];

signed main() {
    
    int h, w;
    cin >> h >> w;
    
    for(int i = 1; i <= h; i++)
        for(int j = 1; j <= w; j++) {
            cin >> a[i][j];
            if(i == 1 && j == 1)
                dp[i][j] = 1LL;
            else if(a[i][j] == '.')
                dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
        }
    cout << dp[h][w] << endl;
    return 0;
}

Measured memory_bytes: 9088
import java.util.Scanner;

public class Main {
	//static Map<Long,Long>map=new TreeMap<>();
	static String ans="";
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();
       int b=sc.nextInt();
       String s[][]=new String[a+2][b+2];
       for(int i=0;i<a+2;i++) {
    	   for(int j=0;j<b+2;j++) {
    		   s[i][j]="#";
    	   }
       }
       for(int i=1;i<=a;i++) {
    	     String S=sc.next();
    	     String S2[]=S.split("");
    	     for(int j=0;j<b;j++) {
    	    	 s[i][j+1]=S2[j];
    	     }
    	}
       for(int i=0;i<a+2;i++) {
    	   for(int j=0;j<b+2;j++) {
    		  System.out.print(s[i][j]);
    	   }
    	   System.out.println();
       }
    }
}

Measured memory_bytes: 23852
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = [] ;count = 0 ;pro = 1

def ceil(x,y):
  return (x-1)//y+1

def redef(x,y):
  global swapsign
  if x < 0:
    x = -x; sign[0] = -1
  if y < 0:
    y = -y; sign[1] = -1
  if x < y:
    swapsign = 1; x,y = y,x
  return x,y

def return_case(k,D):
  if (k % 2 == 0) and (D % 2 == 1):
    print(-1); exit()
  elif (D % k == 0):
    case = -1
  elif (k % 2 == 0) and (D % 2 == 0):
    case = 0
  elif (k % 2 == 1) and (D % 2 == 1):
    case = 1
  elif (k % 2 == 1) and (D % 2 == 0):
    case = 2
  return case

def How_manytime(case,k,D):
  if case == -1:
    m = D//k
  elif case == 0:
    m=max(2,ceil(D,k))
  elif case == 1:
    m =max(3, ceil(D,k) + ((ceil(D,k) + 1) % 2) )
  elif case == 2:
    m = max(2, ceil(D,k)+ (ceil(D,k) % 2) )
  return m

def move(dx,dy):
  global x,y
  x += dx; y += dy
  ans.append([x,y])
  return

k=int(input())
X,Y=map(int,input().split())
sign = [1]*2
swapsign = 0
X,Y=redef(X,Y)
D=X+Y
case = return_case(k,D)
x = y = 0
m = How_manytime(case,k,D)

l = (k*m-D)//2

while k <= l:
  move(-k,0); l-=k
if l != 0:
  move(k-l,-l)

while (x,y) != (X,Y):
  s = min(k, X - x)
  move(s,k-s)

print(len(ans))
for x,y in ans:
  if swapsign: x,y = y,x
  x*=sign[0]; y*=sign[1]
  print(x,y)

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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] nq = br.readLine().split(" ");
        int n = Integer.parseInt(nq[0]);
        int quantime = Integer.parseInt(nq[1]);

        MyQueue queue = new MyQueue();
        for (int i = 0; i < n; i++) {
            String[] processStr = br.readLine().split(" ");
            queue.enqueue(new Process(processStr[0], Integer.parseInt(processStr[1]), quantime));
        }

        int sum = 0;
        while (!queue.isEmpty()) {
            Process process = queue.dequeue();
            int consume = process.work();
            sum += consume;
            if (process.isDone()) {
                System.out.println(process.getName() + " " + sum);
            } else {
                queue.enqueue(process);
            }
        }
    }

    private static class MyQueue {
        private Process[] processes;
        private int head;
        private int tail;

        public MyQueue() {
            this.processes = new Process[100000];
            this.head = 0;
            this.tail = 0;
        }

        public void enqueue(Process process) {
            this.processes[this.tail] = process;
            if (this.tail + 1 >= 100000) {
                this.tail = 0;
            } else {
                this.tail++;
            }
        }

        public Process dequeue() {
            if (isEmpty()) throw new RuntimeException();

            int head = this.head;
            if (head + 1 >= 100000) {
                this.head = 0;
            } else {
                this.head++;
            }
            return this.processes[head];
        }

        public boolean isEmpty() {
            return this.tail == this.head;
        }
    }

    private static class Process {
        private String name;
        private int restTime;
        private int quantime;

        public Process(String name, int restTime, int quantime) {
            this.name = name;
            this.restTime = restTime;
            this.quantime = quantime;
        }

        public int work() {
            if (quantime <= restTime) {
                restTime -= quantime;
                return quantime;
            }
            int consume = restTime;
            restTime = 0;
            return consume;
        }

        public boolean isDone() {
            return this.restTime == 0;
        }

        public String getName() {
            return name;
        }
    }
}



Measured memory_bytes: 59544
#include<stdio.h>
typedef long long ll;
const int mod=1000000007,i2=(mod+1)/2;
int mul(int a,int b){return(ll)a*b%mod;}
void inc(int&a,int b){(a+=b)%=mod;}
int pow(int a,int b){
	int s=1;
	while(b){
		if(b&1)s=mul(s,a);
		a=mul(a,a);
		b>>=1;
	}
	return s;
}
int fac[8010],rfac[8010];
int C(int n,int k){return mul(fac[n],mul(rfac[k],rfac[n-k]));}
int a[200010],b[200010],f[4010][4010];
int main(){
	int n,i,j,s;
	fac[0]=1;
	for(i=1;i<=8000;i++)fac[i]=mul(fac[i-1],i);
	rfac[8000]=pow(fac[8000],mod-2);
	for(i=8000;i>0;i--)rfac[i-1]=mul(rfac[i],i);
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d%d",a+i,b+i);
		f[2000-a[i]][2000-b[i]]++;
	}
	for(i=0;i<=4000;i++){
		for(j=0;j<=4000;j++){
			inc(f[i][j+1],f[i][j]);
			inc(f[i+1][j],f[i][j]);
		}
	}
	s=0;
	for(i=1;i<=n;i++)inc(s,f[2000+a[i]][2000+b[i]]-C((a[i]+b[i])*2,a[i]*2));
	inc(s,mod);
	printf("%d",mul(s,i2));
}

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

using namespace std;

using Opts = array<int, 3>;

int main() {
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    
    int sz;
    cin >> sz;
    
    vector<Opts> dp(sz, {INT_MIN, INT_MIN, INT_MIN});
    
    for (int i = 0; i != sz; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        
        if (i == 0) {
            dp[i] = {a, b, c};
        } else {
            dp[i][0] = a + max(dp[i - 1][1], dp[i - 1][2]);
            dp[i][1] = b + max(dp[i - 1][0], dp[i - 1][2]);        
            dp[i][2] = c + max(dp[i - 1][0], dp[i - 1][1]);    
        }
    }
    
    cout << *max_element(dp.back().cbegin(), dp.back().cend()) << endl;
    
    return 0;
}


Measured memory_bytes: 1408
N = int(input())
A = [int(x) - 1 for x in input().split()]

i = 0
answer = 0

while answer + i < N:
    if A[answer+i] == i:
        i += 1
    else:
        answer += 1

if answer == N:
    print(-1)
else:
    print(answer)




Measured memory_bytes: 24744
use proconio::input;

fn main() {
    input!(a: f64, b: f64, h: f64, w: f64);
    println!(
        "{}",
        (a * a + b * b
            - 2.0
                * a
                * b
                * ((h / 12.0 + w / (12.0 * 60.0) - w / 60.0) * std::f64::consts::PI * 2.0).cos())
        .sqrt()
    );
}


Measured memory_bytes: 3020
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(vs) vs.begin(), vs.end()
using ii = pair<int, int>;
using ll = long long;

int32_t main(){
	ios::sync_with_stdio(0);	
	int n;
	cin >> n;
	map<ii, ll> mp;
	for(int x=1; x<=n; ++x){
		ll p = round(pow(10, floor(log10(x))));
		ll i = x/p;
		ll j = x%10;
		++mp[ii(i, j)];
	}
	ll ans = 0;
	while(not mp.empty()){
		auto it = mp.begin();
		int i = it->ff.ff;
		int j = it->ff.ss;
		ll res = mp[ii(i, j)]*mp[ii(j, i)];
		if(i!=j) res*=2LL;
		ans += res;
		mp.erase(ii(i, j));
		mp.erase(ii(j, i));
	}
	cout << ans << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <map>
#include <vector>
#include <iomanip>

using namespace std;

int main(void) {
  int x, y;
  cin >> x >> y;
  int p[] = {300000, 200000, 100000};
  int price = 0;
  if (x <= 3) {
    price += p[x-1];
  }
  if (y <= 3) {
    price += p[y-1];
  }
  if (x == 1 && y == 1) {
    price += 400000;
  }
  cout << price << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

//time:: 16:44~16:56

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int m=sc.nextInt();
			int nmin=sc.nextInt();
			int nmax=sc.nextInt();
			if((m==0&&nmin==0)&&nmax==0) break;
			Integer[] point = new Integer[m];
			for(int i=0;i<m;++i){
				point[i]=sc.nextInt();
			}
			int gap=-1,res=-1;
			for(int i=nmin-1;i<nmax;++i){
				if(gap<=point[i]-point[i+1]){
					gap=point[i]-point[i+1];
					res=i;
				}
			}
			System.out.println(res+1);
		}
	}
}


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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  ll K,X,under,over,i;
  cin >> K>>X;
  under = max(-1000000ll,X-K+1);
  over = min(1000000ll,X+K-1);
  for(i=under;i<=over;i++){
    cout<< i << ' ';
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
    
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define pre(i , j , n) for(ll i = j ; i >= n ; i--)
#define all(x) x.begin(), x.end()
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vll;
typedef vector<char>	vc;
typedef vector<bool>	vb;
typedef pair<ll,ll> 	pll;
#define br "\n"
#define ff first
#define ss second
#define MAX 1000003

ll mod = (ll)998244353;

ll n,x,m;
vll prefsum;
set<ll> s;

ll dem(ll j,ll rem){
    vll v;
    v.pb(0);
    rep(i,j,prefsum.size()){
        v.pb(prefsum[i] - prefsum[i - 1] + v.back());
    }
    return (v[rem % (v.size() - 1)] + (v.back()*(rem/(v.size() - 1))));
}

void solve(){ 
    cin >> n >> x >> m;
    prefsum.pb(0);
    rep(i,1,n + 1){
        prefsum.pb(prefsum.back() + x);
        s.insert(x);
        (x *= x) %= m;
        if(!s.empty() && s.find(x) != s.end()){
            rep(j,1,prefsum.size()){
                if(prefsum[j] - prefsum[j - 1] == x){
                    cout << prefsum.back() + dem(j,n - i);
                    return;
                }
            }
        }
    }
    cout << prefsum.back() << br;;

}
	

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif 

	ll t = 1;
	// cin >> t;
	rep(i,0,t){
		solve();
	}
 
}	

Measured memory_bytes: 6624
#include<bits/stdc++.h>
#define ll long long
#define int long long int
#define MOD 1000000007
#define mkp make_pair
#define maxn 100005
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,a,b) for(int i=a;i<b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define  vi vector<int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define in cin>>
#define out cout<<
using namespace std;
const int infi=1e15+7;
void printVector(vector<int> v){
    for(int i=0;i<(int)v.size();i++)
        cout<<v[i]<<" ";
    out endl;
}

void printArray(int arr[],int n)
{
   for(int i=0;i<n;i++)cout<<arr[i]<<' ';
cout<<endl;
}
 set<pair<int,int>> primeset;
 vi prime_number;
void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
        for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
           primeset.insert(mkp(p,1));
}
ll modExp(ll base, ll power) {
    if (power == 0) {
        return 1;
    } else {
        ll cur = modExp(base, power / 2); cur = cur * cur; cur = cur % MOD;
        if (power % 2 == 1) cur = cur * base;
        cur = cur % MOD;
        return cur;
    }
}
//for making unordered_map with pair
struct hash_pair {
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
int32_t main()
{
fastio;
int a,b,c,d;
cin>>a>>b>>c>>d;
int aa=(c+b-1)/b;
int bb=(a+d-1)/d;
//out aa<<" "<<bb<<endl;
if(aa<=bb) out "Yes";
else out "No";
    return 0;
}

/*
google kick start
  cout << "Case #" << tt << ": "<<ans<<endl;
*/


Measured memory_bytes: 3616
from itertools import permutations


def calc_cost(t1, t2, t3):
    cost = 0
    cost += abs(t2 - t1)
    cost += abs(t3 - t2)
    return cost


def main():
    A = [int(i) for i in input().split()]
    min_cost = 198
    for a, b, c in permutations(A):
        min_cost = min(min_cost, calc_cost(a, b, c))
    print(min_cost)


if __name__ == "__main__":
    main()

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

vector<pair<int,int>> E;
vector<int> to[60];
bool seen[60];

void go(int a,int b,int v){
  for(auto w : to[v]){
    if(seen[w])continue;
    if(a==w&&b==v)continue;
    if(a==v&&b==w)continue;
    seen[w]=true;
    go(a,b,w);
  }
}

int main() {
  int n,m;
  cin>>n>>m;
  rep(i,m){
    int a,b;
    cin>>a>>b;
    a--;b--;
    to[a].push_back(b);
    to[b].push_back(a);
    E.push_back(make_pair(a,b));
  }
  int ans=0;
  for(auto e : E){
    rep(i,n){
      seen[i]=false;
    }
    seen[0]=true;
    int a,b;
    tie(a,b)=e;
    go(a,b,0);
    rep(i,n){
      if(!seen[i]){
        ans++;
        break;
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin >> n;
	ll a[n];
	ll sum=0;
	rep(i,0,n){
		cin >> a[i];
		a[i]-=(i+1);
	}
	sort(a,a+n);
	ll x=a[(n-1)/2];
	ll ans=0;
	rep(i,0,n){
		ans+=abs(a[i]-x);
	}
	cout << ans;
	return 0;
}
/* The judge is never wrong! Your code is buggy
   Look for:
 * * Read the problem carefully.
 * * Don't forget to sort(), mod, ll!!!!
 * * Initial value = +/- infinity instead of zero!!!
 * * an easier and alternate approach
 * * read the problem statement carefully
 * * if concept is correct and still WA, try with a different implementation
 * * special cases (n=1?)
 * * if you have no idea just guess the appropriate well-known algorithm instead of doing nothing :/
 */


Measured memory_bytes: 1792
#include <stdio.h>
#define M 2000001

int c[M],A[M],B[M];

int search(int);
void counting(int,int);

int main(void){
  int i,j,m,k;
  int limit;
  scanf("%d",&limit);
  for(i=1;i<=limit;i++){
    scanf("%d",&A[i]);
  }
  k=search(limit);
  counting(limit,k);
  for(i=1;i<limit;i++){
    printf("%d ",B[i]);
    }
  printf("%d\n",B[limit]);
  return 0;
}

void counting(int limit,int k){
  int i,j;
  for(i=0;i<=k;i++){
    c[k]=0;
  }
  for(i=1;i<=limit;i++){
    c[A[i]]++;
  }
  for(i=1;i<=k;i++){
    c[i]=c[i]+c[i-1];
  }
  for(j=limit;j>0;j--){
    B[c[A[j]]]=A[j];
    c[A[j]]--;
  }
}

int search(int limit){
  int i=0,x=0;
  for(i=1;i<=limit;i++){
    if(x<A[i])x=A[i];
  }
  return x;
}



Measured memory_bytes: 17380
#pragma GCC optimize("O3")

#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<int, int> pi;
tree<int,int,greater<int>,rb_tree_tag,tree_order_statistics_node_update> map_t;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz(x) (int)x.size()
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define REV(x) reverse(x.begin(),x.end())
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n,m;
    cin >> n >> m;
    vector<char> s(n,'0');
    if(n>1)
        s[0]='1';
    map<int,int> ma;
    F0R(i,m)
    {
        int first,second;
        cin >> first >> second;
        first--;
        if((ma.find(first)!=ma.end() && ma[first]!=second) || (first==0 && second==0 && n>1))
        {
            cout << -1;
            return 0;
        }
        ma.insert({first,second});
        s[first]='0'+second;
    }
    F0R(i,sz(s))
        cout << s[i];

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <map>
using namespace std;
typedef long long ll;
map<ll,ll> m;
ll n,a,r=0,s;
int main(){
	scanf("%lld",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&a);
		s+=a;
		if(!m.count(s)) m[s]=0;
		r+=(s?m[s]++:++m[s]);
	}
	printf("%lld\n",r);
}

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

using namespace std;
using ll = long long;

int main(int argc, const char *argv[]) {
  int n, q;
  cin >> n >> q;
  vector<array<ll, 3>> vc(n);
  for (int i = 0; i < n; ++i) {
    ll s, t, x;
    cin >> s >> t >> x;
    vc[i][0] = x;
    vc[i][1] = s - x;
    vc[i][2] = t - x;
  }

  sort(vc.begin(), vc.end());

  vector<ll> vd(q), vd2(q);
  for (int i = 0; i < q; ++i) {
    cin >> vd[i];
    vd2[i] = vd[i];
  }

  map<ll, ll> ans;
  for (int i = 0; i < n; ++i) {
    auto [x, s, t] = vc[i];
    auto it1 = lower_bound(vd.begin(), vd.end(), s);
    auto it2 = lower_bound(vd.begin(), vd.end(), t);
    for (auto it = it1; it != it2; it++) {
      ans[*it] = x;
    }

    vd.erase(it1, it2);
  }

  for (auto d : vd2) {
    if (ans.count(d) == 0) {
      cout << -1 << '\n';
    } else {
      cout << ans[d] << '\n';
    }
  }
}

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

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	//bool devided = false;
	int ans = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}

	sort(A.begin(), A.end());
	int AMax = A[N - 1];
	vector<bool> devided(AMax + 1);
	for (int i = 0; i <= AMax; i++) {
		devided[i] = true;
	}
	
	for (int i = 0; i < N; i++) {
		int a = A[i];
		int n = 2;
		if (i > 0 && A[i] == A[i - 1]) {
			n = 1;
		}
		while (a * n <=  AMax) {
			devided[a * n] = false;
			n++;
		}
	}
	
	for (int i = 0; i < N; i++) {
		if (devided[A[i]]) ans++;
	}

	cout << ans;
	return 0;
}

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

int main(){
	int a[10000],b[10000],c=0;
	cin>>a[0]>>b[0];
	while(a[c]*b[c]!=0){
		cin>>a[c+1]>>b[c+1];
		c++;
	}
	for(int d=0;d<c;d++){
		for(int i=0;i<a[d];i++){
			for(int j=0;j<b[d];j++){
				if(j%2==i%2) cout<<'#';
				else cout<<'.';
			}
			cout<<endl;
		}
		cout<<endl;;
	}
	return 0;
}

Measured memory_bytes: 3096
import math

n = int(input())

sqrtN = int(math.sqrt(n))

ans = 0
for i in range(sqrtN):
    m = i+1
    tmp = n - m
    if(tmp%m==0):
        tmpAns = tmp / m
        if(tmpAns > m):
            ans += tmpAns

print(int(ans))

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

int main(){
  int N, K;
  cin >> N >> K;
  string S;
  cin >> S;
  
  if(S.at(K - 1) == 'A')S.at(K - 1) = 'a';
  else if(S.at(K - 1) == 'B')S.at(K - 1) = 'b';
  else if(S.at(K - 1) == 'C')S.at(K - 1) = 'c';
  cout << S << endl;
}
  
  
    

Measured memory_bytes: 256