akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
      }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;


signed main(){
  int n;
  scanf("%lld", &n);
  printf("Christmas");
  rep(i,25-n){
    printf(" Eve");
  }
  printf("\n");
  return 0;
}






Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;

public class Main
{
	public static void main(String []args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		
		String []s=br.readLine().split(" ");
		int H = Integer.parseInt(s[0]);
		int A = Integer.parseInt(s[1]);
		
				
		if(H%A!=0)
			out.println((H/A)+1);
		else
			out.println((H/A));
	
	}
}




Measured memory_bytes: 22484
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
int cnt_digits(ll n){
  int digits = 0;
  while(n>0){
    n /= 10;
    digits++;
  }
  return digits;
}
int main() {
  ll n;
  cin >> n;
  int ans = cnt_digits(n);
  for(int a=1; a<=100000; a++){
    if(n%a!=0) continue;
    ll b = n/a;
    int cur = max(cnt_digits(a),cnt_digits(b));
    if(ans>cur){
      ans = cur;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////



int main(){fastio
    ll a,b,c,x,y;cin>>a>>b>>c>>x>>y;
    ll ans=inf;
    for(ll nc=0;nc<=220000;nc+=2){
        ll na=max(0,x-nc/2);
        ll nb=max(0,y-nc/2);
        
            Min(ans,na*a+nb*b+nc*c);
        
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
from collections import deque


def solve():
    S = int(input())
    mod = 10**9 + 7

    dp = deque([1, 0, 0])
    for _ in range(S-2):
        dp.append((dp.popleft() + dp[-1])%mod)
    return dp[-1]


if __name__ == '__main__':
    ans = solve()
    print(ans)

Measured memory_bytes: 9304
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {
	
	public static class Interval implements Comparable<Interval> {
		int range, last;

		public Interval(int range, int last) {
			super();
			this.range = range;
			this.last = last;
		}

		@Override
		public int compareTo(Interval o) {
			return Integer.compare(this.last, o.last);
		}
	}
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			
			PriorityQueue<Interval> queue = new PriorityQueue<Interval>();
			for(int i = 0; i < N; i++) {
				final int A = sc.nextInt();
				final int B = sc.nextInt();
				queue.add(new Interval(A, B));
			}
			
			int time = 0;
			while(!queue.isEmpty()) {
				final Interval work = queue.poll();
				
				if(time + work.range <= work.last) {
					time += work.range;
				}else {
					System.out.println("No");
					return;
				}
			}
			
			System.out.println("Yes");
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

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

int main() {
	int H, W, h, w;
	cin >> H >> W >> h >> w;
	cout << H * W - (h * W + H * w) + h * w << endl;

}

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

int main(){
    int N;
    cin >> N;
    int nums[N];
    for(int i = 0; i < N; i++){
        cin >> nums[i];
    }
    int not_zero_count = 0;
    map<int, int> nums_map;
    string ans_string = "";
    for(int i = 0; i < N; i++){
        if(!nums_map[nums[i]]){
            not_zero_count++;
        }
        nums_map[nums[i]]++;
        if(!nums_map[nums[i]]){
            not_zero_count--;
        }
        if(!nums_map[nums[N - i - 1]]){
            not_zero_count++;
        }
        nums_map[nums[N - i - 1]]--;
        if(!nums_map[nums[N - i - 1]]){
            not_zero_count--;
        }
        if(!not_zero_count){
            ans_string += to_string(i + 1) + " ";
        }
    }
    ans_string.pop_back();
    cout << ans_string << endl;
}


Measured memory_bytes: 6024
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
const int mod = 1000000007;


int main(){
  int n;
  cin >> n;
  vector<int> l(n), r(n);
  ll ans = 0;
  rep(i, n) cin >> l[i] >> r[i];
  rep(i, n){
    ans += r[i] - l[i] + 1;
  }
  cout << ans << endl;
}


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

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

Measured memory_bytes: 256
package main

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

func main() {
	nextReader = newScanner()
	a, b, c, d := nextInt(), nextInt(), nextInt(), nextInt()
	if (c+b-1)/b <= (a+d-1)/d {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// ---------------------------------------------------------------
// I/O
// ---------------------------------------------------------------
var nextReader func() string

func newScanner() func() string {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 1024), int(1e11))
	sc.Split(bufio.ScanWords)
	return func() string {
		sc.Scan()
		return sc.Text()
	}
}

func nextString() string { return nextReader() }

func nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }

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


Measured memory_bytes: 1756
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;




namespace contest
{

    class contest
    {


        static void Main(string[] args)
        {


            //int n = int.Parse(Console.ReadLine());
            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();


            var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int n = num[0];
            int t = num[1];

            //long cost = 0;

            var memo = new int[3];
            memo[0] = int.MaxValue;
            for(int i =0; i< n; i++)
            {
                if (arr[i] < memo[0])
                {
                    memo[0] = arr[i];
                }
                else if(arr[i]>memo[0] && Math.Abs(arr[i]-memo[0])>memo[1])
                {
                    memo[1] = arr[i] - memo[0];
                    memo[2] = 1;
                }
                else if (arr[i] > memo[0] && Math.Abs(arr[i] - memo[0]) == memo[1])
                {
                    
                    memo[2] ++;
                }

            }



            Console.WriteLine(memo[2]);
            


          


        }

        

    }


}


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

#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>

#define _USE_MATH_DEFINES
#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>

#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

const i64 mod = 1000000007ll;
const i64 smod = 998244353ll;
const i64 inf = 10000000000000007ll;

const double eps = 1e-10;

// #include "segtree_push.h"

// del

struct less_key {
    bool operator() (const pair<i64, i64>& p1, const pair<i64, i64>& p2) {
        return p1.second < p2.second || (p1.second == p2.second && p1.first < p2.first);
    }
};

const i64 MAXN = 100005;

i64 n;

pair<i64, i64> a[MAXN];
map<i64, vector<i64>> q;
map<i64, vector<i64>> p;

map<i64, set<i64>> r;
map<i64, i64> h;

// dsu
i64 dsu[MAXN];

void make_set(i64 v) {
    dsu[v] = v;
}

i64 find_set(i64 v) {
    if (v == dsu[v]) {
        return v;
    }
    return dsu[v] = find_set(dsu[v]);
}

void union_sets(i64 a, i64 b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        dsu[b] = a;
    }
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed);

    cin >> n;

    for (i64 i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
    }

    for (i64 i = 0; i < n; i++) {
        q[a[i].first].push_back(a[i].second);
        p[a[i].second].push_back(a[i].first);
    }

    for (i64 i = 1; i < MAXN; i++) {
        make_set(i);
    }

    for (const auto& z : q) {
        const auto& v = z.second;
        for (auto j : v) {
            union_sets(find_set(v[0]), find_set(j));
        }
    }

    for (const auto& z : p) {
        i64 t = z.first;
        const auto& v = z.second;

        i64 i = find_set(t);

        h[i] += 1;
        for (auto c : v) {
            r[i].insert(c);
        }
    }

    i64 R = 0;
    for (const auto& z : r) {
        i64 i = z.first;
        const auto& v = z.second;

        R += v.size() * h[i];
    }

    cout << R - n << endl;

    return 0;
}

Measured memory_bytes: 16384
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX;
#define INFL LLONG_MAX;
typedef long long ll;
using namespace std;

int main(){
  int64_t q,h,s,d,n;
  cin >> q >> h >> s >> d >> n;
  int64_t ans = 0;
  ans += (n/2)*min(min(q*8,h*4),min(s*2,d));
  ans += (n%2)*min(min(q*4,h*2),s);
  cout << ans << endl;
}

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

int main() {
  int N, a, b, c, d, e, f, g, h, i, z, x;
  cin >> N;
  a = N / 100000000;//おおきい
  b = ( N - (a * 100000000 ) ) / 10000000;
  c = (N - (a * 100000000 + b * 10000000)) / 1000000;
  d = (N - (a * 100000000 + b * 10000000 + c * 1000000)) / 100000;
  e = (N - (a * 100000000 + b * 10000000 + c * 1000000 + d *100000)) / 10000;
  f = (N - (a * 100000000 + b * 10000000 + c * 1000000 + d *100000 + e * 10000)) / 1000;
  g = (N - (a * 100000000 + b * 10000000 + c * 1000000 + d *100000 + e * 10000 + f * 1000)) / 100;
 h= (N - (a * 100000000 + b * 10000000 + c * 1000000 + d *100000 + e * 10000 + f * 1000 + g * 100)) / 10;   
 i = (N - (a * 100000000 + b * 10000000 + c * 1000000 + d *100000 + e * 10000 + f * 1000 + g * 100 + h *10)) / 1; 
    z = a + b + c + d + e + f + g + h + i;
  x = N % z;
  if(x == 0){
  cout << "Yes" << endl;}
 else{
 cout << "No" << endl;}
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		String[] a = saori.nextHayami().split("");
		String[] b = saori.nextHayami().split("");
		String[] c = saori.nextHayami().split("");
		String s = a[0];
		int ai = 1;
		int bi = 0;
		int ci = 0;
		String ans = "";
		while(true){
			if(s.equals("a")){
				if(ai >= a.length){
					ans = "A";
					break;
				}
				s = a[ai];
				ai++;
			}
			if(s.equals("b")){
				if(bi >= b.length){
					ans = "B";
					break;
				}
				s = b[bi];
				bi++;
			}
			if(s.equals("c")){
				if(ci >= c.length){
					ans = "C";
					break;
				}
				s = c[ci];
				ci++;
			}
		}
		System.out.println(ans);
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21076
#include<stdio.h>
int main(void)
{
	int n,hyo[24][60]={0},h,m,i,j,na=0,p=0;
	for(j=0;j<2;j++){
		scanf("%d",&n);
		na=na+n;
		for(i=0;i<n;i++){
			scanf("%d%d",&h,&m);
			if(hyo[h][m]==1){
				na--;
			}
			hyo[h][m]=1;
		}
	}
	for(i=0;i<24;i++){
		for(j=0;j<60;j++){
			if(hyo[i][j]==1){
				printf("%d:%02d",i,j);
				p=p+1;
				if(p!=na){
					printf(" ");
				}
			}
		}
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 624
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

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

using namespace std;

using ll = long long;
using ii = pair<ll, ll>;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
ll comb(ll, ll);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int n;
    cin >> n;
    string w[n];
    rep(i, n) { cin >> w[i]; }

    map<string, int> m;

    char temp = w[0][0];
    bool ans = true;
    rep(i, n) {
        if (w[i][0] != temp) {
            ans = false;
            break;
        } else {
            temp = w[i][w[i].size() - 1];
        }

        if (m[w[i]]) {
            ans = false;
            break;
        } else {
            m[w[i]]++;
        }
    }

    if (ans) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

ll comb(ll a, ll b) {
    if (a < b) {
        return 0;
    }

    ll v[a + 1][a + 1] = {};

    rep(i, a + 1) {
        v[i][0] = 1;
        v[i][i] = 1;
    }

    repd(k, 2, a + 1) {
        repd(j, 1, k) { v[k][j] = v[k - 1][j - 1] + v[k - 1][j]; }
    }

    return v[a][b];
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

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

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define L long long
#define pb push_back
#define pi pair<int,int>
#define aa first
#define bb second
#define mp make_pair
using namespace std;
int n,m,f[100010];
vector<int> a[100010];
set<pi> x;
pi w;
bool g[100010];
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j,k;
	scanf("%d",&n);
	for(i=1;i<n;i++)
	  {
	   scanf("%d%d",&j,&k);
	   a[j].pb(k);
	   a[k].pb(j);
	  }
	scanf("%d",&m);
	while(m--)
	  {
	   scanf("%d%d",&i,&j);
	   f[i]=j;
	   g[i]=1;
	   x.insert(mp(j,i));
	  }
	while(!x.empty())
	  {
	   w=*x.begin();
	   x.erase(w);
	   for(i=0;i<a[w.bb].size();i++)
	     if(!g[a[w.bb][i]])
	       {
			f[a[w.bb][i]]=f[w.bb]+1;
			g[a[w.bb][i]]=1;
			x.insert(mp(f[a[w.bb][i]],a[w.bb][i]));
		   }
	  }
	for(i=1,k=0;i<=n;i++)
	  for(j=0;j<a[i].size();j++)
	    if(abs(f[i]-f[a[i][j]])!=1)
	      k=1;
	if(k)
	  printf("No\n");
	else
	  {
	   printf("Yes\n");
	   for(i=1;i<=n;i++)
	     printf("%d\n",f[i]);
	  }
	return 0;
}


Measured memory_bytes: 11648
n = int(input())
h = list(map(int, input().split()))
for i in range(n-1):
  if h[n-1-i] >= h[n-2-i]:
    continue
  elif h[n-2-i] - h[n-1-i] == 1:
    h[n-2-i] -= 1
  else:
    print("No")
    break
else:
  print("Yes")

Measured memory_bytes: 14252
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#include <functional>
#define   mod  (int)1e9+7
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi   vector<int> 
#define   co(x)  cout << x << '\n' 
#define   dbg(x)  cerr << #x << " = " << x << '\n' 
#define   bitcount(x)  (int)__builtin_popcount(x) 
#define   sz(x)  (int)x.size()
#define   all(a) a.begin(),a.end() 
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std ; 

int bigmod(int a, int p, int m) { 
    if (p == 0)  return (1 % m) ; 
    if (p & 1){ 
        int p1 = a % m ;
        int p2 = bigmod( a, p-1, m ) ; 
        return  (p1 * p2) % m ; 
    } 
    int p1 = bigmod( a, p/2, m ) ; 
    return  (p1 * p1) % m ; 
}

string  s ; 
int dp[100005][13] ; 
int p[100005];


int fun(int idx,int num) { 
    if (idx == sz(s)) { 
        return ( num == 5 ) ; 
    }
    if (dp[idx][num] >= 0) return  dp[idx][num] ; 
    int sum = 0 ; 
    if (s[idx] == '?') { 
        for (int i=0;i<=9;i++) { 
            int x = (num + (i * p[idx])) % 13 ; 
            sum += fun(idx+1, x) ; 
        } 
    } 
    else { 
        int x = (num + ((s[idx]-'0') * p[idx])) % 13 ;
        sum = fun(idx+1, x) ; 
    }
    sum %= mod;
    return  dp[idx][num] = sum ; 
} 

// 002005 ??2??5


signed main() 
{ 
    memset(dp,-1,sizeof(dp)) ; 
    for (int i=0;i<=100000;i++) p[i] = bigmod(10,i,13) ; 
    cin >> s ; 
    reverse(s.begin(), s.end()) ; 
    cout << fun(0,0) << endl ; 
    return 0; 
} 


Measured memory_bytes: 20888
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func main() {
    n := strings.Split(nextLine(), " ")
    a, _ := strconv.Atoi(n[0])
    b, _ := strconv.Atoi(n[1])
    fmt.Println(a*b,2*(a+b))
}


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

int main()
{
    int r;
    cin >> r;
    cout << r * r << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>

#define INF 2147483647
#define RMQ_SIZE 262144

void update(int pos, int value);
int getMin(int right, int left);
int dfs(int a,int b,int k,int l,int r);
int min(int a, int b);

int tree[RMQ_SIZE];

int main()
{
    int n, q, i, tmp, a, b;

    scanf("%d %d", &n, &q);

    for (i = 0; i < n; i++) {
        update(i, INF);
    }
    for (i = 0; i < q; i++) {
        scanf("%d %d %d", &tmp, &a, &b);
        if (tmp) {
            printf("%d\n", getMin(a, b+1));
        } else {
            update(a, b);
        }
    }
            
    return 0;
}


int dfs(int a,int b,int k,int l,int r)
{
    int m;
    //* ????±????????????????????????¬???????????¢?´¢.
    if (r <= a || b <= l) {
        return INF;
    }
    //* ??¨?????¬?????????????±?????????\???????????????.
    if (a <= l && r <= b) {
        return tree[k];
    }
    m = (l+r)/2;
    return min(dfs(a, b, k*2+1, l, m), dfs(a, b, k*2+2, m, r));
}

int getMin(int right, int left)
{
    return dfs(right, left, 0, 0, RMQ_SIZE/2);
}

void update(int pos, int value)
{
    pos += (RMQ_SIZE/2 -1);
    tree[pos] = value;
    while (pos) {
        pos = (pos-1)/2;
        tree[pos] = min(tree[pos*2+1], tree[pos*2+2]);
    }
}

int min(int a, int b)
{
    return a < b ? a: b;
}

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

#define lp_ui(k,n) for(ui i = (k); i < (n); ++i)
#define lp_ul(k,n) for(ul i = (k); i < (n); ++i)

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

using namespace std;

ull solve(void)
{
	ui r;
	cin >> r;

	return 3L*(r * r);
}

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

	auto ans = solve();
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <set>
#include <map>
#include <numeric>
#include <string>

int main() {
  size_t N;
  scanf("%zu", &N);

  std::vector<std::pair<int, int>> BA(N);
  for (auto& bai: BA) {
    int A, B;
    scanf("%d %d", &A, &B);
    bai = std::make_pair(B, A);
  }

  std::sort(BA.begin(), BA.end());

  int cur = 0;
  for (auto const& bai: BA) {
    int A, B;
    std::tie(B, A) = bai;
    cur += A;
    if (cur > B) return puts("No"), 0;
  }
  puts("Yes");
}


Measured memory_bytes: 1792
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
int main(){
  int n;
  while(cin>>n,n+1){
    double rad=0;
    double dis=1;
    rep(i,n-1){
      rad+=atan(1/dis);
      dis=hypot(dis,1);
    }
    printf("%.10f\n%.10f\n",dis*cos(rad),dis*sin(rad));
  }
}

Measured memory_bytes: 1260
#include<stdio.h>

int main(void){


int a,b,c,n,x;


n=0;


x=0;


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


if(a>=1&&a<=10000&&b>=1&&b<=10000&&c>=1&&c<=10000){


for(a;a<=b;a++){


if(c%a==0){


x=x+1;


}


}


}


printf("%d\n",x);


return 0;


}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int n,m;
int a[1000005],b[1000005],c[1000005];
int f[1005][1<<12];
int main()
{
	memset(f,0x3f,sizeof(f));
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&a[i],&b[i]);
		for(int j=1;j<=b[i];j++)
		{
			int x;
			scanf("%d",&x);
			c[i]+=1<<(x-1);
		}
	}
	for(int i=0;i<=m;i++)
		f[i][0]=0;
	for(int i=1;i<=m;i++)
		for(int j=0;j<(1<<n);j++)
		{
			f[i][j]=min(f[i][j],f[i-1][j]);
			f[i][j|c[i]]=min(f[i][j|c[i]],min(f[i-1][j|c[i]],f[i-1][j]+a[i]));
		}
	int ans=0x3f3f3f3f;
	for(int i=1;i<=m;i++)
		ans=min(ans,f[i][(1<<n)-1]);
	printf("%d",ans>=0x3f3f3f3f?-1:ans);
}

Measured memory_bytes: 20864
n,m=[int(x) for x in input().rstrip().split()]
a=[int(x) for x in input().rstrip().split()]
a.sort(reverse=True)
d=[]
bc=[]
for i in range(m):
  b,c=[int(x) for x in input().rstrip().split()]
  bc.append([b,c])

cnt=0
bc.sort(key=lambda x:x[1],reverse=True)
for b,c in bc:

  d.extend([c]*b)
  cnt+=b
  if n<cnt:
    break
  
d.sort(reverse=True)
a+=d
a.sort(reverse=True)
print(sum(a[:n]))


Measured memory_bytes: 28740
#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
    cin>>n;
    int dice[n][6];
    int ans[6][6]={{6,2,4,1,3,6},{3,6,0,5,6,2},{1,5,6,6,0,4},{4,0,6,6,5,1},{2,6,5,0,6,3},{6,3,1,4,2,6}};
    for (int i=0;i<n;i++){
        for(int j=0;j<6;j++){
            cin>>dice[i][j];
        }
    }
    string result="Yes";
    for (int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            for(int k=0;k<6;k++){
                if(dice[i][0]==dice[j][k]){
                    int d1=k;
                    for (int l=0;l<6;l++){
                        if(dice[i][1]==dice[j][l]&&ans[d1][l]!=6){
                            int d2=l;
                            int d3=ans[d1][d2];
                            if(dice[i][2]==dice[j][d3]&&dice[i][3]==dice[j][5-d3]&&dice[i][4]==dice[j][5-d2]&&dice[i][5]==dice[j][5-d1]){
                                result="No";
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
    
    cout<<result<<endl;
    return 0;
}


Measured memory_bytes: 3224
result = []
while True:
    (m, f, r) = [int(i) for i in input().split()]
    sum = m + f

    if m == f == r == -1:
        break

    if m == -1 or f == -1:
        result.append('F')
    elif sum >= 80:
        result.append('A')
    elif sum >= 65:
        result.append('B')
    elif sum >= 50:
        result.append('C')
    elif sum >= 30:
        if r >= 50:
            result.append('C')
        else:
            result.append('D')
    else:
        result.append('F')
    

[print(result[i]) for i in range(len(result))]

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9

using namespace std;
typedef long long int lli;
typedef long long ll;

int main() {
    int a,b,c;
    cin >> a >> b >> c;

    map<int,int> cnt;
    cnt[a]++;
    cnt[b]++;
    cnt[c]++;

    if(cnt[5] == 2 && cnt[7] == 1) cout << "YES" << endl;
    else cout << "NO" << endl;
}


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

int main()
{
	int n, k;
	vector <int> v;
	cin >> n >> k;
	for (int i =0; i<n; i++){
		int l;
		cin >> l;
		v.push_back(l);
	}
	sort (v.begin(), v.end());
	int result = 0;
	for (int i = 0; i < k; i++){
		result += v[i];
	}
	cout << result;
    return 0;
}

Measured memory_bytes: 3184
N = int(input())
T = list(map(int,input().split()))
A = list(map(int,input().split()))
A.append(1)
count = 0
Tmax = 1
Amax = 1
T2 = [0] * N
A2 = [0] * N
ans = 1

for i in range(N):
    if T[i] > Tmax and A[i] > A[i+1] and T[i] != A[i]:
        ans = 0
        break
    elif T[i] > Tmax and A[i] > A[i+1] and T[i] == A[i]:
        count = 1
        Tmax = T[i]
        Amax = A[i+1]
    elif T[i] > Tmax and A[i] == A[i+1] and T[i] > A[i]:
        ans = 0
        break
    elif T[i] > Tmax and A[i] == A[i+1] and T[i] <= A[i]:
        count = 1
        Tmax = T[i]
    elif T[i] == Tmax and A[i] > A[i+1] and A[i] > T[i]:
        ans = 0
        break
    elif T[i] == Tmax and A[i] > A[i+1] and A[i] <= T[i]:
        count = 1
        Amax = A[i+1]
    else:
        count = min(A[i],T[i])
    ans *= count
    ans = ans % (10**9+7)
print(ans)

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

#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << "\t|";
    __f(comma + 1, args...);
}


#define print(x) for(auto it : x) cout<< it << ' '; cout << '\n';
typedef long long ll;
typedef unsigned long long ull;

const int MOD = 1e9 + 7;
ll mod(ll a) { return (ll) (a % MOD + MOD) % MOD; }
ll mul(ll a, ll b) { return (ll) mod(mod(a) * mod(b));}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int l, r, d; cin >> l >> r >> d;
    int ans = 0;
    for (int i = l; i <= r; i++) {
        if (i % d == 0) {
            ans++;
        }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int>number;

#define INF 1000000000

int BinSearch(int* table, int number, int key);

int main() {

	int N;
	cin >> N;	
	number.resize(N+1);

	//入力
	for (int i = 1; i <= N; i++) {
		cin >> number[i];

	}

	int* table = (int*)calloc(N+1, sizeof(int));

	//DPテーブル初期化
	for (int i = 1; i <= N; i++) {
		table[i] = INF;
	}

	//DPテーブル作成
	for (int i = 1; i <= N; i++) {
		
		//二分探索で与えられた数列の値がテーブルの何番目に入れるべきか計算する。
		//テーブルには大きさ順で値を入れる。
		table[BinSearch(table,i,number[i])]=number[i];
		
	}

	//最長増加部分列を求める
	int Max;
	for (int i = 1; i <= N; i++) {

		if (table[i] != INF) {
			Max = i;

		}
	}
	cout << Max<<"\n";

	return 0;
}

int BinSearch(int* table, int number, int key) 
{

	int left = 1;
	int right =number;
	
	int InsertValue = key;

	do {
		int mid = (right + left) / 2;

		if (left == right) {
			return right;
		}

		//テーブルに追加する値が中央の値より小さいとき、右をmid-1にする
		if (InsertValue < table[mid]) {
			right = mid;
		}

		//テーブルに追加する値が中央の値より大きいとき、左をmid+1にする
		if (InsertValue > table[mid]) {
			left = mid+1;
		}

		//テーブルに追加する値が中央の値と同じ時、何もしない
		//すでに追加されている値と同じということ
		if (InsertValue == table[mid]) {
			return mid;
		}

	
	} while ((left <= right));
	
}



Measured memory_bytes: 3544
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define inf LLONG_MAX/10000000
#define INF LLONG_MAX/3
#define P pair<int,int>
using namespace std;
signed main(){
	int n;
	cin>>n;
	if(n==1)cout<<"Hello World"<<endl;
	else {
		int a,b;
		cin>>a>>b;
		cout<<a+b<<endl;
	}
	return 0;	
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<=n;i++)
typedef int long long ll;
using namespace std;

int main(){
    ll a,b,c,x;
    cin>>a>>b>>c>>x;
    ll ans=0;
    
    rep(i,a){
        rep(j,b){
            rep(k,c){
                if(i*500+j*100+k*50==x){
                    ans++;
                }
            }
        }
    }
    cout<<ans<<endl;
   
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const int MAXN = 200005;

int n; lint k;
int a[2 * MAXN];
int mp[2 * MAXN];
lint nxt[60][MAXN];

int main(){
	scanf("%d %lld",&n,&k);
	for(int i=0; i<n; i++) scanf("%d",&a[i]), a[i + n] = a[i];
	for(int i=2*n-1; i>=0; i--){
		if(i < n) nxt[0][i] = mp[a[i]] - i + 1;
		mp[a[i]] = i;
	}
	for(int i=1; i<60; i++){
		for(int j=0; j<n; j++){
			lint sum = nxt[i - 1][j];
			sum += nxt[i - 1][(j + sum) % n];
			sum = min(sum, (lint)1e18);
			nxt[i][j] = sum;
		}
	}
	lint pos = 0;
	for(int i=59; i>=0; i--){
		if(pos + nxt[i][pos % n] <= n * (k - 2)){
			pos += nxt[i][pos % n];
		}
	}
	while(pos < n * k){
		while(pos + nxt[0][pos % n] <= n * k){
			pos += nxt[0][pos % n];
		}
		if(pos == n * k) break;
		printf("%d ", a[pos % n]);
		pos++;
	}
}


Measured memory_bytes: 98432
#include <iostream>
#include <vector>
int main(void){
	using namespace std;
	int i,j;
	long long int fact[100000]={0};
	for(i=0; i<100000; i++){
		if(i==0) fact[i] = 1;
		else fact[i] = (fact[i-1]*i)%1000000007;
	}
	long int N,K;
	cin >> N;
	while(N!=0){
		cin >> K;
		long int a,b;
		long int value=0;
		vector <long int> data;
		vector <long int> index;
		for(i=0; i<N; i++){
			data.push_back(i);
			index.push_back(i);
		}
		for(i=0; i<K; i++){
			cin >> a >> b;
			a = a-1;
			b = b-1;
			if(a+1 != b){
				for(j=a+1; j<b; j++){
					if(data[j]<data[a] && data[b]<data[j]){
						index[j] += 1;
						index[a] += 1;
					}
					else if(data[a]<data[j] && data[j]<data[b]){
						index[j] -= 1;
						index[b] -= 1;
					}
					else if(data[j]<data[a] && data[j]<data[b]){
						index[a] += 1;
						index[b] -= 1;	
					}
				}
			}
			if(data[a]>data[b]){
				index[a] += 1;
			}
			else if(data[a]<data[b]){
				index[b] -= 1;
			}
			swap(index[a],index[b]);
			swap(data[a],data[b]);
		}
		for(i=0; i<N; i++){
			value += (data[i] - index[i])*fact[N-1-i] % 1000000007;
		}
		value = value % 1000000007;
		cout << value <<endl;
		cin >> N;
	}
	return 0;
}

Measured memory_bytes: 4844
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <climits>
#include <cmath>
#include <utility>
#include <iomanip>

using namespace std;



int main(int argc, char *argv[])
{
	string s;

	//input
	cin >> s;



	//calc
	map<char, int> letter_count;
	for (int i = 0; i < 4; i++){
		letter_count[s[i]]++;
	}
	
	string ans = "";
	if (letter_count.size() != 2){
		ans = "No";
	}
	else{
		ans = "Yes";
	}


	//ans
	cout << ans << endl;



	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#define MOD 998244353
#define MAX 1000005
#define loop(i,a,b) for(long long int i=a;i<b;i++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
typedef long long int ll;

using namespace std;
//using namespace boost::multiprecision;

ll prime[MAX];
void sieve()
{
	prime[1] = 1;
	for(ll i=2;i<MAX;i++)
	if(prime[i]==0)
	for(ll j=i;j<MAX;j+=i)
	prime[j]=i;
}

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

//sieve();


ll t=1;
//cin>>t;

loop(k,0,t)
{
	ll n,m;
	cin>>n>>m;
	ll ans = 0,sum=0,a[n];
	loop(i,0,n)
	{
		ll x;
		cin>>x;
		sum += x;
		a[i] = x;
	}
	loop(i,0,n)
	{
		if(a[i]*4*m >= sum)
		ans++;
	}
	
	if(ans>=m)
	cout<<"Yes\n";
	else
	cout<<"No\n";
}



return 0;
}


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

#solve
def solve():
    h, w, n = IR(3)
    print(min(n // h + (n % h > 0), n // w + (n % w > 0)))
    return
#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 39920
import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
for i in range(N):
    A[i] = -A[i]

heapq.heapify(A)
for i in range(M):
    tmp = heapq.heappop(A)
    tmp = -tmp // 2
    heapq.heappush(A,-tmp)
print(-sum(A))

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

int main(){
    using namespace std;
    unsigned long N, M;
    cin >> N >> M;
    vector<unsigned long> P(N + 1);
    unsigned long ans{0}, pena{0};
    const auto& accept = [&P, &ans, &pena, &M](unsigned long i){
        if(P[i] > M)return;
        pena += P[i];
        ++ans;
        P[i] = M + 1;
    };
    const auto& wrong_answer = [&P](unsigned long i){
        ++P[i];
    };
    for(unsigned long i{0}, p; i < M; ++i){
        string s;
        cin >> p >> s;
        if(s == "AC")accept(p);
        else wrong_answer(p);
    }
    cout << ans << " " << pena << endl;
    return 0;
}

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

int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
    cout << 0 << endl;
  }
  else {
    cout << min({a * b, a * c, b * c}) << endl;
  }
}

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

int a[1005];

int main() {
    int n,k;
    long long ans=0;
    cin>>n>>k;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<k;i++)
        ans+=a[i];
    cout<<ans<<endl;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define MOD 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(var) (var).begin(), (var).end()
#define MAXX 9000000000000000000
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pair<int,int> > 
#define vvpi vector<vector<pair<int,int> > >

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

	int n;
	cin >> n;
	if(n % 2 == 0)
	{
		cout << -1;
		return 0;
	}

	int i,j,x,y=1,fre[n+5]={0};
	x = 7;
	x %= n;
	if(!x)
	{
		cout << 1;
		return 0;
	}

	fre[x] = 1;
	while(true)
	{
		x *= 10;
		x += 7;
		x %= n;
		y++;
		if(!x)
		{
			cout << y;
			return 0;
		}
		if(y >= 2 * n)
		{
			cout << -1;
			return 0;
		}
		fre[x] = 1;
	}
	return 0;
}

Measured memory_bytes: 11372
import java.util.Scanner;

/**
 * ABC129 A
 *
 */
public class Main {

    public static void main(String[] args) {
        int a = 0;
        int b = 0;
        int c = 0;

        try (Scanner sc = new Scanner(System.in)) {
            a = sc.nextInt();
            b = sc.nextInt();
            c= sc.nextInt();
        }
        int sum = a + b +c;
        int max = 0;
        if(a >= b && a  >= c){
            max  = a;
        }else if(b >= a && b  >= c){
            max = b;
        }else{
            max = c;
        }

        System.out.println(sum - max);
    }

}


Measured memory_bytes: 21204
# coding: utf-8
# Your code here!

n = int(input())

pl = list(map(int,input().split()))

ans = 0
for i in range(1,n-1):
    if pl[i-1] < pl[i] < pl[i+1]:
        ans += 1
    if pl[i+1] < pl[i] < pl[i-1]:
        ans += 1
print(ans)
        

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MAX 1000000007
#define MAXN 100005
bool sortby1column(vector<ll> &v1,vector<ll> &v2){
 return v1[0]<v2[0];
}


int main(){
	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
  	int t=1;
	//cin>>t;
	while(t--){
	    ll x,y,a,b,c;
	    cin>>x>>y>>a>>b>>c;
	    ll red[a],gre[b],les[c];
	    for(int i=0;i<a;i++)
	        cin>>red[i];
	    for(int i=0;i<b;i++)
	        cin>>gre[i];
	    for(int i=0;i<c;i++)
	        cin>>les[i];
	    sort(red,red+a,greater<int>());
	    sort(gre,gre+b,greater<int>());
	    sort(les,les+c,greater<int>());
	    ll p=0,q=0,r=0,ans=0,tot=0;
	    while(tot<x+y){
	        ll plus = 0;
	        ll *tem ;
	        if(r<c){
	        plus = les[r];
	        tem = &r;}
	        if(p<x&&red[p]>plus)
	            plus = red[p],tem =&p ;
	        if(q<y&&gre[q]>plus)
	            plus = gre[q],tem =&q ;
	        ans+=plus;
	        (*tem)++;
	        tot++;
	    }
	    cout<<ans<<endl;
    }
}

Measured memory_bytes: 2560
import os,re,sys,operator,math
from sys import stdin,setrecursionlimit

s=stdin.readline().rstrip()
lens=len(s)
loop1=1
loop2=lens-2
t2=list(s[-1])
t1=list(s[0])
now=0
z=""
while loop1<lens:
    z=str(s[loop1])
    ch=False
    while loop1<lens:
        if z!=t1[now]:
            t1.append(z)
            ch=True
            now+=1
            break
        else:
            loop1+=1
            if loop1<lens:
                z+=s[loop1]
    if not ch:
        t1[-1]+=z
    loop1+=1
z=""
now=0
while loop2>-1:
    z=str(s[loop2])
    ch=False
    while loop2>-1:
        if z!=t2[now]:
            t2.append(z)
            ch=True
            now+=1
            break
        else:
            loop2-=1
            if loop2>-1:
                z+=s[loop2]
    if not ch:
        t2[-1]+=z
    loop2-=1
print(max(len(t1),len(t2)))

Measured memory_bytes: 62964
#encoding:utf-8 No.0511 2014.11.10
n = 30
ary = Array.new(n,"no")
(n-2).times do
  i = gets.chomp.to_i
  ary[i-1] = "yes"
end

ary.each_with_index do |item,idx|
  if item != "yes"
    puts idx + 1
  end
end

Measured memory_bytes: 6092
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }
 
typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main(){
  string s;
  cin>>s;
  int cnt[100001] = {};
  int cur = 0;
  ll ans = 0;
  REP(i, s.size()){
    if(s[i] == '(') cur++;
    else cur--;
    ans += cnt[cur];
    cnt[cur]++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3708
#include<bits/stdc++.h>
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
#include<bits/stdc++.h>
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF 2000000000
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
typedef unsigned long long int ull;
typedef long long lint;
 
using namespace std;
 
int main(void){
  int N,ans=0;
  cin >> N;
  int S[N];
  rep(i,N) cin >> S[i];
  int Q;
  cin >> Q;
  int T[Q];
  rep(i,Q) cin >> T[i];
  sort(S,S+N);
  rep(i,Q) if(*lower_bound(S,S+N,T[i])==T[i]) ans++;
  cout << ans << endl;
}


Measured memory_bytes: 3628
#include <iostream>
using namespace std;
void swap(int& x, int& y) {
    int t = x;
    x = y;
    y = t;
}
int main() {
    int a, b, c, t;
    cin >> a >> b >> c;
    if (a > b) {swap(a, b);}
    if (b > c) {swap(b, c);}
    if (a > b) {swap(a, b);}
    cout << a << " " << b << " " << c << endl;
    return 0;
}


Measured memory_bytes: 3092