akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

class Node {
    public:
        int location;
        int p, l, r;
        Node() {}
};

class Point {
    public:
        int id, x, y;
        Point() {}
        Point(int id, int x, int y): id(id), x(x), y(y) {}
        bool operator < (const Point &p) {
            return id < p.id;
        }

        void print() {
            printf("%d\n", id);
        }
};

static const int MAX = 1000000;
static const int NIL = -1;

int N;
Point P[MAX];
Node T[MAX];
int np;

bool lessX(const Point &p1, const Point &p2) { return p1.x < p2.x; }
bool lessY(const Point &p1, const Point &p2) { return p1.y < p2.y; }

int makeKDTree(int l, int r, int depth)
{
    if ( !(l < r) ) return NIL;
    int mid = (l + r) / 2;
    int t = np++;
    if (depth % 2 == 0)
    {
        sort(P + l, P + r, lessX);
    }
    else
    {
        sort(P + l, P + r, lessY);
    }
    T[t].location = mid;
    T[t].l = makeKDTree(l, mid, depth + 1);
    T[t].r = makeKDTree(mid + 1, r, depth + 1); 
    
    return t;
}

void find(int v, int sx, int tx, int sy, int ty, int depth, vector<Point> &ans)
{
    int x = P[T[v].location].x;
    int y = P[T[v].location].y;

    if (sx <= x && x <= tx && sy <= y && y <= ty)
    {
        ans.push_back(P[T[v].location]);
    }

    if (depth % 2 == 0)
    {
        if (T[v].l != NIL)
        {
            if (sx <= x) find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
        }
        if (T[v].r != NIL)
        {
            if (x <= tx) find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
        }
    } else {
        if (T[v].l != NIL)
        {
            if (sy <= y) find(T[v].l, sx, tx, sy, ty, depth + 1, ans);
        }
        if (T[v].r != NIL)
        {
            if (y <= ty) find(T[v].r, sx, tx, sy, ty, depth + 1, ans);
        }
    }
}

int main()
{
    int x, y;
    scanf("%d", &N);
    for (int i = 0; i != N; ++i)
    {
        scanf("%d %d", &x, &y);
        P[i] = Point(i, x, y);
        T[i].l = T[i].r = T[i].p = NIL;
    }

    np = 0;

    int root = makeKDTree(0, N, 0);

    int q;
    scanf("%d", &q);
    int sx, tx, sy, ty;
    vector<Point> ans;
    for (int i = 0; i != q; ++i)
    {
        scanf("%d %d %d %d", &sx, &tx, &sy, &ty);
        ans.clear();
        find(root, sx, tx, sy, ty, 0, ans);
        sort(ans.begin(), ans.end());
        for (int j = 0; j != ans.size(); ++j)
        {
            ans[j].print();
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 16460
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
#define ll long long
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int main(){
	fastio();
	int n,k;
	cin>>n>>k;
	double a[n];

	for(int i=0;i<n;i++){
		cin>>a[i];
		double sum=0;
		for(int j=1;j<=a[i];j++) sum+=j;
			a[i] = (double)sum/a[i];
		//cout<<a[i]<<" ";
	}
	double ans=0;
	double cnt=0;
	for(int i=0;i<k;i++){
		cnt+=a[i];
	}
	ans = max(ans,cnt);
	for(int i=k;i<n;i++){
		cnt-=a[i-k];
		cnt+=a[i];
		ans=max(ans,cnt);
	}
	cout<<setprecision(15)<<ans;
}

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

int K;
int inf = 1e8;
int d[100001];

int main(){
	cin >> K;
	for(int i=0;i<=K;i++){
		d[i] = inf;
	}
	d[1] = 1;
	deque<int> deq;
	deq.push_front(1);
	while(deq.size()){
		int p = deq.front();
		deq.pop_front();
		if(p==0) break;
		if(d[(p*10)%K] > d[p]){
			d[(p*10)%K] = d[p];
			deq.push_front((p*10)%K);
		}
		if(d[(p+1)%K] > d[p]+1){
			d[(p+1)%K] = d[p]+1;
			deq.push_back((p+1)%K);
		}
	}
	cout << d[0] << endl;
}

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

int main(){
	int n ; cin >> n ;
	vector<int> a(n) ;
	vector<int> b(n) ;
	vector<int> c(n) ;
	for(int i=0;i<n;i++){
		cin >> a.at(i) ;
	}
	for(int i=0;i<n;i++){
		cin >> b.at(i) ;
	}
	for(int i=0;i<n;i++){
		c.at(i) = i+1 ;
	}
	if(a==b){
		cout << 0 << endl ;
		return 0 ;
	}
	int i=0 ;
	int ans_a = 0 ;
	int ans_b = 0 ;
	do{
		i++ ;
		if(a==c) ans_a = i ;
		if(b==c) ans_b = i ;
	}while(next_permutation(c.begin(),c.end())) ;
	cout << max(ans_a,ans_b)-min(ans_a,ans_b) << endl ;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>

int main(int argc, char const* argv[])
{
    int n;
    std::cin >> n;

    auto seq = std::vector<int>(n);
    for (auto& s : seq) {
        std::cin >> s;
    }

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

    auto result = 0;

    auto prev = seq[0];
    auto dup_num = 1;
    for (int i = 1; i < n; ++i) {
        if (prev == seq[i]) {
            dup_num++;
        }
        else {
            if (prev == dup_num) {
                // do nothing
            }
            else if (prev < dup_num) {
                result += dup_num - prev;
            }
            else {
                result += dup_num;
            }
            dup_num = 1;
        }

        prev = seq[i];
    }

    if (prev == dup_num) {
    }
    else if (prev < dup_num) {
        result += dup_num - prev;
    }
    else {
        result += dup_num;
    }

    std::cout << result << std::endl;
}

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

int main(){
    int n;  cin >> n;
    vector<int>a(n);
    rep(i, n)   cin >> a[i];
    bool flag = true;
    for(int i = 0; i < n && flag; i++){
        if(a[i]%2 == 0){
            if(a[i]%3 == 0 || a[i]%5 == 0)  flag = true;
            else    flag = false;
        }
    }
    if(flag){
        cout << "APPROVED" << endl;
    }else{
        cout << "DENIED" << endl;
    }
}


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

using namespace std;

int main()
{
	ll n;
	cin >> n;
	ll ar[n + 1], br[n];
	for(ll i = 0; i < n + 1; i++)
		cin >> ar[i];
	for(ll i = 0; i < n; i++)
		cin >> br[i];
	ll ans = 0;
	for(ll i = 0; i < n; i++)
	{
		ll mn = min(ar[i], br[i]);
		ans += mn;
		ar[i] -= mn;
		br[i] -= mn;
		mn = min(ar[i + 1], br[i]);
		ans += mn;
		ar[i + 1] -= mn;
		br[i] -= mn;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		int[][][] rooms = new int[4][3][10];

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		br.readLine();
		String line;
		while ((line = br.readLine()) != null) {
			String[] arr = line.split(" ");
			int b = Integer.parseInt(arr[0]) - 1;
			int f = Integer.parseInt(arr[1]) - 1;
			int r = Integer.parseInt(arr[2]) - 1;
			int v = Integer.parseInt(arr[3]);

			rooms[b][f][r] += v;
		}

		for (int b = 0; b < 4; b++) {
			for (int f = 0; f < 3; f++) {
				for (int r = 0; r < 10; r++) {
					System.out.print(" " + rooms[b][f][r]);
				}
				System.out.println();
			}
			if (b != 3)
				System.out.println("####################");
		}
	}
}

Measured memory_bytes: 19308
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define vec vector
#define vi vec<int>
#define vvi vec<vec<int>>
#define ALL(a) begin(a), end(a)
#define RALL(a) rbegin(a), rend(a)
#define SORT(a) stable_sort(ALL(a))
#define RSORT(a) stable_sort(RALL(a))
#define REV(a) reverse(ALL(a))
#define UNIQUE(a) a.erase(unique(ALL(a)), end(a))
#define lambda(i) [=](auto i)
#define compare(i, j) [=](auto i, auto j)
#define min_of(a) *min_element(ALL(a))
#define max_of(a) *max_element(ALL(a))
#define sum(a) accumulate(ALL(a), 0)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define SZ(a) (int)(a).size()
#define REP(i, n) for (decltype(+n) i = 0; i < (n); i++)
#define RREP(i, n) for (auto i = n - 1; i != static_cast<decltype(i)>(-1); i--)
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define RFOR(i, a, b) for (auto i = b - 1; i != a; i--)
#define EACH(i, a) for (auto&& i: (a))
using namespace std;

const int INF = 1e18;
const int MOD = 998244353;
int mod_add(int A, int B) { return (A + B) % MOD; }
int mod_sub(int A, int B) { return (A + MOD - B) % MOD; }
int mod_mul(int A, int B) { return ((A % MOD) * (B % MOD)) % MOD; }
int mod_bipow(int X, int Y) {
    if (Y == 0) return 1;
    else if (Y == 1) return X % MOD;
    else if (Y % 2 == 0) {
        int Z = mod_bipow(X, (int)(Y / 2));
        return mod_mul(Z, Z);
    } else {
        int Z = mod_bipow(X, (int)(Y / 2));
        return mod_mul(mod_mul(Z, Z), X);
    }
}
int mod_inv(int X) { return mod_bipow(X, MOD - 2); }
int mod_div(int A, int B) { return mod_mul(A, mod_inv(B)); }

int ceil_div(int X, int Y) {
  return (X - 1) / Y + 1;
}

struct vertex {
  vector<int> adj = vi(0);
};

struct union_find {
  vi data;
  union_find(int size) : data(size, -1) { }
  bool union_set(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find_set(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

vi cum(vi V) {
  vi U(SZ(V));
  partial_sum(ALL(V), begin(U));
  return U;
}

void solve() {
  int n, s;
  int ans = 0;

  cin >> n >> s;
  vi a(n);
  REP(i, n) {
    cin >> a[i];
  }
  vector<vvi> ks(n + 1, vvi(s + 1, vi(3))); // ??, L?, LR
  REP(i, 3) ks[0][0][i] = 1;
  REP(i, n) {
    REP(j, s + 1) ks[i + 1][j][0] = ks[i][j][0];
    REP(j, s + 1) ks[i + 1][j][1] = mod_add(ks[i][j][0], ks[i][j][1]);
    REP(j, s + 1) ks[i + 1][j][2] = mod_add(ks[i + 1][j][1], ks[i][j][2]);
    FOR(j, a[i], s + 1)REP(k, 2) ks[i + 1][j][1 + k] = mod_add(ks[i + 1][j][1 + k], ks[i][j - a[i]][1]);
  }

  cout << ks[n][s][2] << endl;
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(15);
  solve();
}


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

int main(){
	int a, b, c, d;

	cin >> a >> b >> c >> d;

	while(1){
		c -= b;
		a -= d;
		if(c <= 0){
			cout << "Yes" << endl;
			break;
		}
		else if(a <= 0){
			cout << "No" << endl;
			break;
		}
	}
}

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

int N, M, Z;

typedef vector<vector<int> > matrix;

matrix mult(matrix lhs, matrix rhs){
    int n = lhs.size();
    matrix r(n, vector<int>(n));
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < n; ++j){
            for(int k = 0; k < n; ++k){
                r[i][j] += rhs[i][k] * lhs[k][j];
            }
        }
    }
    return r;
}

matrix pow(matrix A, int p){
    if (p == 1) {
        return A;
    } else if (p % 2) {
        matrix T = pow(A, p-1);
        return mult(A, T); 
    } else {
        matrix T = pow(A, p/2);
        return mult(T, T); 
    }
}


int main(){
    while(cin >> N >> M >> Z && N>0){
        vector<pair<int, int> > edges;
        matrix a(2*M+1, vector<int>(2*M+1));
        edges.push_back(make_pair(0, 1));
        for(int i = 0; i < M; ++i){
            int s, d;
            cin >> s >> d;
            edges.push_back(make_pair(s, d));
            edges.push_back(make_pair(d, s));
        }
        for (int i = 0; i < edges.size(); ++i){
            for (int j = 0; j < edges.size(); ++j){
                if(i != j && edges[i].second == edges[j].first && edges[i].first != edges[j].second){
                    a[i][j] = 1;
                }else{
                    a[i][j] = 0;
                }
            }
        }
        
        a = pow(a, Z);
        bool flag = false;
        for (int i = 0; i < edges.size(); ++i){
            if(edges[i].second == N and a[0][i] != 0){
                flag = true;
                break;
            }
        }
        if(flag){
            cout << "yes" << endl;
        }else{
            cout << "no" << endl;
        }
    }
}

Measured memory_bytes: 5704
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>A(N);
  vector<int>B(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    B.at(i)=i+1;
  }
  for(int i=0;i<N;i++){
    if(A.at(i)!=i+1){
      int K=A.at(i);
      A.at(i)=A.at(K-1);
      A.at(K-1)=K;
      break;
    }
  }
  if(A==B){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
}
  

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
//const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};

using Data = pair<ll, vector<int> >;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; string s; cin >> n >> s;
    int c = 0, pre = 0;
    rep(i, n) {
        if (s[i] == '(') {
            c++;
        } else {
            c--;
            //先頭につける(の個数
            //repの中でやらなsample3みたいなケースで事故る
            if (c < 0) pre = max(pre, -c);
        }
    }
    rep(i, pre) s = '(' + s;
    n += pre; //文字数更新
    c = 0;
    rep(i, n) {
        if (s[i] == '(') {
            c++;
        } else {
            c--;
        }
    }
    rep(i, c) s = s + ')';
    cout << s << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  string s;
  cin >> s;
  ll res = 700;
  for(int i = 0;i < 3;i++){
    if(s[i] == 'o')res += 100;
  }
  cout << res << endl;
}

Measured memory_bytes: 3620
#include<stdio.h>

int main()
{
	int build[4][3][10];
	
	int i,j,k;
	for(i = 0;i<4;i++)
	{
		for(j=0;j<3;j++)
		{
			for(k = 0;k<10;k++)
			{
				build[i][j][k] = 0;
			}
		}
	}
	
	int n = 0;
	scanf("%d",&n);
	while(n--)
	{
		int b,f,r,v;
		scanf("%d %d %d %d",&b,&f,&r,&v);
		build[b-1][f-1][r-1] += v;	
	}
	
	for(i = 0;i<4;i++)
	{
		for(j=0;j<3;j++)
		{
			for(k = 0;k<10;k++)
			{
				printf(" %d",build[i][j][k]);
			}
			printf("\n");
		}
		if(i != 3)
		{
			printf("####################\n");
		}
	}
	return 0;
 } 


Measured memory_bytes: 2684
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> P;
typedef string str;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;

const ll mod=1e9+7;
const ll inf=1e16;

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m-1;i>=n;i--)
#define fi first
#define se second
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define eb(x) emplace_back(x)
#define pb(x) pop_back(x)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define sum(x) accumulate(all(x),0)
#define pc(x) __builtin_popcount(x)
#define gll greater<ll>()

void solve(){
  ll t;
  cin >> t;
  if(t==1){
   cout << "Hello World" << endl;
    return;
  }
  
  ll a,b;
  cin >>a >> b;
  a+=b;
  cout << a << endl;
}

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


Measured memory_bytes: 3656
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		int D = Integer.parseInt(tokens[0]);
		int T = Integer.parseInt(tokens[1]);
		int S = Integer.parseInt(tokens[2]);
		if (T * S >= D) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

	void calc() {
	}

	void showResult() {
	}
}


Measured memory_bytes: 25348
n, y = map(int, input().split())

for i in range(n+1):
  for j in range(n+1):
    res = y - (10000*i + 5000*j)
    k = n - i-j
    if (res == 1000*k) and (k>=0):
      print(i, j, n-i-j)
      exit()
      
print('-1 -1 -1')


Measured memory_bytes: 2940
//結び目を適当にほどいていくと分かることがあって、
//これは「2本のロープ」の部分が必ずできるというもの。
//最もきつい場面に注目するというテクニックによって気付くことができる。
//長さの制約的に「きつく」なるのは「終盤」であり、序盤ではなく、終盤何が起きるのか、
//特に最後の1個手前が一番つらいので、そこで何が起きるのかを考えると見通しが良い。
//
//少し詰めて考えると、a[i] + a[i + 1]の最大値をmとしたとき、m < Lなら不可能と分かる。
//m >= Lのときは、適当に具体例を書くと分かるが、ロープi, i + 1の結び目を最後にほどきさえすれば良く、Yes。

#include <iostream>
using namespace std;

int n, l;
int a[100000];

int main() {
	int i;
	
	cin >> n >> l;
	for (i = 0; i < n; i++) cin >> a[i];
	
	int m = a[0] + a[1];
	int pos = 0;
	for (i = 0; i + 1 < n; i++) {
		if (m < a[i] + a[i + 1]) {
			m = a[i] + a[i + 1];
			pos = i;
		}
	}
	
	if (m < l) { cout << "Impossible" << endl; return 0; }
	
	cout << "Possible" << endl;
	for (i = 0; i < pos; i++) {
		cout << i + 1 << endl;
	}
	for (i = n - 2; i > pos; i--) {
		cout << i + 1 << endl;
	}
	cout << pos + 1 << endl;
	return 0;
}

Measured memory_bytes: 1152
n,k = map(int, input().split()) #右の要素に対して左の関数を適応する
a = list(map(int, input().strip().split())) #strip()は文字列の両端の空白や改行を削除する

for i in range(len(a)):
    a[i] -= 1 #入力値を添字に合わせる

visited = [-1] * n #[-1. -1. -1. …]を定義
now = 0
visited[0] = 0
pre_roop = 0
pos = 0
i = 1
r = 1
while i <= k:
    next = a[now] #次に移動する場所
    #print('roop:',i,now+1,next+1)
    if visited[next] >= 0:
        r = i-visited[next]
        pre_roop = visited[next]
        pos = next
        #print(i,r,pre_roop,next)
        #print(visited)
        break #同じ場所に帰ってきたらfor文を抜け出す
    else:
        visited[next] = i
        now = next
        #print(i,visited)
        i += 1

if i > k:
    print(now + 1) #今いる場所を出力
else:
    l = (k - pre_roop) % r
    i = 0
    p = pos
    while i < l:
        p = a[p]
        i +=1

    print(p+1)


Measured memory_bytes: 32404
#include <stdio.h>
int main(void){
    float max,min,temp;
    scanf("%f",&max);
    min = max;
    while(scanf("%f",&temp)!=EOF){
        if(temp > max) {
            max = temp;
        } else if (temp < min) {
            min = temp;
        }
    }
    printf("%f",max-min);
    return 0;
}

Measured memory_bytes: 644
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <string>
#include <iterator>

#define ll long long

using namespace std;

#define ELEM 3

bool grt(ll i, ll j) {
    return (i > j);
}

int main()
{
    ll N, M;
    cin >> N >> M;
    vector<vector<ll> > A(pow(2, ELEM), vector<ll>());
    ll rt = 0;
    for (ll i = 0; i < N; i++) {
        ll e[ELEM];
        for (ll j = 0; j < ELEM; j++) {
            cin >> e[j];
        }
        for (ll j = 0; j < pow(2, ELEM); j++) {
            ll d = 0;
            for (ll k = 0; k < ELEM; k++) {
                d += pow(-1, (j >> k) & 1) * e[k];
            }
            A[j].push_back(d);
        }
    }
    for (ll i = 0; i < pow(2, ELEM); i++) {
        sort(A[i].begin(), A[i].end(), grt);
        ll tmp = 0;
        for (ll j = 0; j < M; j++) tmp += A[i][j];
        rt = max(tmp, rt);
    }
    cout << rt << endl;
    return 0;
}


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

typedef long long ll;
typedef vector < ll > vl;
typedef vector < int > vi;
typedef vector < bool > vb;
typedef vector < vl > vvl;
typedef vector < vi > vvi;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
typedef vector < pll > vpll;
typedef vector < pii > vpii;
typedef vector < vpll > vvpll;
typedef vector < vpii > vvpii;

#define pb push_back
#define eb emplace_back
#define pf push_front
#define all(c) (c).begin(), (c).end()
#define ff first
#define ss second
#define mp(x,y) make_pair((x), (y))
#define boost ios_base::sync_with_stdio(false); cin.tie(NULL)



void solve(){
    
    string s, t; cin >> s >> t;
    int n = s.length();
    int cnt = 0;
    for(int i = 0; i < n; i++){
        cnt += s[i] != t[i];
    }
    cout << cnt << '\n';
    
}


int main(){
	boost;
	int t = 1;
// 	cin >> t;
// 	precompute();
	for(int i = 1; i <= t; i++){
	   // cout << "Case #" << i << ": ";
		solve();
	}
	return 0;
}

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

int main(){
  
  int N; // 要素数
  cin >> N;
  
  int mi = 1000000000; //最小数
  int ma = 0;
  
  for(int i = 0; i < N; i++){
    
    int A; //入力された値
    cin >> A;
    
    mi = min(A,mi); // mi の更新確認
    ma = max(A,ma); // ma の更新確認
    
  }
  cout << ma - mi << endl;
}

Measured memory_bytes: 256
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
A.insert(0,0)
dp = [[0 for _ in range(3)] for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(3):
        dp[i][j] = max(dp[i-1][(j+1)%3]+A[i][j],dp[i-1][(j+2)%3]+A[i][j])
print(max(dp[N]))

Measured memory_bytes: 74200
#include<bits/stdc++.h>
#define fi first
#define se second
#define bug cout<<"--------------"<<endl
using namespace std;
typedef long long ll;
const double PI=acos(-1.0);
const double eps=1e-6;
const int inf=1e9;
const ll llf=1e18;
const int mod=1e9+7;
const int maxn=2e5+10;
int n,m,k;
int sx,sy;
char s[maxn];
char t[maxn];
int xx[2],yy[2];
int dx[maxn][2],dy[maxn][2];
bool check(){
	if(xx[0]<1||xx[1]>n||yy[0]<1||yy[1]>m) return 1;
	return 0;
}
int main(){
	ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	cin>>n>>m>>k;
	cin>>sx>>sy;
	cin>>s+1;
	cin>>t+1;
	xx[0]=xx[1]=sx;
	yy[0]=yy[1]=sy;
	for(int i=1;i<=k;i++){
		if(s[i]=='L') yy[0]=yy[0]-1;
		else if(s[i]=='R') yy[1]=yy[1]+1;
		else if(s[i]=='U') xx[0]=xx[0]-1;
		else if(s[i]=='D') xx[1]=xx[1]+1;
		if(check()){
			cout<<"NO"<<endl;
			return 0;
		}
		if(t[i]=='L') yy[1]=max(yy[1]-1,1);
		else if(t[i]=='R') yy[0]=min(yy[0]+1,m);
		else if(t[i]=='U') xx[1]=max(xx[1]-1,1);
		else if(t[i]=='D') xx[0]=min(xx[0]+1,n);
		if(check()){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;
	return 0;
}


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

int main() {
  int N;
  scanf("%d", &N);
  int t[N],x[N],y[N];
  for (int i = 0; i < N; ++i) {
    scanf("%d%d%d", &t[i],&x[i],&y[i]);
  }

  int holda = 0;
  int holdb = 0;
  bool flug = true;

  for (int i = 0; i < N; ++i) {
    int dis = abs(x[i]-holda)+abs(y[i]-holda);
    if(dis>t[i] || dis%2!=t[i]%2) flug = false;
    holda = x[i];
    holdb = y[i];
  }

  if(flug==true) cout << "Yes" << endl;
  else cout << "No" << endl;

}



Measured memory_bytes: 1408
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


def BellmanFord(N, e, s, goal):

    dist = defaultdict(lambda: sys.maxsize)
    pred = defaultdict(lambda: -1)

    dist = [sys.maxsize] * (N+1)
    dist[s] = 0
    for _ in range(N+1):
        for u, v, c in e:
            if dist[v] > dist[u] + c:
                dist[v] = dist[u] + c
    
    d = dist[goal]
    for _ in range(N+1):
        for u, v, c in e:
            if dist[v] > dist[u] + c:
                dist[v] = dist[u] + c
    return dist, d != dist[goal]

@mt
def slv(N, M, P, ABC):

    e = []
    for a, b, c in ABC:
        e.append((a, b, -(c - P)))

    d, loop = BellmanFord(N, e, 1, N)
    return max(0, -d[N]) if not loop else -1


def main():
    N, M, P = read_int_n()
    ABC = [read_int_n() for _ in range(M)]
    print(slv(N, M, P, ABC))

    # N = 2500
    # M = 5000
    # P = random.randint(0, 10**5)
    # P= 0
    # ABC = [
    #     [random.randint(1, N), random.randint(1, N), random.randint(1, 10**5)] for _ in range(M)
    # ]
    # print(slv(N, M, P, ABC))



if __name__ == '__main__':
    main()


Measured memory_bytes: 64600
#include <bits/stdc++.h>
using namespace std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define mod       1000000007
#define double    long double
#define ull       unsigned long long
#define vi        vector<ll>
#define ppi       pair<int,int>
#define pii       pair<pair<int,int>,int>
#define pb        push_back
#define pi        2*acos(0.0)
#define rev       greater<int>()
#define pr(a,x,y) for(int i=x;i<y;i++){cout<<a[i]<<" ";}
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define rall(v)   v.rbegin(), v.rend()
#define test      cout<<"This is test"<<endl;
#define str       string
#define endl      '\n'
#define e         cout<<'\n';
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
/*ll get(ll *arr,ll low,ll high,ll n){
	int mid=low+(high-low)/2;
	if((mid==0 or arr[mid-1]<=arr[mid]) and (mid==(n-1) or arr[mid+1]<=arr[mid])){
		return arr[mid];
	}
	else if(mid>0 and arr[mid-1]>arr[mid]){
		return get(arr,low,mid-1,n);
	}
	else{
		return get(arr,mid+1,high,n);
	}
}*/
/*ll get(int *arr,int n,int left,int i){
	if(i==n){return 1;}
	int curr=arr[i];
	int right=get(arr,n,arr[i]*left,i+1);
	arr[i]=left*right;
	return curr*right;
}*/
/*ll get(int *arr,int n){
	int low=0,high=n-1;
	while(low<=high){
		int mid=low+(high-low)/2;
		int prev=(mid-1+n)%n;
		int next=(mid+1)%n;
		if(arr[mid]<=arr[prev] and arr[mid]<=arr[next]){
			return mid;
		}
		else if(arr[low]<=arr[mid]){
			low=mid+1;
		}
		else if(arr[high]>=arr[mid]){
			high=mid-1;
		}
	}
}*/
/*void get(map<str,int>&m,str s,str ans=""){
	if(s.size()==0){cout<<ans;e;return;}
	for(int i=1;i<=(int)s.size();i++){
		str x=s.substr(0,i);
		if(m[x]){
			get(m,s.substr(i),ans+" "+x);
		}
	}
}*/
vi v[1000000];
int vis[1000000];
int cnt;
void dfs(int node){
	cnt+=1;
	vis[node]=1;
	for(auto i:v[node]){
		if(!vis[i]){
			dfs(i);
		}
	}
}
void solve(){
	ll n,m;cin>>n>>m;
	memset(vis,0,sizeof(vis));
	for(int i=0;i<m;i++){
		ll a,b;cin>>a>>b;
		v[a].pb(b);
		v[b].pb(a);
	}
	ll ans=0;
	for(int i=1;i<=n;i++){
		if(!vis[i]){
			cnt=0;
			dfs(i);
			//cout<<cnt;e;
			ans=max(cnt,ans);
		}
	}
	cout<<ans;
}
int32_t main(){
	kehsihba();
	//init();
	ll t=1;
	//cin>>t;
	for(int k=1;k<=t;k++){
		//cout<<"Case #"<<k<<": ";
		solve();
		//e;
	}
}


Measured memory_bytes: 47336
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;

int main()
{
    int n;
    cin >> n;
    int zoro_count = 0;
    for(int i=0; i<n; ++i){
        int d1, d2;
        cin >> d1 >> d2;
        if (d1 == d2){
            zoro_count += 1;
            if (zoro_count >= 3){
                cout << "Yes" << endl;
                return 0;
            }
        }else{
            zoro_count = 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main(){
    ll N,A;
    cin>>N>>A;
    cout<<pow(N,2)-A;
    return 0;
}

Measured memory_bytes: 256
N, K = map(int, input().split())

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

A.sort(key=lambda x:x[0])
cur = 0
i = 0
while cur < K:
    cur += A[i][1]
    i += 1
print(A[i-1][0])


Measured memory_bytes: 29144
#include <bits/stdc++.h>
#define fr(a,b,c) for(int a=b;a<c;a++)
using namespace std;

typedef long long ll;
ll dp[510000][3],mkd[510000][3], arr[510000];
ll mod=1e9+7;
ll go(int n,int st){
	if(n<0&&st<=1)return 0;
	else if(n<0)return -1e9;
	if(mkd[n][st])return dp[n][st];
	mkd[n][st]=1;
	if(st==2){
		if(!arr[n])dp[n][st]=-1e9;
		else if(arr[n]==1)dp[n][st]=go(n-1,0);
		else dp[n][st]=max(go(n-1,2)+arr[n]-1,go(n-1,1));
	}else if(st==1){
		if(!arr[n])dp[n][st]=go(n-1,0);
		else dp[n][st]=max(go(n-1,0)+arr[n],go(n-1,1)+arr[n]-1);
	}else{
		if(!arr[n])dp[n][st]=go(n-1,0);
		else dp[n][st]=max(go(n-1,1),go(n-1,2)+arr[n]);
	}
	return dp[n][st];
}

int main() {
	int n;string s;
	cin>>n>>s;
	int N=0;	
	fr(i,0,n){
		if(s[i]=='1')arr[N]++;
		else N++;
	}
	cout<<go(n,0)<<endl;
}

Measured memory_bytes: 51972
#最大公約数
def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

#最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)

#最大公約数（複数）
def gcds(l):
    if len(l) == 1:
        return l[0]
    elif len(l) == 2:
        return gcd(l[0], l[1])
    else:
        n = len(l) // 2
        L = l[:n]
        R = l[n:]
        return gcd(gcds(L), gcds(R))

#最小公倍数(複数)
def lcms(l):
	if len(l) == 1:
		return l[0]
	elif len(l) == 2:
		return lcm(l[0], l[1])
	else:
		n = len(l) // 2
		L = l[:n]
		R = l[n:]
		return lcm(lcms(L), lcms(R))
      
n, X = (int(i) for i in input().split())  
x = [int(i) for i in input().split()] 
x.append(X)
mm = min(x)
x.remove(mm)
#print(x)
for i in range(n):
  x[i] -= mm
#print(x)
print(gcds(x))

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output14.txt", "w", stdout);
#endif
	//ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	int dp[n + 1];
	dp[0] = 0;
	dp[1] = abs(a[1] - a[0]);
	for (int i = 2; i < n; i++)
	{
		dp[i] = min({dp[i - 1] + abs(a[i] - a[i - 1]), dp[i - 2] + abs(a[i] - a[i - 2])});

	}
	cout << dp[n - 1] << "\n";
	//cout << "\n";
}

Measured memory_bytes: 4368
import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		int[] a=new int[10];
		for(int i=0;i<4;i++) {
			int buff=sc.nextInt();
			if(a[buff]!=0) {
				System.out.println("NO");
				System.exit(0);
			}
			a[buff]++;
		}
		if(a[1]+a[9]+a[7]+a[4]==4) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}
/*各競技において，
3
 位の選手は
100000
 円，
2
 位の選手は
200000
 円，
1
 位の選手は
300000
 円の賞金を獲得します．また，コード部門と装置実装部門の両方で
1
 位となった選手は，さらに
400000
 円の賞金を獲得します．*/

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
const int maxn=300;
char s[maxn][maxn];
int main()
{
	int n,m,kk;
	int ans=0;
	scanf("%d%d%d",&n,&m,&kk);
	for(int i=0;i<n;i++) scanf("%s",s[i]);
	for(int i=0;i<(1<<n);i++)
	{
		for(int j=0;j<(1<<m);j++)
		{
			int cnt=0;
			for(int k=0;k<n;k++)
			{
				for(int u=0;u<m;u++)
				{
					if(s[k][u]=='#'&&((i>>k)&1)&&((j>>u)&1)) cnt++;
				}
			}
			if(cnt==kk) ans++;
		}
	}
	printf("%d",ans);
 } 

Measured memory_bytes: 3792
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using static System.Math;
using static System.Console;
using static System.Linq.Enumerable;
using static System.Numerics.BitOperations;

namespace ABC174
{
    class SolverC
    {
        static void Main()
        {
            SetOut(new StreamWriter(Console.OpenStandardOutput()){AutoFlush = false});
            new SolverC().Solve();
            Out.Flush();
        }

        public void Solve()
        {
            long K = Get.Long();
            long m = 0;
            long ans = -1;
            for(long i=0; i<K; i++){
                m = (10 * m + 7 ) % K;
                if(m==0){
                    ans = i+1;
                    break;
                }
            }
            WriteLine(ans);
        }




        private static class Get
        {
            public static string Str() => ReadLine().Trim();
            public static int Int() => int.Parse(Str());
            public static long Long() => long.Parse(Str());
            public static double Double() => double.Parse(Str());
            public static string[] Strs() => Str().Split(' ', StringSplitOptions.RemoveEmptyEntries);
            public static int[] Ints() => Strs().Select(int.Parse).ToArray();
            public static long[] Longs() => Strs().Select(long.Parse).ToArray();
            public static double[] Doubles() => Strs().Select(double.Parse).ToArray();
            static bool TypeEq<T,U>() => typeof(T).Equals(typeof(U));
            static T TypeConv<T,U>(U u) => (T)Convert.ChangeType(u, typeof(T));
            static T TypeConv<T>(string s) => TypeEq<T, int>() ?   TypeConv<T, int>(int.Parse(s))
                                        : TypeEq<T, long>() ?       TypeConv<T, long>(long.Parse(s))
                                        : TypeEq<T, double>() ?     TypeConv<T, double>(long.Parse(s))
                                        : TypeConv<T, string>(s);
            public static (T,U) Tuple<T,U>() {string[] strs = Strs(); T t = TypeConv<T>(strs[0]); U u = TypeConv<U>(strs[1]); return(t,u);}
            public static (T,U,V) Tuple<T,U,V>() {string[] strs = Strs(); T t = TypeConv<T>(strs[0]); U u = TypeConv<U>(strs[1]); V v = TypeConv<V>(strs[2]); return(t,u,v);}
        }
    }
}


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


int main() {

  int A1,A2,A3;
  cin >> A1 >> A2 >> A3;
  
  if((A1 + A2 + A3) > 21){
    cout << "bust" << endl;
  }else{
    cout << "win" << endl;
  }
  
  return 0; 
}


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

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

    std::string sa;
    std::string sb;

    for(int i = 0; i < b; i++) {
        sa += std::to_string(a);
    }

    for(int i = 0; i < a; i++) {
        sb += std::to_string(b);
    }

    if(sa > sb) {
        cout << sb << endl;
        return 0;
    }

    cout << sa << endl;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        int n=s.length();
        long ans=0;
        String[]ss=s.split("",0);
        for(int i=0;i<Math.pow(2,n-1);i++){
            String po="";
            for(int j=0;j<n;j++){
                po+=ss[j];
                if((1&i>>j)==1)po+="a";
            }
            String s2[]=po.split("a",0);
            for(int j=0;j<s2.length;j++)ans+=Long.parseLong(s2[j]);
        }
        System.out.println(ans);
    }
    
 
}


Measured memory_bytes: 24660
import collections

N,M = map(int,input().split())
L = [list(map(int,input().split())) for i in range(M)]

L_minus = [[] for i in range(N)]
L_plus = [0 for i in range(N)]

dp = [0 for i in range(N)]

for i in range(M) :
    x,y = L[i]
    x -= 1
    y -= 1
    L_plus[y] += 1
    L_minus[x].append(y)

A = collections.deque()

for i in range(N) :
    if L_plus[i] == 0 :
        A.append(i)

while A :
    x = A.popleft()
    
    for y in L_minus[x] :
        L_plus[y] -= 1
        if L_plus[y] == 0 :
            A.append(y)
        dp[y] = max(dp[y], dp[x]+1)

ans = max(dp)

print(ans)


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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const ll INF = 2e18;
const int inf = 1e9+10;
const int maxN = 200010;
const int maxD = 15;
const int maxH = 100; 
const int MOD = 1000000007;

int T;
char s[maxN];
int a[maxN];
int main()
{
	ll x;
	scanf("%lld",&x);
	double t = 100.0;
	int ans = 0;
	for(int i=1;;i++)
	{
		t = t*(1.01);
		if(ll(t) >= x)
		{
			ans = i;
			break;
		}
		t = 1.0 * ll(t);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3760
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  long long a;
 long long b;
  
  cin >> a >> b;
  long long c;
  c = (a * b + 1) / 2;
  if( (a-1) * (b-1) == 0)
  {cout << 1 << endl;}
  else{
  cout << c << endl;}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>
#include <math.h>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

#define ll long long
#define ull unsigned long long

#define	max	1000000007

class mod
{
public:
	ll val;

	mod(ll v)
	{
		val = v % max;
	}

	mod()
	{
		val = 0;
	}

	void operator -=(const mod &v)
	{
		val -= v.val;

		if (val < 0)
			val += max;		
	}

	void operator +=(const mod &v)
	{
		if (val + v.val >= max)
			val -= max;
		val += v.val;
	}

	void operator +=(ll &v)
	{
		if (val + v >= max)
			val -= max;
		val += v;
	}

	void operator *=(const mod &v)
	{
		val *= v.val;
		val %= max;
	}

	void operator *=(ll &v)
	{
		val *= v;
		val %= max;
	}

	ll modinv(ll a)
	{
		ll b = max, u = 1, v = 0;
		while (b) 
		{
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= max;
		if (u < 0)
			u += max;
		return u;
	}

	void operator /=(const mod &v)
	{
		val *= modinv(v.val);
		val %= max;
	}

	void operator /=(ll &v)
	{
		val *= modinv(v);
		val %= max;
	}
};

vector<int> xm, ym;
int x, y;

int main()
{
	int h, w, n;
	cin >> h >> w >> n;
	int b = h > w ? h : w;
	int r = n / b;
	if (n % b != 0)
		r++;
	printf("%d", r);
	return 0;
}


Measured memory_bytes: 888
n = int(input())
A = list(map(int, input().split()))
Acount = [0] * (max(A) + 1)
ans = 0

for i in range(n):
    Acount[A[i]] = Acount[A[i]] + 1

for i in range(1, max(A)):
    ans = max(ans, Acount[i - 1] + Acount[i] + Acount[i + 1])

if max(A) == 0 or max(A) == 1:
    ans = len(A)

print(ans)


Measured memory_bytes: 13964
n = int(input())
lis = [[0 for i in range(10)] for j in range(10)]
for i in range(1, n+1):
    s = str(i)
    l = int(s[0])
    r = int(s[-1])
    lis[l][r] += 1
ans = 0
for i in range(10):
    for j in range(10):
        if i == j:
            ans += lis[i][j] ** 2
        else:
            ans += lis[i][j] * lis[j][i]
print(ans)

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


int main() {
    int A, B;
    int ad, su, mu;
    std:cin >> A >> B;
    ad = A+B;
    su = A-B;
    mu = A*B;

    std::cout << max({ad, su, mu} )<< std::endl;

    return 0;
}


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

int main() {
  int N, res = 0;
  cin >> N;

  for (int i = 0; i < 15; i++) { 
    for (int j = 0; j < 25; j++) {
      int total = 7 * i + 4 * j;
      if (total == N) res++;
    }
  }   
  if (res > 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			long n = scanner.nextLong();
			int x = scanner.nextInt(), m = scanner.nextInt();
			List<Long> list = new ArrayList<>();
			// contains判定用
			Set<Long> set = new HashSet<>();
			long next = x % m;
			list.add(next);
			set.add(next);
			while (list.size() < n) {
				next = next * next % m;
				if (set.contains(next)) {
					break;
				}
				set.add(next);
				list.add(next);
			}
			if (list.size() == n) {
				System.out.println(list.stream().mapToLong(i -> i).sum());
			} else {
				int start = list.indexOf(next);
				long loop = list.stream().skip(start).mapToLong(i -> i).sum();
				long startSum = list.stream().mapToLong(i -> i).limit(start).sum();
				long bai = (n - start) / (list.size() - start);
				long remain = (n - start) % (list.size() - start);
				System.out.println(
						startSum + bai * loop + list.stream().mapToLong(i -> i).skip(start).limit(remain).sum());
			}
		}
	}
}


Measured memory_bytes: 44028
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define pb push_back
#define pf push_fron
#define INF 1e9
#define PI acos(-1)
typedef long long ll;

int plot[2010][2010];
char c;

int main() {
	int n, k, sum=0 , white=0;
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b >> c;
		a %= 2 * k; b %= 2 * k;
		if (c == 'B') { plot[b + 1][a + 1]++; sum++; }
		if (c == 'W') { plot[b + 1][a + 1]--; sum--; white++; }
	}

	for (int i = 1; i <= 2 * k; i++) {
		for (int j = 1; j <= 2 * k; j++) {
			plot[i][j] += plot[i][j - 1];
		}
	}

	for (int j = 1; j <= 2 * k; j++) {
		for (int i = 1; i <= 2 * k; i++) {
			plot[i][j] += plot[i - 1][j];
		}
	}

	int mx = -(1 << 25);
	for (int i = 0; i <= k; i++) {
		for (int j = 0; j <= k; j++) {
			int a = plot[i][j];
			int b = plot[i + k][j + k] - plot[i + k][j] - plot[i][j + k] + plot[i][j];
			int c = plot[2 * k][j] - plot[i + k][j];
			int d = plot[i][2 * k] - plot[i][j + k];
			int e = plot[2 * k][2 * k] - plot[2 * k][j + k] - plot[i + k][2 * k] + plot[i + k][j + k];
			int ppp = a + b + c + d + e;
			mx = max(mx, max(ppp, sum - ppp));
		}
	}

	mx += white;
	cout << mx << endl;

	return 0;
}

Measured memory_bytes: 16000
#include<iostream>
#include<string>

int main() {
	int K;
	std::string S;
	std::cin >> K >> S;
	if (S.size() <= K) std::cout << S << std::endl;
	else {
		for (int i = 0; i < K; i++) {
			std::cout << S[i];
		}
		std::cout << "..." << std::endl;
	}
	return 0;
}

Measured memory_bytes: 3532
#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 n;
    double t, a;
    cin >> n >> t >> a;
    vector<pair<double, int>> means(n);
    rep(i, n) {
        double h; cin >> h;
        means[i].first = abs(t-0.006*h - a);
        means[i].second = i;
        means[i].second++; 
    }
    sort(means.begin(), means.end());
    cout << means[0].second << endl;
    return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define itn int

typedef long long ll;
typedef pair<ll,ll> p;


int main()
{
  string o, e;
  cin >> o >> e;
  for (int i = 0; i < int(e.size()); i++)
  {
    cout << o[i] << e[i];
  }
  if(o.size() > e.size()) cout << o[o.size()-1] << endl;
  else cout << endl;
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<bool> a(8,false);
    int r;
    REP(i,n){
        cin >> r;
        if(r<400)a[0]=true;
        else if(r<800)a[1]=true;
        else if(r<1200)a[2]=true;
        else if(r<1600)a[3]=true;
        else if(r<2000)a[4]=true;
        else if(r<2400)a[5]=true;
        else if(r<2800)a[6]=true;
        else if(r<3200)a[7]=true;
        else a.pb(true);
    }
    int res=0,couf=0;
    for(bool flg:a){
        if(flg)res++;
        else couf++;
    }
    cout << max(1,8-couf) <<" "<< res << endl;

}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int a, b, c, x, y=0;
	 scanf("%d %d %d", &a, &b, &c);
		for(int x = a; x <= b; x++)  {
		    if(c%x==0){
		    y=y+1;
		    }
		}
		    printf("%d\n", y);
	
	return 0;
}




Measured memory_bytes: 2712
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int mem[101];
  for (int i = 0; i < 101; i++) {
    mem[i] = 0;
  }
  int cnt = 0;
  int d;
  for (int i = 0; i < n; i++) {
    cin >> d;
    if (mem[d] == 0) {
      mem[d] = 1;
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

int main() {
	int N,sum=0;
	cin >> N;
	int V[N];
	int C[N];
	for (int i = 0; i < N;i++) {
		cin >> V[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> C[i];
	}

	for (int i = 0; i < N; i++) {
		if (V[i] > C[i]) {
			sum = sum + V[i] - C[i];
		}
	}
	cout << sum << endl;
	return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    vector<int> sq(N, -1);
    for (int i = 0; i < N; i++) {
        auto it = lower_bound(sq.begin(), sq.end(), A[i]);
        it--;
        (*it) = A[i];
    }
    cout << distance(lower_bound(sq.begin(), sq.end(), 0), sq.end()) << endl;
    return 0;
}

Measured memory_bytes: 1024
/*
 
 * This code is written by Sanskar Agarwal
 
*/
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define VPLL vector<PLL>
#define VPII vector<PII>
#define PQ priority_queue<PLL,VPLL, greater<PLL> > 
#define PQI priority_queue<PII,VPII,greater<PII> >
#define UMLL unordered_map<ll,ll>
#define UMII unordered_map<int,int>
#define VI vector<int>
#define VL vector<ll>
#define S second
#define F first
#define PB push_back


int main()
{


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

        
    ll n,k;
    cin>>n>>k;
    ll a[n],i;
    for(i=0;i<n;i++)
        cin>>a[i];
    for(i=k;i<n;i++)
    {
        if(a[i-k]<a[i])
            cout << "Yes\n";
        else
            cout << "No\n";
    }


    return 0;
}

Measured memory_bytes: 5228