akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")

//#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,fma")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include<unordered_set>
#include <stack>
#include <unordered_map>
#include <map>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define M 998244353
#define all(x) x.begin(),x.end()
using namespace std;
// From Geeksforgeeks
inline ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
// Power function took from geeksforgeeks
ll power(ll x, ll y)
{
	ll res = 1;

	x = x % N;
	if (x == 0) return 0;
	while (y > 0)
	{
		if (y & 1)
			res = (res * x) % N;
		y = y >> 1;
		x = (x * x) % N;
	}
	return res;
}
double dist(ll x1,ll y1, ll x2,ll y2)
{
	double ans = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	double sum = 0.000000;
	ll n;
	cin >> n;
	cout << setprecision(7);
	vector<pair<ll,ll>> path(n+1,make_pair(0,0));
	f(i, 1, n+1)
	{
		ll x, y;
		cin >> x >> y;
		path[i].first = x;
		path[i].second = y;
	}
	int arr[n];
	f(i, 0, n)
	{
		arr[i] = i + 1;
		if (i > 0)
		{
			sum += dist(path[arr[i]].first, path[arr[i]].second,
				path[arr[i - 1]].first, path[arr[i - 1]].second);
		}
	}
	while (next_permutation(arr, arr + n))
	{
		f(i, 0, n)
		{
			if (i > 0)
			{
				sum += dist(path[arr[i]].first, path[arr[i]].second,
					path[arr[i - 1]].first, path[arr[i - 1]].second);
			}
		}
	}
	ll fact = 1;
	while (n > 1)
	{
		fact *= n;
		n -= 1;
	}
	sum /= fact;
	cout << sum;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;

map<ll,ll> mp;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	ll n,num;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>num;
		mp[num]++;
	}
	ll maxn=-1;
	for(auto i=mp.rbegin();i!=mp.rend();i++){
		if(maxn==-1&&i->second>=2){
			maxn=i->first;
			i->second-=2;
		}
		if(maxn!=-1&&i->second>=2){
			cout<<maxn*i->first<<endl;
			return 0;
		}
	}
	cout<<0<<endl;
	return 0;
}

Measured memory_bytes: 6528
using System;
using System.Collections.Generic;

namespace abc166_d
{
  class Program
  {
    static void Main(string[] args)
    {
      var X = CIn.ReadInt();

      for (int i = -6208; i <= 6208; i++)
      {
        var d = X + (long)Math.Pow(i, 5);

        var b = -6208;
        var t = 6208;

        while (b < t - 1)
        {
          var m = (b + t) / 2;
          var a = (long)Math.Pow(m, 5);

          if (a == d)
          {
            Console.WriteLine("{0} {1}", m, i);
            return;
          }

          if (a < d) b = m;
          if (a > d) t = m;
        }
      }
    }
  }

  static class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }
      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(int n)
    {
      var array = new string[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }
      return array;
    }

    public static int[] ReadIntArray(int n)
    {
      var array = new int[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }
      return array;
    }

    public static long[] ReadLongArray(int n)
    {
      var array = new long[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }
      return array;
    }

    public static double[] ReadDoubleArray(int n)
    {
      var array = new double[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }
      return array;
    }

    public static char[,] ReadCharMatrix(int h, int w)
    {
      var array = new char[h, w];
      for (var i = 0; i < h; i++)
      {
        var l = Console.ReadLine().ToCharArray();
        for (var j = 0; j < w; j++)
        {
          array[i, j] = l[j];
        }
      }
      return array;
    }
  }
}


Measured memory_bytes: 28372
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rfor(i,a,b) for(ll (i) = (a); (i) > (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(x) cout << (x) << endl;
#define all(x) (x).begin(),(x).end()

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

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

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    for (ll i = 1; i <= k; ++i) {
        r *= n--;
        r /= i;
    }
    return r;
}

int main()
{
    int n;
    string s,t,ans;
    cin >> n >> s >> t;
    rep0(i, n){
        ans += s[i];
        ans += t[i];
    }
    pf(ans)
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int total = 0;

        for (int i = n; i != 0;i--){
            total += n;
            n--;
        }

        System.out.println(total);

        }
}

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

const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

int64_t power_mod(int64_t num, int64_t power){
    int64_t prod = 1;
    num %= MOD;
    while(power > 0){
        if(power&1) prod = prod * num % MOD;
        num = num * num % MOD;
        power >>= 1;
    }
    return prod;
}

int main(){
    int N, K;
    cin >> N >> K;
    int64_t num[100001] = {0};
    int64_t ans = 0;
    for(int i=K; i>0; i--){
        num[i] = power_mod(K/i, N);
        for(int j=2*i; j<=K; j+=i)  add(num[i], MOD - num[j]);
        add(ans, num[i]*i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4384
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
typedef long long ll;

int n;
pair<int, int> a[110000];

int main() {
	cin >> n;
	for (int i=1;i<=n;i++) {
		cin >> a[i].first;
		a[i].second = i;
	}
	sort(a + 1, a + n + 1);
	rep(i, n) {
		if (!i) cout << a[i + 1].second;
		else cout << " " << a[i + 1].second;
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,l,a,b,s;
	while(~scanf("%d%d",&n,&m))
	{
		 s=n/(2*m+1);
		 if(n!=(2*m+1)*s)
            s++;
		 printf("%d\n",s);
	}
	
	 
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>

using namespace std;
#define rep(i,q) for(int i = 0; (q) > i; i++)

int main(){
  string s;cin>>s;
  int bb= 0;
  int bw = 0;
  for(int i = 0; s.size() > i; i++){
    if(i % 2 == 0){
      if(s[i] == '0')bb++;
      else bw++;
    }else{
      if(s[i] == '0')bw++;
      else bb++;
    }
  }
  cout << min(bb,bw) << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define cls ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
int getSum(int a){
    int t=0;
    while(a>0){
        t+=(a%10);
        a/=10;
    }
    return t;
}

int main(){
    cls;
    int n;
    cin>>n;
    int sum=10000001;
    for(int i=1;i<n;i++){
        sum=min(getSum(i)+getSum(n-i),sum);
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    // Your code here!
    int sum=0,c,x;
    scanf("%d",&x);
    
    c=x;
    
    while(x>0){
        sum+=x%10;
        x=x/10;
    }
    if(c%sum==0){
        printf("Yes");
    }
    else{
        printf("No");
    }
    return 0;
}

Measured memory_bytes: 128
/*
in the name of ALLAH
author: Sepehr_Noori
*/
#include <bits/stdc++.h>

using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define pp pop_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef unsigned long long  ll;
typedef map<int,int> mpii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef double db;
typedef long double ld;
const int mod = 1e9+7;
////////////////////////
ll solve(ll h){
    if(h == 1){
        return 1;
    }
    ll s=0,g=0;
    if(h%2 != 0){
        h--;
    }
    h/=2;
    // s++;
    g = solve(h);
    // s += 2*g;
    // cout<<h<<" "<<s<<" "<<g<<endl;
    return 2*g+1;
}


int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    ll h;
    cin>>h;
    ll ans = solve(h); 
    cout<<ans<<endl;
}
    /*ll s=0,k,n,x;
    vi h;
    cin>>n>>k;
    for (int i =1;i<=n;i++){
        cin>>x;
        h.pb(x);
    }
    sort(all(h));
    while(k-- &&SZ(h))
        h.pp();
    for (auto z:h){
        s+=z;
    }
    cout<<s<<endl;

}
    /*int h,n,x,s=0;
    cin>>h>>n; 
    for (int i = 0;i<n;i++){
        cin>>x;
        s+=x;
    }
    if(s>=h){
        cout<<"Yes"<<endl;
        return 0;
    }else
    {
        cout<<"No"<<endl;
        return 0;
    }
    
}
    /*db h,a;
    cin>>h>>a;
    cout<<ceil(h/a)<<endl;;

    return 0;
}*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); --i)
#define all(c) c.begin(),c.end()
#define sz(x) ((int)x.size())
using pii = pair<int, int>;
using vvi = vector<vector<int>>;
using vi  = vector<int>;
constexpr int INF = 1001001001001001001LL;

/*
<NAME> 最長増加部分列 (Longest Increasing Subsequence)
<TRIGGER> LIS
<TAG> DP, etc
<*NOTE>
蟻本に載っている、二分探索を用いた$O(N log N)$の解法。
<*CODE> */
int LIS(vi &a) {
    int n = sz(a);
    vi dp(n, INF);
    rep(i, 0, n) *lower_bound(all(dp), a[i]) = a[i];
    return distance(begin(dp), lower_bound(all(dp), INF));
}

signed main() {
    int N;
    cin >> N;
    vi A(N);
    rep(i, 0, N) cin >> A[i];
    cout << LIS(A) << endl;
}



Measured memory_bytes: 4424
#include<stdio.h>
int main(void)
{
  long int a,b,k,i;
  scanf("%ld %ld %ld",&a,&b,&k);
  if(a+b>=k){
   if(a>=k){
     printf("%ld %ld\n",a-k,b);
   }else{
     printf("0 %ld\n",b-(k-a));
   }
  }else{
    printf("0 0\n");
  }
  return 0;
}



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

int findSumOfDigits(int n)
{
    int sum = 0;
    while (n > 0)
    {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

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

vector<string> field;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed << setprecision(15);
    //20:11:24
    int N, K;
    string S;
    cin >> N >> K >> S;
    for (char c = 'A'; c <= 'Z';c++)
    {
        if(S[K-1] == c){
            S[K - 1] = c + 32;
        }
    }
    cout << S << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int x, y; scanf("%d%d", &x, &y);

	int ans = 0;
	if(x == 1) ans += 300000;
	if(x == 2) ans += 200000;
	if(x == 3) ans += 100000;
	if(y == 1) ans += 300000;
	if(y == 2) ans += 200000;
	if(y == 3) ans += 100000;
	if(x == 1 and y == 1) ans += 400000;
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.math.*;  
public class Main
{ 
    //By shwetank_verma
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
    static int mod=1000000007;
    static boolean primes[]=new boolean[1000007];
    
    static boolean seive(int n){
        Arrays.fill(primes,true);
        primes[0]=primes[1]=false;
        for(int i=2;i*i<=n;i++){
            if(primes[i]==true){
                for(int p=i*i;p<=n;p+=i){
                    primes[p]=false;
                }
            }
        }
        if(n<1000007){
            return primes[n];
        }
        return false;
        
    }
    static int gcd(int a,int b){
        if(b==0)
        return a;
        return gcd(b,a%b);
    }
    static long GCD(long a,long b){
        if(b==0)
        return a;
        return GCD(b,a%b);
    }
    
  
    public static void main(String[] args) 
    { 
        FastReader sc=new FastReader(); 
        try{
           
                int t=sc.nextInt();
                int ans=t%1000;
                if(ans!=0)
                ans=1000-ans;
                System.out.println(ans);
           
            
        }catch(Exception e){
            return;
        }
    } 
}


Measured memory_bytes: 33748
N, K = map(int, input().split())
K0 = (N - 1) * (N - 2) // 2
if K > K0:
	print(-1)
else:
	print((N - 1) + (K0 - K))  # K0-Kがウニに追加する分
	# まずは1を中心にしてウニを作る
	for i in range(2, N + 1):
		print(1, i)
	# 追加分を出力
	cnt = 0
	for i in range(2, N):
		for j in range(i + 1, N + 1):
			cnt += 1
			if cnt > K0 - K:
				break
			print(i, j)


Measured memory_bytes: 3608
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;

struct Node {
	int key;
	Node *right, *left, *parent;
};

Node *root, *NIL;

void insert(int k) {
	Node *y = NIL;
	Node *x = root;
	Node *z;

	z = (Node*)malloc(sizeof(Node));
	z->key = k;
	z->left = NIL;
	z->right = NIL;

	while (x != NIL) {
		y = x;
		if (z->key < x->key) {
			x = x->left;
		}
		else {
			x = x->right;
		}
	}

	z->parent = y;
	if (y == NIL) {
		root = z;
	}
	else {
		if (z->key < y->key) {
			y->left = z;
		}
		else {
			y->right = z;
		}
	}
}

void inorder(Node *u) {
	if (u == NIL) return;
	inorder(u->left);
	printf(" %d", u->key);
	inorder(u->right);
}

void preorder(Node *u) {
	if (u == NIL) return;
	printf(" %d", u->key);
	preorder(u->left);
	preorder(u->right);
}

int main() {
	int n, i, x;
	string com;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		cin >> com;
		if (com == "insert") {
			scanf("%d", &x);
			insert(x);
		}
		else if (com == "print") {
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}

	return 0;
}


Measured memory_bytes: 26644
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define dfor(i,a,b) for(ll i=(a);i>=(b);i--)
#define mem(u, vis) memset(u, vis, sizeof(u))
#define ll long long
#define ull unsigned long long
#define MOD  1000000007
#define MAX  1e9
#define pb   push_back
#define F    first
#define S    second


signed main() {
	int t=1;
	//cin>>t;
	while(t--){
		int n,a,b;
		cin>>n>>a>>b;
		int n1 = a/n;
		int n2 = b/n;
		if(n1==n2 && (a%n!=0 && b%n!=0)){
			cout<<"NG";
		} 
		else
			cout<<"OK";
		
	}
	
}

Measured memory_bytes: 3624
/*
         Md.Fagun Molla
         18ICTCSE006
         BSMRSTU(SHIICT)
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define End return 0

int main () {
    ll a,b,n;
    cin>>a>>b>>n;
    if(a<b)
        swap(a,b);
    ll p=n/a;
    if(n%a)
        p++;
    cout<<p<<endl;
    End;
}
/* pray for me
All is well
*/



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<cstring>
#define cinf(n,x,y) for(int i=0;i<(n);i++) cin >> x[i]>>y[i];
typedef long long int ll;
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }

bool used[52][52][52][52];
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int ly,lx,rx,ry;
int h,w;
string field[99],field1[99];
bool inside(int y, int x, int H, int W) {
    return 0 <= y && y < H && 0 <= x && x < W;
}
bool chk(int y,int x,string s[]){
	return (s[y][x] !='#');
}
struct P{
	int rx,ry,lx,ly;
	P(int ly,int lx,int ry,int rx):ly(ly),lx(lx),ry(ry),rx(rx){};
};
bool bfs(){
	queue < P > q;
	q.push(P(ly,lx,ry,rx));

	while(!q.empty()){
		P p=q.front();q.pop();

		if(used[p.ly][p.lx][p.ry][p.rx])continue;
		used[p.ly][p.lx][p.ry][p.rx]=true;
		if(field[p.ly][p.lx]=='%' && field1[p.ry][p.rx]=='%'){return true;}
		if(field[p.ly][p.lx]=='%'||field1[p.ry][p.rx]=='%'){continue;}

		for(int i=0;i<4;i++){
			int nrx=p.rx;int nry=p.ry;int nlx=p.lx;int nly=p.ly;
			if(inside(nly+dy[i],nlx+dx[i],h,w)&&chk(nly+dy[i],nlx+dx[i],field)){nly+=dy[i],nlx+=dx[i];}
			if(inside(nry+dy[i],nrx-dx[i],h,w)&&chk(nry+dy[i],nrx-dx[i],field1)){nry+=dy[i],nrx-=dx[i];}
			if(used[nly][nlx][nry][nrx]==false){
				q.push(P(nly,nlx,nry,nrx));
			}
		}
	}
	return false;
}
int main(){
	while(1){
		cin >>w >>h;
		if(w==0&&h==0)break;
		for(int i=0;i<h;i++){
			cin >>field[i] >> field1[i];
		}
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				if(field[i][j]=='L')ly=i,lx=j;
				if(field1[i][j]=='R')ry=i,rx=j;
			}
		}
	for(int i=0;i<52;i++){
		for(int j=0;j<52;j++){
			for(int k=0;k<52;k++){
				for(int l=0;l<52;l++){
					used[i][j][k][l]=false;
				}
			}
		}
	}
	cout << (bfs()?"Yes":"No") << endl;
	}
}


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

#define rep(i,a,b) for(long long i = a; i < b; i++)
#define dump(a) for(auto x : a) cout << x << " "; cout << "\n"
#define print(a) cout << a << "\n"
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr << #x << ": " << x << ", " << #y << ": " << y << "\n"
#define debug3(x,y,z) std::cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << "\n"

typedef long long ll;
using vi   = vector<int>;
using vll  = vector<long long>;
using vs   = vector<string>;
using vvi  = vector<vector<int>>;
using vvll = vector<vector<long long>>;
using vvs  = vector<vector<string>>;

int main() {
  int D,S,T; cin >> D >> S >> T;
  cout << (D <= S * T ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ii = pair<int, int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using gt = greater<int>;
using minq = priority_queue<int, vector<int>, gt>;
using P = pair<ll,ll>;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int main() {
  int n,m; cin >> n >> m;
  vll a(n);
  rep(i,n) cin >> a[i];
  vll sum(n+1);
  rep(i, n) (sum[1+i] = a[i] + sum[i]) %= m;
  
  
  ll ans = 0;
  map<int, int> mp;
  for (int i=0; i<=n; i++) {
    mp[sum[i]]++;
    ans += mp[sum[i]]-1;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 7600
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int k(int x){
  int ans=1;
  rep(i,x) ans*=(i+1);
  return ans;
}
int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  vector<int> q(n);
  int sum_p=0,sum_q=0;
  vector<bool> nokori_p(n),nokori_q(n);
  rep(i,n){
    nokori_p[i]=false;
    nokori_q[i]=false;
  }
  rep(i,n) cin >> p[i];
  rep(i,n) cin >> q[i];
  int count;
  rep(i,n){
    count=0;
    rep(j,n){
      if(nokori_p[j]) continue;
      if(p[i]==j+1){
        nokori_p[j]=true;
        sum_p+=k(n-i-1)*count;
        break;
      }
      count++;
    }
  }
  rep(i,n){
    count=0;
    rep(j,n){
      if(nokori_q[j]) continue;
      if(q[i]==j+1){
        nokori_q[j]=true;
        sum_q+=k(n-i-1)*count;
        break;
      }
      count++;
    }
  }
  //cout << sum_p << endl;
  //cout << sum_q << endl;
  cout << abs(sum_q-sum_p) << endl;
}

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

using namespace std;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 100005;

int n;
int a[N];

int main() {

	FAST;

	int n, m;
	cin >> n >> m;
	if (n > m) swap(n, m);
	if (n == 1 && m == 1) {
		cout << 1 << '\n';
	}
	else if (n == 1 && m != 1) {
		cout << m - 2 << '\n';
	}
	else {
		cout << 1LL * (n - 2) * (m - 2) << '\n';
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
set<ll> S;
  for(ll i=0;i<3;i++) {
ll A;
    cin>>A;
    S.insert(A);
  }
  
  if(S.size()==2) {
cout<<"Yes"<<endl;
  }
  else {
cout<<"No"<<endl;
  }
}


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

int main() {
	//input
	int N, X, T;
	cin >> N >> X >> T;

	//calculation
	int output = (N - 1) / X + 1;
	output = output * T;

	//output
	cout << output << endl;


	return 0;
}


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

int dp[5005][5005];

int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = n-1; i >= 0; --i) {
    for (int j = n-1; j >= 0; --j) {
      if (s[i] != s[j]) dp[i][j] = 0;
      else dp[i][j] = dp[i+1][j+1]+1;
    }
  }
  int ans = 0;
  rep(i,n)rep(j,n) {
    if (i >= j) continue; // i < j;
    int now = min(dp[i][j], j-i);
    ans = max(ans, now);
  }
  cout << ans << endl;
  return 0;
}

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

namespace _0003
{
    public class Program

    {
        public static void Main(string[] args)
        {
            int n = ReadInt();
            for (int i = 0 ; i < n ; i++)
            {
                int[] line = ReadIntAr();
                line = line.OrderBy(x => x).ToArray();
                Console.WriteLine(Math.Pow(line[0], 2) + Math.Pow(line[1], 2) == Math.Pow(line[2], 2) ? "YES" : "NO");
            }
        }

        static string ReadSt() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Console.ReadLine()); }
        static long ReadLong() { return long.Parse(Console.ReadLine()); }
        static double ReadDouble() { return double.Parse(Console.ReadLine()); }
        static string[] ReadStAr(char sep = ' ') { return Console.ReadLine().Split(sep); }
        static int[] ReadIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => int.Parse(e)); }
        static long[] ReadLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => long.Parse(e)); }
        static double[] ReadDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => double.Parse(e)); }
        static string WriteAr(int[] array, string sep = " ") { return String.Join(sep, array.Select(x => x.ToString()).ToArray()); }
        static string WriteAr(double[] array, string sep = " ") { return String.Join(sep, array.Select(x => x.ToString()).ToArray()); }
        static string WriteAr(long[] array, string sep = " ") { return String.Join(sep, array.Select(x => x.ToString()).ToArray()); }

    }

}



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

using namespace std;
using ll = long long;
const int F = 26;
const int def = 1e6;


int n;
vector<int> c(F);
vector<vector<int>> a;


void init() {
    cin >> n;
    a.resize(n, vector<int>(F));
    for(int i = 0; i < F; i++)cin >> c[i];
    for(int i = 0; i < n; i++)for(int j = 0; j < F; j++)cin >> a[i][j];
}


int calc(vector<int> p) {
    int sum = 0;
    vector<int> last(F, -1);
    for(int i = 0; i < n; i++) {
        sum += a[i][p[i]];
        last[p[i]] = i;
        for(int j = 0; j < F; j++)sum -= (i - last[j]) * c[j];
    }
    return sum;
}


/***********debug tools***********/
template<typename A, typename B> ostream& operator<<(ostream& os, const pair<A,B>& p){os << "{" << p.first << "," << p.second << "}";return os; }
template<typename A, typename B> inline void print(pair<A,B> p){cerr << p << endl;}
template<class T> inline void print(vector<T> arr) {cerr << "["; for(int i = 0; i < (int)arr.size(); i++)cerr << arr[i] << (i == (int)arr.size() - 1 ? "]" : ",");cerr << endl;}
template<class T> inline void print(vector<vector<T>> arr) {cerr << "[-------------------" << endl; for(int i = 0; i < (int)arr.size(); i++) { print(arr[i]);} cerr << "-------------------]" << endl;}
/*********************************/

int main()
{
    init();

    vector<int> ans;
    int M = 1e5, nax = -1e9;
    std::random_device seed_gen;
    for(;M--;) {
        vector<int> se(F);
        iota(se.begin(), se.end(), 0);
        std::mt19937 engine(seed_gen());
        shuffle(se.begin(), se.end(), engine);
        vector<int> t(n);
        for(int i = 0; i < F; i++) {
            for(int j = se[i]; j < n; j += F)t[j] = i;
        }
        int cur = calc(t);
        if(cur > nax) {
            nax = cur;
            ans = t;
        }
    }
    for(auto i : ans)cout << i + 1 << endl;
}

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

int main() {
    string S;
    cin >> S;
    int n = int(S.size());
    vector<int> A(n,0);
    for (int i=0;i<n;i++) {
        int cnt = 0;
        if (S.at(i) == 'R') {
            while(S.at(i) == 'R') {
                i++;
                cnt++;
            }
            if (cnt % 2 == 0) {
                A.at(i) += (cnt/2);
                A.at(i-1) += (cnt/2);
            } else {
                A.at(i-1) += (cnt+1)/2;
                A.at(i) += cnt/2;
            }
        } 
    }
    for (int i=n-1;i>0;i--) {
        int cnt = 0;
        if (S.at(i) == 'L') {
            while(S.at(i) == 'L') {
                i--;
                cnt++;
            }
            if (cnt % 2 == 0) {
                A.at(i) += cnt/2;
                A.at(i+1) += cnt/2;
            } else {
                A.at(i+1) += (cnt+1)/2;
                A.at(i) += cnt/2;
            }
        }
    }
    for (int i=0;i<n;i++) {
        cout << A.at(i);
        if (i==n-1) cout << endl;
        else cout << " ";
    }
}

Measured memory_bytes: 3812
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<tuple>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define REP(i, n)  for(int i=0; i<(int)(n); i++)
#define REPS(i, n)  for(int i=1; i<=(int)(n); i++)
#define PER(i, n) for(int i=(int)(n)-1; i>= 0; i--)
#define PERS(i, n)  for(int i=(int)(n)-1; i>0; i--)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define RFOR(i, c)  for(__typeof((c).rbegin()) i=(c).rbegin(); i!=(c).end(); i++)
#define ALL(container)  (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) (container).size()
#define FILL0(n)  setfill('0') << right << setw(n)
#define mp(a, b)  make_pair(a, b)
#define toLower(c)  c+0x20
#define toUpper(c)  c-0x20
#define pb  push_back
#define eb  emplace_back

const int INF = 1<<28;
const int MOD = 1000000007;

int main(){
  int n, k; cin >> n >> k;
  double ans = 0;
  REPS(i, n){
    int init = i;
    int cnt = 0;
    while(init < k){
      init *= 2;
      cnt++;
    }
    ans += 1.0/pow(2.0, cnt)/n;
  }
  printf("%.12f\n", ans);
  return 0;
}

Measured memory_bytes: 384
package main

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

func main() {
	A := nextInt()
	B := nextInt()
	H := nextInt()
	M := nextInt()

	thm := float64(M) / 60 * math.Pi * 2
	thh := (float64(H) + float64(M)/60) / 12 * math.Pi * 2

	if thm == thh {
		fmt.Println(abs(A - B))
	} else {
		fmt.Printf("%.16f\n", math.Sqrt(float64(A*A+B*B)-math.Cos(absf(thm-thh))*float64(2*A*B)))
	}
}

func abs(a int) int {
	if a > 0 {
		return a
	}
	return -a
}

func absf(a float64) float64 {
	if a > 0 {
		return a
	}
	return -a
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

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

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 1788
def selectionsort(a,n):
    count=0
    for i in range(n):
        minj=i
        for j in range(i,n):
            if a[j]<a[minj]:
                minj=j
        if i!=minj:
            m=a[i]
            a[i]=a[minj]
            a[minj]=m
            count+=1
    return a,count

n=int(input())
a=list(map(int,input().split()))
ans=selectionsort(a,n)
print(" ".join(map(str,ans[0])))
print(ans[1])



Measured memory_bytes: 5600
//#pragma comment(linker, "/STACK:102400000,102400000") 
#pragma warning(disable:4996)
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, ll> pill;

#define eps 1e-10
#define LL_INF 0x3fffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back

const int maxn = 405;
const ll mod = 1000000007;
const double PI = acos(-1.0);

ll n, x;

ll cal(ll n, ll x)
{
	if (x <= 0)
	{
		return 3 * n;
	}
	if (n % x == 0 )
	{
		return n * 3LL;
	}
	else
	{
		return n / x*x * 3LL + cal(x, n%x);
	}
}

void solve()
{
	ll res = 0;
	if (x * 2LL >= n)
	{
		res = cal(x, n - x);
	}
	else
	{
		res = cal(n - x, x);
	}
	printf("%lld\n", res);
}
int main()
{
	while (cin >> n >> x)
	{
		solve();
	}
	return 0;
}


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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define INF (1<<30)
#define INFLL (1L<<63)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int x;
  cin >> x;
  if (x < 1200) cout << "ABC" << endl;
  else cout << "ARC" << endl;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, '%d %d %d', $n, $m, $x);
$a = array_fill(0, $n, array_fill(0, $m, 0));
$c = array_fill(0, $n, 0);
for ($i=0; $i < $n; $i++) { 
    $nums = array_map('intval', explode(' ', trim(fgets(STDIN))));
    $c[$i] = $nums[0];
    for ($j=0; $j < $m; $j++) { 
        $a[$i][$j] = $nums[$j+1];
    }
}
$ans = 12345678;
$all = 1<<$n;
for ($mask=0; $mask < $all; $mask++) { 
    $level = array_fill(0, $m, 0);
    $cost = 0;
    for ($i=0; $i < $n; $i++) { 
        if (($mask>>$i)&1) {
            $cost += $c[$i];
            for ($j=0; $j < $m; $j++) { 
                $level[$j] += $a[$i][$j];
            }
        }
    }
    $ok = true;
    for ($j=0; $j < $m; $j++) { 
        if ($level[$j] < $x) {
            $ok = false;
        }
    }
    if ($ok) {
        $ans = min($ans, $cost);
    }
}
if ($ans === 12345678) {
    echo -1;
} else {
    echo $ans;
}

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

int main(void) {
  int a, b;
  cin >> a >> b;
  bool is_odd = (a % 2) && (b % 2);
  if (is_odd) {
    cout << "Odd" << endl;
  } else {
    cout << "Even" << endl;
  }
  return 0;
}


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

# AtCoder Beginner Contest
# Problem B


def is_filled_with_all_bombs(s, height, width):
    bomb_count = 0

    for i in range(height):
        bomb_count += s[i][0].count('#')

    return bomb_count == height * width


def replace_dot_with_number(s, height: int, width: int) -> list:
    results = list()
    mod_s = ''

    for i in range(height):
        for j in range(width):
            if s[i][0][j] == '.':
                bomb_count = count_bombs_in_eigth_cells(s, i, j)
                mod_s += str(bomb_count)
            else:
                mod_s += '#'
        results.append(mod_s)
        mod_s = ''

    return results


def count_bombs_in_eigth_cells(s, x: int, y: int) -> int:
    count = 0
    height = len(s)
    width = len(s[0][0])

    for i in range(x - 1, x + 2):
        if (i == x - 1 < 0):
            continue
        if (i == x + 1 > height - 1):
            continue
        for j in range(y - 1, y + 2):
            if (j == y - 1 < 0):
                continue
            if (j == y + 1 > width - 1):
                continue

            if s[i][0][j] == '#':
                count += 1
    return count


def output(results):
    for line in results:
        print(''.join(line))


if __name__ == '__main__':
    height, width = list(map(int, input().split()))
    s = [list(map(str, input().split())) for _ in range(height)]

    if is_filled_with_all_bombs(s, height, width):
        output(s)
    else:
        results = replace_dot_with_number(s, height, width)
        output(results)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  vector<pair<int ,int>> st(m);
  for(int i=0;i<m;i++){
    cin>>st[i].second>>st[i].first;
  }
  int ans=0,t=0;
  sort(st.begin(),st.end());
  for(int i=0;i<m;i++){
    if(t<st[i].second){
      t=st[i].first-1;
      ans++;
    }
  }
  cout<<ans<<endl;
}

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

using namespace std;
#define ll long long


int main(){
	int h,n;
	int sum = 0;
	cin >> h >> n;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		sum += a;
	}
	if(sum >= h){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

std::string S[1000], T[2];
const int dx[4] = {0, 1, 0, 1}, dy[4] = {0, 0, 1, 1};
int M, N;

int f(int y, int x){
    if(y < 0 || x < 0){return 0;}
    if(y+1 >= M || x+1 >= N){return 0;}
    for(int i=0;i<4;i++){
        if(S[y+dy[i]][x+dx[i]] != T[dy[i]][dx[i]]){return 0;}
    }
    return 1;
}

int main(){
    std::cin >> M >> N;

    for(int i=0;i<M;i++){
        std::cin >> S[i];
    }

    for(int i=0;i<2;i++){
        std::cin >> T[i];
    }

    int count = 0;
    for(int i=0;i+1<M;i++){
        for(int j=0;j+1<N;j++){
            count += f(i, j);
        }
    }

    int res = count;
    for(int i=0;i<M;i++){
        for(int j=0;j<N;j++){
            for(int k=0;k<3;k++){
                int x = 0;
                for(int l=0;l<4;l++){
                    x -= f(i-dy[l], j-dx[l]);
                }

                char prev = S[i][j];
                S[i][j] = "JOI"[k];

                for(int l=0;l<4;l++){
                    x += f(i-dy[l], j-dx[l]);
                }

                S[i][j] = prev;
                
                res = std::max(res, count + x);
            }
        }
    }

    std::cout << res << std::endl;
}

Measured memory_bytes: 2260
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 1e4 + 10;
bitset<N> b;
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	b[0] = 1;
	int n;
	cin >> n;
	while (n--)
	{
		int x;
		cin >> x;
		b |= b << x;
	}
	int ans = 0;
	for (int i = 1; i < N; i++)
	{
		if (b[i] && i % 10)
			ans = i;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
"use strict"
function main(arg) {
    var data = arg.trim().split("\n")[0].split(" ").map(Number)
    if (data[0] * 500 >= data[1]) {
        console.log('Yes')
    } else {
        console.log('No')
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21064
#include <iostream>
#include <string>
#include <vector>
// #include <unordered_map>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <climits>

using namespace std;

#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define FOR(i, j, k) for(int i=j ; i<k ; i++)
#define RFOR(i, j, k) for(int i=j ; i>=k ; i--)
#define REP(i, j) FOR(i, 0, j)
#define RREP(i, j) RFOR(i, j, 0)
#define PI 3.1415926535897932384626433832795
typedef long long int ll;
typedef unsigned long long int  ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef vector<vi> vvi;

struct edge {
    int from ,to ,cost;
};

edge es[2005];
ll d[2005];
int N, M;

#define INF (1LL << 50)

int main() {

    cin >> N >> M;

    REP(i, M){
        cin >> es[i].from >> es[i].to >> es[i].cost;
        es[i].from--;
        es[i].to--;
        es[i].cost = -es[i].cost;
    }
    REP(i, N) d[i] = INF;
    d[0] = 0;

    REP(loop, N-1) {
        REP(i, M) {
            edge e = es[i];
       //     cout << d[e.from] << " " << d[e.from]  + e.cost << endl;
            if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost ){
                d[e.to] = d[e.from] + e.cost;
            }
        }
    }

    ll ans = d[N-1];

    bool negative[2005];
    REP(i, N) negative[i] = false;

    REP(loop, N){
        REP(i, M){
            edge e = es[i];

            if (d[e.from] == INF) continue;

            if (d[e.to] > d[e.from] + e.cost) {
                d[e.to] = d[e.from] + e.cost;
                negative[e.to] = true;
            }

            if (negative[e.from] == true) {
                negative[e.to] = true;
            }
        }
    }


    if (negative[N-1]) {
        cout << "inf" << endl;
    } else 
        cout << -ans << endl;
    return 0;
}


Measured memory_bytes: 256
from itertools import permutations

n = int(input())
all_ = list(permutations([i+1 for i in range(n)], n))
l_p = tuple(map(int, input().split()))
l_q = tuple(map(int, input().split()))

res = abs(all_.index(l_p) - all_.index(l_q))
print(res)

Measured memory_bytes: 8052
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007 
#define all(n)      (n).begin(), (n).end()
#define ll long long 
#define PI 3.14159265358979323846

void solve(){
	int r; cin >> r;
	long double ans;
	ans = (2.000000000000 * PI * (long double)r);
	cout << setprecision(25) << ans << endl;
	

}


int main (){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt", "w", stdout);
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	//Write from here.
	
		solve();
	
	return 0;
}

Measured memory_bytes: 3800
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
    char s[12] ;
    scanf ("%s",s) ;
    char ans[12]="\0" ;
    for (int i=0; i<strlen(s); i++){
        int len=strlen(ans);
        if (s[i]=='0'){
            ans[len]='0' ;
        } else if (s[i]=='1') {
            ans[len]='1' ;
        } else {
            ans[len-1]='\0' ;
        }
    }
    printf ("%s\n",ans) ;
    return 0 ;
}

Measured memory_bytes: 128
n = int(input())
data_list = [[0, 0, 0]]
for i in range(n):
    t, x, y = map(int, input().split())
    data_list.append([t, x, y])

flag = False
for i in range(n):
    for j in range(data_list[i+1][0] - data_list[i][0]):
        t_diff = abs(data_list[i+1][0] - data_list[i][0])
        x_diff = abs(data_list[i+1][1] - data_list[i][1])
        y_diff = abs(data_list[i+1][2] - data_list[i][2])
        if x_diff + y_diff <= t_diff:
            if ((x_diff + y_diff) % 2 == 0 and t_diff % 2 == 0) or ((x_diff + y_diff) % 2 == 1 and t_diff % 2 == 1):
                pass
            else:
                print('No')
                flag = True
                break
        else:
            print('No')
            flag = True
            break
    if flag:
        break
if flag == False:
    print('Yes')



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

int main() {

    int n;
    cin >> n;

    double tmp_a = 0;
    double sum = 0;
    double tmp_num = 0;
    for ( int i = 0; i < n; i++ ) {
        tmp_num = 1;
        cin >> tmp_a;
//        cout << tmp_a << endl;
        tmp_num /= tmp_a;
        sum += tmp_num;
    }

    cout << 1 / sum << endl;

    return 0;
}

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

    #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
    #define uint unsigned int
    #define lli long long int
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define pii pair<int,int>
    #define all(x) (x).begin(), (x).end()
    #define forn(i, n)  for(int i=0;i<n;++i)
    #define rforn(i,start) for(int i = start; i >= 0;--i)
    #define forsn(i,start,end) for(int i=start;i<end;++i)
    #define rforsn(i,start,end) for(int i=start;i>=end;--i)
    #define debug(x) cout<<#x<<" = "<<x<<"\n";
    const int CONST = 1e9 + 7;
    const double pi = 3.14159265358979323846;

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

        #ifndef ONLINE_JUDGE
        //    freopen("input.txt", "r", stdin);
        //  freopen("output.txt","w",stdout);
        #endif
        
        lli x, y;
        cin>>x>>y;
        if(y&1){
            cout<<"No"<<endl;
        }
        else{
            lli t = (y/2)-x;
            lli c = x-t;
            if(c<0 || t<0){
                cout<<"No"<<endl;
            }
            else{
                cout<<"Yes";
            }
        }
    }


Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.141592653589793238
#define dcout cout<<fixed<<setprecision(50)

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long
#define double long double

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

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

  int H, W, N; cin >> H >> W >> N;
  H = max(H, W);
  cout << (N+H-1) / H << endl;
}

Measured memory_bytes: 256