akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <climits>
#include <cmath>

using namespace std;

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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

int k;
string s;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> k >> s;
	int i = 0;
	for(; i < k && i < (int)s.length(); i++) cout << s[i];
	if(i < (int)s.length()) cout << "...";
	return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>
int main(void) {
	int s[100000], n, q, t, i, num = 0;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", s+i);
	}
	scanf("%d", &q);
	while (q--) {
		scanf("%d", &t);
		if (t < s[n/2]) {
			for (i = 0; i < n/2; i++) {
				if (t == s[i]) {
					num++;
					break;
				}
			}
		} else {
			for (i = n/2; i < n; i++) {
				if (t == s[i]) {
					num++;
					break;
				}
			}
		}
	}
	printf("%d\n", num);
	return 0;
}

Measured memory_bytes: 992
# coding: utf-8
n = int(input())
A = list(map(int,input().split()))
a_ = max(A)
A_ = list(set(A))
dp = [True] * (a_+1)
C = [0] * (a_+1)
for a in A:
    C[a]+=1
A_.sort()
ans = 0

for a in A_:
    tmp = a
    if dp[tmp]:
        tmp += a
        while tmp <= a_:
            dp[tmp] = False
            tmp += a
#print(dp)
for a in A_:
    if dp[a]:
        if C[a]==1:
            ans += 1
print(ans)

Measured memory_bytes: 34972
n = int(input())
s = input()
l = [[0] * n for _ in range(n)]
ans = 0

for i in range(n)[::-1]:
    for j in range(n)[::-1]:
        if i >= j and s[i] == s[j]:
            l[i][j] += 1
            
            if i < n-1 and j < n-1 and l[i+1][j+1] > 0:
                l[i][j] += l[i+1][j+1]
                
        now = min(l[i][j], i - j)
        ans = max(ans, now)

print(ans)

Measured memory_bytes: 233352
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define PB push_back
#define MP make_pair

typedef long long ll;
typedef long double dbl;

const dbl PI = 3.14159265358979323846264338327950288419716939937510;
const dbl EPS = 1E-9;

struct pt { dbl X, Y; };

inline int cmp(dbl a, dbl b) {
    return a + EPS < b ? -1 : b + EPS < a ? +1 : 0;
}

inline bool zero(dbl x) {
    return cmp(x, 0) == 0;
}

inline bool operator <(const pt& a, const pt& b) {
    return cmp(a.X, b.X)<0 || (cmp(a.X, b.X)==0 && cmp(a.Y, b.Y)<0);
}

inline bool operator ==(const pt& a, const pt& b) {
    return !(a < b) && !(b < a);
}

dbl len2(pt p) {
    return p.X * p.X + p.Y * p.Y;
}

dbl len(pt p) {
    return sqrt(len2(p));
}

void norm(dbl& a) {
    while (a < -PI) {
        a += 2*PI;
    }
    while (a >= PI) {
        a -= 2*PI;
    }
}

pt norm(pt p) {
    dbl lenp = len(p);
    return { p.X/lenp, p.Y/lenp };
}

pt rotate(pt p, dbl a) {
    return { cos(a)*p.X-sin(a)*p.Y, sin(a)*p.X+cos(a)*p.Y };
}

dbl dot(pt p, pt q) {
    return p.X*q.X + p.Y*q.Y;
}

dbl cross(pt p, pt q) {
    return p.X*q.Y - p.Y*q.X;
}

pt gv(pt p, pt q) {
    return { p.X-q.X, p.Y-q.Y };
}

int main() {
    double A, B, H, M;
    cin >> A >> B >> H >> M;
    pt h{0, A}, m{0, B};
    h = rotate(h, -2*PI*(H/12 + M/720));
    m = rotate(m, -2*PI*M/60);
    printf("%.20Lf\n", len(gv(h, m)));
    return 0;
}


Measured memory_bytes: 4164
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
const static int tx[] = {0,1,1,1,0,-1,-1,-1};
const static int ty[] = {-1,-1,0,1,1,1,0,-1};
 
static const double EPS = 1e-12;

int main(){
  string ref,target;
  while(cin >> ref >> target){
    
    set<string> visited;
    bool isok = false;
    for(int l=0;l<ref.size();l++){
      for(int r=l;r<ref.size();r++){
	const string str = ref.substr(l,r-l+1);
	if(str.size() != target.size()) continue;

	bool tmp_isok = true;
	for(int i=0;i<target.size();i++){
	  if(target[i] == '_') continue;
	  if(str[i] != target[i]){
	    tmp_isok = false;
	  }
	}

	if(tmp_isok){
	  isok = true;
	  goto found;
	}
      }
    }
  found:
    printf("%s\n",isok ? "Yes" : "No");
  }
}


Measured memory_bytes: 1172
#include<iostream>
#include<cmath>
#include<stdio.h>
#include<algorithm>
using namespace std;

int main(){
	long long a, b;
	long long x, y;

	while (cin >> a >> b){
		if (a > b){
			x = a;
			y = b;
		}
		else{
			x = b;
			y = a;
		}
		while (x % y != 0){
			x = x % y; 
			swap(x, y);
		}

		cout << y << " " << (a / y * b) << endl;
	}
}


Measured memory_bytes: 3028
#define _GLIBCXX_DEBUG
#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()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Matrix;
static const int INF = 2000000000;

int main(){
  int n; cin >> n; cout << n / 3 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
#define fs first
#define sc second

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

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

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;



int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int h, m, h2, m2, k;
    cin >> h >> m >> h2 >> m2 >> k;
    int tmp = (h2 * 60 + m2) - (h * 60 + m);
    print(tmp - k);

}



//queue<pint>().swap(q); キュー内を全て削除
//priority_queue<ll, vector<ll>, greater<ll> > que;
//auto dp=make_v<int>(4,h,w);
//vector<vector<ll>> g;
//g.assign(n, vector<ll>()); g.resize(n);でも大丈夫っぽい
//fill_v(dp,0);
//int n;
//cin >> n;
//vector<int> test(n);
//cins(all(test));
//array_output(all(test));
// Yes(true);

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

int main(void){
    ll n;
    cin>>n;
    vector<pair<ll, ll> > s(n);
    rep(i, n){
        ll a, b;
        cin>>a>>b;
        s[i]=make_pair(a+b, a-b);
    }
    sort(s.begin(), s.end());
    vector<pair<ll, ll> > v(n);
    rep(i, n) v[i]=make_pair(s[i].second, s[i].first);
    ll ans=1;
    ll now=v[0].second;
    for(ll i=1;i<n;i++){
        if(v[i].first>=now) {
            ans++;
            now=v[i].second;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3328
// https://atcoder.jp/contests/abc146/tasks/abc146_a

#include <bits/stdc++.h>
using namespace std;
#define watch(x) cerr << (#x) << " is " << (x) << endl;
#define endl '\n'
#define int long long
#define all(x) (x).begin(), (x).end()

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

    map<string, int> ans = {
        {"SUN", 7},
        {"MON", 6},
        {"TUE", 5},
        {"WED", 4},
        {"THU", 3},
        {"FRI", 2},
        {"SAT", 1},
    };

    string S;
    cin >> S;

    cout << ans[S] << endl;
}


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

class Program
{
    public static void Main( )
    {
        var input = Console.ReadLine( ).Split( ).Select( int.Parse ).ToArray( );
        int N = input[ 0 ];
        int M = input[ 1 ];
        var H = Console.ReadLine( ).Split( ).Select( int.Parse ).Prepend( 0 ).ToArray( );

        var connList = Enumerable.Range( 1, N + 1 ).Select( x => new List<int>( ) { 0 } ).ToList( );
        for ( int i = 1; i <= M; i++ )
        {
            var AB = Console.ReadLine( ).Split( ).Select( int.Parse ).ToArray( );
            connList[ AB[ 0 ] ].Add( H[ AB[ 1 ] ] );
            connList[ AB[ 1 ] ].Add( H[ AB[ 0 ] ] );
        }

        int ans = 0;
        for ( int i = 1; i <= N; i++ )
        {
            if ( H[ i ] > connList[ i ].Max( ) ) ans++;
        }
        Console.WriteLine( ans );
    }
}



Measured memory_bytes: 62808
#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;
typedef long long ll;
ll A, B, C;



int main(void) {
    // insert code here...
    cin >> A >> B >> C;
    if(A==B && B==C){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
   
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<bitset>
#include<cstring>
using namespace std;
int R,C,MAX;
bitset<10000> A[10];
void dfs(int cur)
{
    int sum1 = 0, sum2 = 0, sum = 0;
    if(cur == R){
        for(int i = 0; i < C; i++){
            for(int j = sum1 = sum2 = 0; j < R; j++){
                if(A[j][i] == 1) sum1++;
                else sum2++;
            }
            sum += max(sum1,sum2);
        }
        MAX = max(sum,MAX);
    }
    else{
        A[cur].flip();
        dfs(cur+1);
        A[cur].flip();
        dfs(cur+1);
    }
}
int main()
{
    int temp;
    while(scanf("%d%d",&R,&C) && R){
        for(int i = 0; i < R; i++)
            for(int j = 0; j < C; j++)
               scanf("%d",&temp),A[i][j] = temp;
        MAX = -1;
        dfs(0);
        printf("%d\n",MAX);
    }
    return 0;
}

Measured memory_bytes: 1040
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;


int main() {
  int64_t N; cin>>N;
  vector<int64_t> S(N+1,0),A(N);
  rep(i,N){
    cin>>A.at(i);
    S.at(A.at(i))++;
  }
  int64_t total=0;
  rep(i,N+1){
    total+=S.at(i)*(S.at(i)-1)/2;
  }
  rep(i,N) cout<<total-(S.at(A.at(i))-1)<<endl;
}


Measured memory_bytes: 6388
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		String s = sc.next();
		char moji = 'a';

		for (int i = 0; i < 26; i++) {
			if (s.contains(Character.toString(moji)) == false) {
				System.out.print(moji);
				System.exit(0);
			}
			moji++;
		}
		System.out.print("None");

	}
}

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

int main() {
    int N; cin >> N;
    string S;
    string march = "MARCH";
    vector<ll> m = {0, 0, 0, 0, 0};
    for (int i = 0; i < N; i++){
        cin >> S;
        for (int j = 0; j < 5; j++){
            if (S[0] == march[j]){
                m[j] = m[j] + 1;
                break;
            }
        }
    }
    ll cnt = 0;
    for (int i = 0; i < 5; i++){
        for (int j = i + 1; j < 5; j++){
            for (int k = j + 1; k < 5; k++){
                cnt += m[i] * m[j] * m[k];
            }
        }
    }
    cout << cnt << endl;
}



Measured memory_bytes: 256
#include <stdio.h>

int main(void) {

  int h,w;
	scanf("%d %d", &h, &w);
	char a[h][w+1];
	for (int i = 0; i < h; i++) {
		scanf("%s", a[i]);
	}
	int grid[h][w];
	int list[h*w][2];
	int copy[h*w][2];
	int cur = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] == '#') {
				grid[i][j] = 0;
				list[cur][0] = i;
				list[cur][1] = j;
				cur++;
			} else {
				grid[i][j] = -1;
			}
		}
	}
	int list_size = cur;
	int flag;
	int operation = 0;
	while (1) {
		flag = 0;
		cur = 0;
		for (int i = 0; i < list_size; i++) {
			if (list[i][0] != 0 && grid[list[i][0]-1][list[i][1]] == -1) {
				grid[list[i][0]-1][list[i][1]] = operation+1;
				copy[cur][0] = list[i][0]-1;
				copy[cur][1] = list[i][1];
				cur++;
				flag = 1;
			}
			if (list[i][0] != h-1 && grid[list[i][0]+1][list[i][1]] == -1) {
				grid[list[i][0]+1][list[i][1]] = operation+1;
				copy[cur][0] = list[i][0]+1;
				copy[cur][1] = list[i][1];
				cur++;
				flag = 1;
			}
			if (list[i][1] != 0 && grid[list[i][0]][list[i][1]-1] == -1) {
				grid[list[i][0]][list[i][1]-1] = operation+1;
				copy[cur][0] = list[i][0];
				copy[cur][1] = list[i][1]-1;
				cur++;
				flag = 1;
			}
			if (list[i][1] != w-1 && grid[list[i][0]][list[i][1]+1] == -1) {
				grid[list[i][0]][list[i][1]+1] = operation+1;
				copy[cur][0] = list[i][0];
				copy[cur][1] = list[i][1]+1;
				cur++;
				flag = 1;
			}
		}
		if (flag == 0) {
			printf("%d\n", operation);
			break;
		}
		list_size = cur;
		for (int i = 0; i < list_size; i++) {
			list[i][0] = copy[i][0];
			list[i][1] = copy[i][1];
		}
		operation++;
	}

  return 0;
}

Measured memory_bytes: 15232
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:108777216")
#define _FORTIFY_SOURCE 0
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <utility>
#include <algorithm>
#include <ctime>
#include <cstdarg>
#include <sstream>
#include <functional>
using namespace std;

int const MAX_N = 512 * 1024;
long long const LL_INF = 5000000000000000000LL;

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

	long long r, d, x;
	cin >> r >> d >> x;
	for (int i = 0; i < 10; i++) {
		x = r * x - d;
		cout << x << "\n";
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

/**
 * @author author
 *
 */
public class Main {

  /**
   * @param args
   */
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int judge = sc.nextInt();
    String color = sc.next();

    if (judge >= 3200) {
      System.out.println(color);
    } else {
      System.out.println("red");
    }
  }

}


Measured memory_bytes: 21588
MOD = 10**9 + 7

N, K = map(int, input().split())
A = tuple(map(int, input().split()))

ans = 0

for i, a in enumerate(A):
  before = 0
  after = 0
  for j, b in enumerate(A):
    if a > b:
      if i < j:
        after += 1
      else:
        before += 1
    
  ans += (after * K * (K + 1) // 2) % MOD
  ans += (before * K * (K - 1) // 2) % MOD
  ans %= MOD

print(ans)


Measured memory_bytes: 9232
import math as m

N=int(input())
As=list(map(int,input().split()))


D=[0]*(10**6+1)
for i in range(2,int(m.sqrt(10**6))+2):
    if D[i]!=0:
        continue
    j=2*i
    while j < 10**6+1:
        D[j]=i
        j+=i

P=[0]*10**6
pc=True
g=As[0]
for n in range(N):
    A=As[n]
    g=m.gcd(g,A)
    if A==1:
        continue
    ppre=1
    while True:
        p=D[A] if D[A]!=0 else A
        if ppre != p:
            if P[p] > 0:
                pc=False
            P[p]+=1
            ppre=p
        A=A//p
        if A==1:
            break

if pc:
    print('pairwise coprime')
elif g==1:
    print('setwise coprime')
else:
    print('not coprime')


Measured memory_bytes: 197124
#include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }

vector<int> find_pattern() {
	vector<int> ticks(3);
	for(auto &e : ticks) cin >> e;

	vector<int> res;
	res.reserve(360);
	for(int i = 0; i < 60; ++i) {
		for(auto &e : ticks) {
			e = (e + 1) % 60;
		}

		sort(ticks.begin(), ticks.end());
		do {
			const int t = ticks[0] % 5;
			if(t != ticks[1] / 12) continue;
			res.emplace_back(720 * ticks[0] + 60 * (ticks[1] % 12) + ticks[2]);
		} while(next_permutation(ticks.begin(), ticks.end()));
	}

	sort(res.begin(), res.end());
	res.erase(unique(res.begin(), res.end()), res.end());
	return res;
}

string format(int time) {
	const int h = time / 3600;
	time %= 3600;
	const int m = time / 60;
	const int s = time % 60;
	char buf[128];
	sprintf(buf, "%02d:%02d:%02d", h, m, s);
	return string(buf);
}

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

	for(int n; cin >> n && n;) {
		vector<vector<int>> pattern;
		pattern.reserve(n);
		for(int i = 0; i < n; ++i) {
			pattern.emplace_back(find_pattern());
		}

		pair<int, int> ans(INT_MAX, INT_MAX); //
		for(int i = 0; i < n; ++i) {
			for(const auto &s : pattern[i]) {
				int t = s;
				for(int j = 0; j < n; ++j) {
					if(i == j) continue;
					const auto it = lower_bound(pattern[j].begin(), pattern[j].end(), s);
					if(it == pattern[j].end()) goto ng;
					chmax(t, *it);
				}

				chmin(ans, make_pair(t - s, s));
			ng:;
			}
		}

		cout << format(ans.second) << " " << format(ans.first + ans.second) << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1280
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#include <conio.h>
using namespace std;

typedef long long int ll;
typedef pair<ll,ll> pll;

#define rep(i,n)	for(ll i=0;i<(n);i++)
#define SZ(x) ((ll)x.size())
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define F first
#define S second
#define int ll
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll MOD = INT_MAX;
const double PI = acos(-1);

void openfile(){
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
}
const int N = 1e5+5;
int dp[N];

signed main(){
	IOS
	int n,k;	cin >> n >> k;
	int a[n];
	rep(i,n)	cin >> a[i];
	fill(dp,dp+n,1e9+7);
	rep(i,n){
		if(i == 0)	dp[i] = 0;
		else{
			for(int j=1;j<=min(i,k);j++){
				dp[i] = min(abs(a[i] - a[i-j]) + dp[i-j],dp[i]);
			}
		}
	}
	cout << dp[n-1] << endl;
}


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            long[] a = new long[N];

            for (int i = 0; i < N; i++)
            {
                a[i] = long.Parse(s[i]);
            }

            long ans = 0;

            for (int i = 0; i < N-1; i++)
            {
                long diff = a[i] - a[i + 1];
                if ( diff > 0 )
                {
                    ans += diff;
                    a[i + 1] += diff;
                }
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 46584
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define INF 1e9;
using namespace std;
typedef long long ll;
int main() {
  ll N, H;
  cin >> N >> H;

  ll a[N], b[N];
  REP(i, N) cin >> a[i] >> b[i];

  sort(a, a + N);
  sort(b, b + N);

  ll ans = 0;

  REPR(i, N - 1) {
    if (b[i] < a[N - 1]) {
      break;
    }
    H -= b[i];
    ans++;

    if (H <= 0) {
      cout << ans;
      return 0;
    }
  }

  cout << ans + (H + a[N - 1] - 1) / a[N - 1];

  return 0;
}

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

ll dp[1001][1001];

int main()
{
	string s,t;
	cin >> s >> t;
	int n = s.size(),m = t.size();
	for(int i = 0;i<n+1;i++)
	{
		dp[i][0] = i;
	}
	for(int i = 0;i<m+1;i++)
	{
		dp[0][i] = i;
	}
	for(int i = 1;i<n+1;i++)
	{
		for(int j = 1;j<m+1;j++)
		{
			int cost = s[i-1]!=t[j-1];
			dp[i][j] = min({dp[i-1][j]+1,dp[i][j-1]+1,dp[i-1][j-1]+cost});
		}
	}
	cout<<dp[n][m]<<endl;
}


Measured memory_bytes: 11028
#include <cstdio>

using namespace std;

int main(void)
{
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i=0; i<n; i++) scanf("%d", &a[i]);
    for(int i=n-1; i>0; i--) printf("%d ", a[i]);
    printf("%d\n", a[0]);
    
    return 0;
}


Measured memory_bytes: 2620
<?php
  fscanf(STDIN,"%d", $N);
  $array = array("105", "135", "165", "189", "195");
  $ans =0;

  for($i = 0; $i < 5; $i++){
    if($N >= $array[$i]) $ans++;
    else break;
  }
  
  echo $ans;
 ?>

Measured memory_bytes: 4604
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
#include<cmath>
#include<complex>
using namespace std;

typedef complex<double> P;

#define X real()
#define Y imag()


int main(){
    int mod=1000000007;
    int ax, ay;
    char f[12][12];
    bool flag=0;
    for (int i=0;i<12;++i) {
        for (int j=0;j<12;++j) {
            f[i][j]=0;
        }
    }

    for (;;) {
        for (int i=0;i<8;++i) {
            if(scanf("%s",f[i])==EOF) {
                flag=1;
                break;
            }
        }
        if (flag) break;

        for(int i=0;i<64;++i) {
            if (f[i/8][i%8]=='1') {
                ax=i%8;
                ay=i/8;
                break;
            }
        }
        if (f[ay+1][ax]=='1' && f[ay][ax+1]=='1' && f[ay+1][ax+1]=='1') printf("A\n");
        else if (f[ay+1][ax]=='1' && f[ay+2][ax]=='1' && f[ay+3][ax]=='1') printf("B\n");
        else if (f[ay][ax+1]=='1' && f[ay][ax+2]=='1' && f[ay][ax+3]=='1') printf("C\n");
        else if (f[ay+2][ax-1]=='1' && f[ay+1][ax]=='1' && f[ay+1][ax-1]=='1') printf("D\n");
        else if (f[ay][ax+1]=='1' && f[ay+1][ax+1]=='1' && f[ay+1][ax+2]=='1') printf("E\n");
        else if (f[ay+1][ax]=='1' && f[ay+1][ax+1]=='1' && f[ay+2][ax+1]=='1') printf("F\n");
        else if (f[ay][ax+1]=='1' && f[ay+1][ax]=='1' && f[ay+1][ax-1]=='1') printf("G\n");
    }
    return 0;
}

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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define int ll

const ll MOD = 1000000007;
const ll INF_LL = (ll)1000000007 * 1000000007;
const int INF_INT = (int)1000000007;
const double PI = 3.14159265358979323846;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for (auto itr = (st).rbegin(); itr != (st).rend(); ++itr)

#define m0(x) memset((x), 0, sizeof((x)))
#define m1(x) memset((x), -1, sizeof((x)))

// xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define RALL(x) (x).rbegin(), (x).rend()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())     // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))  //最大値を求める
#define MIN(x) *min_element(ALL(x))  //最小値を求める
#define all(x) (x).begin(), (x).end()

//略記
#define pb emplace_back  // vectorヘの挿入
#define mp make_pair     // pairのコンストラクタ
#define F first          // pairの一つ目の要素
#define S second         // pairの二つ目の要素

#define BITCOUNT __builtin_popcount
#define BITCOUNT_LL(x) __builtin_popcountll(x)

#define perm(c)             \
  sort(all(c));             \
  for (bool c##p = 1; c##p; \
       c##p = next_permutation(all(c)))  //順列 123 132 213 231 312 321

#define BIT(n) (1LL << (n))

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ": " << (A) << std::endl;
#else
#define PRINT(A)
#endif

//入力高速化
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

signed main() {
  string S;
  cin >> S;
  int gcount = 0;
  int pcount = 0;
  rep(i, S.length()) {
    if (S[i] == 'g')
      gcount++;
    else
      pcount++;
  }
  cout << (gcount-pcount)/2 << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int a[100];
int L;

int check(int until){
  for(int i=0; i < until; i++){
    if(a[until] == a[i]){
      return i;
    }
  }
  return -1;
}

string i2s(int a){
  stringstream ss;
  ss << a;
  return ss.str();
}

int getMax(string str){
  vector<char> v;
  string res;
  for(int i=0; i < str.length(); i++){
    v.push_back(str[i]);
  }
  for(int i=0; i < str.length(); i++){
    vector<char>::iterator it = max_element(v.begin(), v.end());
    res.insert(res.end(), 1, *it);
    *it = '0'-2;
  }
  return atoi(res.c_str());
}
int getMin(string str){
  vector<char> v;
  string res;
  for(int i=0; i < str.length(); i++){
    v.push_back(str[i]);
  }
  for(int i=0; i < str.length(); i++){
    vector<char>::iterator it = min_element(v.begin(), v.end());
    res.insert(res.end(), 1, *it);
    *it = '9'+2;
  }
  return atoi(res.c_str());
}

int main(void){
  while(cin >> a[0] >> L, a[0] | L){
    for(int i=1;; i++){
      string str;
      str = i2s(a[i-1]);
      str.insert(0, L-str.length(), '0');
      a[i] = getMax(str) - getMin(str);
      int ans = check(i);
      if(ans != -1){
        cout << ans << " "<< a[i] << " "<< i - ans << endl;
        break;
      }
    }
  }

  return 0;
}

Measured memory_bytes: 1256
N, P = map(int, input().split())
S = input()

ans = 0
if P == 2 or P == 5 :
    for i in range(N) :
        if int(S[i])%P == 0 :
            ans += i+1
    print(ans)
    exit()

modP = [0 for _ in range(P)]
modP[0] = 1
now = 0
t = 1
for i in range(N) :
    now += int(S[-1-i]) * t
    now %= P
    modP[now] += 1
    t = t * 10 % P

for r in modP :
    ans += r*(r-1)//2

print(ans)


Measured memory_bytes: 41308
//#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<numeric>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<ctype.h>
#include <fstream>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
int dy[4]={0,1,0,-1};
//----------program from here----------

int main(){
  string s1,s2,s3;
  cin >> s1 >> s2 >> s3;
  cout << "A" << s2[0] << "C" << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>

int main(){
   int N;
   std::cin >> N;
   std::map<std::string, int> a;
   for (int i=0; i<N; i++){
      std::string key;
      int temp;
      std::cin >> temp;
      if ((1 <= temp) && (temp <=399))
         key = "grey";
      else if ((400 <= temp) && (temp <=799))
         key = "brown";
      else if ((800 <= temp) && (temp <=1199))
         key = "green";
      else if ((1200 <= temp) && (temp <=1599))
         key = "lite_blue";
      else if ((1600 <= temp) && (temp <=1999))
         key = "blue";
      else if ((2000 <= temp) && (temp <=2399))
         key = "yellow";
      else if ((2400 <= temp) && (temp <=2799))
         key = "orange";
      else if ((2800 <= temp) && (temp <=3199))
         key = "red";
      else
         key = "other";
      a[key]++;
   }
   int cnt = 0;
   for (auto x : a){
      cnt++;
   }
   int nother = a["other"];
   int min = (nother >= 1)? cnt-1 : cnt;
   if (min == 0)
      std::cout << 1 << " " << min+nother << std::endl;
   else
      std::cout << min << " " << min+nother << std::endl;
}



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

int main(void){
    int n,ans=0 ;
    cin >> n ;
    char s[n+2] ;
    cin >> s ;
    for (int i=0; i<n-2; i++){
        if (s[i]=='A' && s[i+1]=='B' && s[i+2]=='C'){
            ans++ ;
        }
    }
    cout << ans << endl ;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<57;
const double pi=acos(-1);
const double eps=1e-6;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,1,1,1,0},DY[8]={1,0,-1,-1,-1,0,1,1};

class Segment_Tree{
	private:
	int n;
	vi date;
	int Query_Rec(int a,int b,int k,int l,int r){
		if(r<=a||b<=l) return 0;
		if(a<=l&&r<=b) return date[k];
		int m=(l+r)/2;
		return Query_Rec(a,b,k*2+1,l,m)+Query_Rec(a,b,k*2+2,m,r);
	}
	public:
	Segment_Tree(int n_){
		n=1;
		while(n<n_) n*=2;
		date=vi(2*n-1);
	}
	void Update(int k,int x){
		k+=n-1;
		date[k]+=x;
		while(k>0){
			k=(k-1)/2;
			date[k]=date[2*k+1]+date[2*k+2];
		}
	}
	int Query(int a,int b){
		return Query_Rec(a,b,0,0,n);
	}
};

int n,m;
vp a;

int main(){
	cin>>n>>m;
	a=vp(n);
	for(int i=0;i<n;i++) cin>>a[i].first>>a[i].second;
	sort(a.begin(),a.end(),[](P p,P q){
		return p.second-p.first<q.second-q.first;
	});
	int I=0;
	Segment_Tree date(m+1);
	for(int i=1;i<=m;i++){
		while(I<n&&a[I].second-a[I].first+1<i){
			date.Update(a[I].first-1,1);
			date.Update(a[I].second,-1);
			I++;
		}
		int res=n-I;
		for(int j=1;j*i<=m;j++) res+=date.Query(0,j*i);
		cout<<res<<endl;
	}
}

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

int main() {
    int ans = 0;
    int n;
    cin >> n;
    vector<pair<int,int>> v[n];
    for (int i = 0; i < n; i++) {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int x,y;
            cin >> x >> y;
            x--;
            v[i].push_back({x,y});
        }
    }
    for (int i = 0; i < (1 << n); i++) {
        int bit = i;
        int cnt = 0;
        bool f = 1;
        for (int j = 0; j < n; j++) {
            if ((1 << j) & bit) {
                cnt++;
                for (int k = 0; k < v[j].size(); k++) {
                    if ((bit >> v[j][k].first) % 2 != v[j][k].second) {
                        f = 0;
                        break;
                    }
                }
            }
            if (!f) break;
        }
        if (f) ans = max(ans, cnt);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
const int maxn = 1e9 + 5;
#define INF 1000000000
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

ll h,sum,cnt;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio
	cin >> h;
	cnt = 1;
	while(h>=1){
		sum+=cnt;
		cnt*=2LL;
		h /= 2;
	}
	cout << sum << endl;
	return 0;
} 
//^-^

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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(int size) {
        prime.resize(size + 1, 1);
        prime[0] = 0;
        prime[1] = 0;
        FOR(i, 2, size) {
            if (prime[i]) {
                for (int j = 2 * i; j <= size; j += i) {
                    prime[j] = 0;
                }
            }
        }
    }

};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


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

int N;

int main() {
    cin >> N;
    vector<int> A(N), B(N);
    REP(i, N) {
        cin >> A[i];
        B[i] = A[i];
    }
    sort(A.begin(), A.end());
    map<ll, bool> m;
    REP(i, N) {
        if ((i + 1) % 2 == 1)m[A[i]] = 1;
        else m[A[i]] = 0;
    }
    int odd = 0, even = 0;
    REP(i, N) {
        if (m[B[i]] && (i + 1) % 2 == 0)even++;
        if (!m[B[i]] && (i + 1) % 2 == 1)odd++;
    }

    cout << even << endl;

    return 0;
}



Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
struct node
{
    int val;
    int num;
};
bool cmp(node a,node b)
{
    return a.val<b.val;
}
 node p[10000000];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
    cin>>p[i].val;
    p[i].num=i;
}
sort(p+1,p+n+1,cmp);
for(int i=1;i<=n;i++)
    cout<<p[i].num<<' ';
}


Measured memory_bytes: 1536
#include <stdio.h>

int main(void)
{
  unsigned int a, b, c;

  if (scanf("%d %d %d", &a, &b, &c) < 3) exit(1);

  if ((a == b) && (b == c))
  {
    printf("No");
  }
  else if ((a != b) && (b != c) && (a != c))
  {
    printf("No");
  }
  else
  {
    printf("Yes");
  }

  return (0);
}


Measured memory_bytes: 128
#include <iostream>

int main(void) {
    int d;
    std::cin >> d;

    if(d==22){
        std::cout << "Christmas Eve Eve Eve";
    }else if(d==23){
        std::cout << "Christmas Eve Eve";
    }else if(d==24){
        std::cout << "Christmas Eve";
    }else{
        std::cout << "Christmas";
    }

    std::cout << std::endl;
    return 0;
}


Measured memory_bytes: 256
// AOJ 0146: Lupin The 4th
// 2017.9.28 bal4u@uu
// 2017.11.21

#include <stdio.h>
#include <string.h>

#define INF 0x7fffffff
#define MAX 32768

int s[16], d[16], v[16];	// ????????±?????????????????¢???????????±?????°
int dp[16][MAX];			// DP????????¨?????????
int w[16][MAX];				// ????????±????????°
short prev[16][MAX][2];		// ???????????????????????????
int ord[16];				// ???????????????????????????????????????????????´???

int main()
{
	int n, i, j, k, t, ii, lim;
	int x, y;

	scanf("%d", &n);
	for (i = 0; i < n; i++) scanf("%d%d%d", s+i, d+i, v+i);

	memset(prev, -1, sizeof(prev));
	for (ii = 1, i = 0; i < n; i++, ii <<= 1) w[i][ii] = v[i];

	lim = 1 << n;
	for (k = 0; k < lim; k++) {
		for (ii = 1, i = 0; i < n; i++, ii <<= 1) {		// ??´????????????
			if (k & ii) continue;
			t = k | ii;
			for (j = 0; j < n; j++) {	// ??´?????????
				if (i == j || w[j][k] == 0) continue;
				int dd = d[i] - d[j];
				if (dd < 0) dd = -dd;
				x = dp[j][k] + dd*(7+2*w[j][k]);
				if (dp[i][t] == 0 || x < dp[i][t]) {
					dp[i][t] = x, w[i][t] = w[j][k] + v[i];
					prev[i][t][0] = j;
					prev[i][t][1] = k;
				}
			}
		}
	}

	// ???????§???????????????????
	for (x = INF, ii = 0, i = 0; i < n; i++) {
		y = dp[i][lim-1];
		if (y == 0) continue;
		if (y < x) x = y, ii = i;
	}

	// ?????£???????????????
	for (ord[0] = ii, i = ii, j = lim-1, k = 1; k < n; k++) {
		ord[k] = prev[i][j][0];
		     j = prev[i][j][1];
		     i = ord[k];
	}

	// ??????
	printf("%d", s[ord[n-1]]);
	for (i = 1; i < n; i++) printf(" %d", s[ord[n-i-1]]);
	putchar('\n');
	return 0;
}

Measured memory_bytes: 7264
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;


struct Point{
	double x,y;
};

void koch(int n,Point a,Point b){
	if(n==0)return;
	Point s,t,u;
	double th=M_PI*60.0/180.0;
	s.x=(2.0*a.x+1.0*b.x)/3.0;
	s.y=(2.0*a.y+1.0*b.y)/3.0;
	t.x=(1.0*a.x+2.0*b.x)/3.0;
	t.y=(1.0*a.y+2.0*b.y)/3.0;
	u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
	u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
	koch(n-1,a,s);
	printf("%.8f %.8f\n",s.x,s.y);
	koch(n-1,s,u);
	printf("%.8f %.8f\n",u.x,u.y);
	koch(n-1,u,t);
	printf("%.8f %.8f\n",t.x,t.y);
	koch(n-1,t,b);
}


int main(){
	Point a,b;
	int n;
	scanf("%d",&n);
	a.x=0;
	a.y=0;
	b.x=100;b.y=0;
	printf("%.8f %.8f\n",a.x,a.y);
	koch(n,a,b);
	printf("%.8f %.8f\n",b.x,b.y);
	return 0;
}


Measured memory_bytes: 3208
/*
   О НЕТ! ОНИ ДОГОНЯЮТ!!!
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
   🐹🐹🐹🐹🐹🐹🐹🐹🐹🐹
*/

#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <iomanip>

using namespace std;

typedef long long ll;

mt19937 rnd(228);

int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 0; i <= n; i++)
    {
        for (int j = 0; j <= m; j++)
        {
            if (i * (m - j) + j * (n - i) == k)
            {
                puts("Yes");
                return 0;
            }
        }
    }
    puts("No");
}


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

int main() {
    int x=0,n,ans=0;
    string s;
    cin>>n>>s;
    rep(i,n) {
        if (s[i]=='I') x++;
        else x--;
        ans=max(ans,x);     
    }
    cout<<ans<<endl;
}


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

int main(){
    int n;
    string s;
    cin>>n;
    int ans=1;
    for(int i=0;i<n;i++)cin>>s;
    for(int i=0;i<n-1;i++){
        if(s[i]==s[i+1])continue;
        else ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

class Timer {
    clock_t start;
    string name;
public:
    Timer() {name = "";start = clock();}
    Timer(string s){name = s;start = clock();}
    ~Timer() {fprintf(stderr, "%s: %.3gs\n", name.c_str(), 1.0*(clock() - start) / CLOCKS_PER_SEC);}
};

#define sq(a) ((a) * (a))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define what_is(x) cerr << fixed << setprecision(2) << boolalpha << #x << " = " << x << endl
#define setbitj(n, j) (n |= (1 << (j)))
#define isbitjOn(n, j) (((n & (1 << (j))) > 0) ? 1 : 0)
#define safeMod(a, m) ((((a)%(m))+(m))%(m))/*handling negative sign of remainder*/

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;

const double EPS = 1e-9;
const int INF = 0x7fffffff;
const double PI = acos(-1.0);
const int MAX = 600005;
const int MOD = 1000000007;
const int precision = 10;

inline bool isEq(double a, double b){return abs(a - b) < EPS;}
inline bool isEq(double a, double b, double eps){return abs(a - b) < eps;}
inline double toRad(double deg){return deg*PI/180;}
inline double toDeg(double rad){return rad*180/PI;}

//#define isValid(a, b) (a >= 0 && a < b)
//int dr[]  =  {0, -1, -1, -1,  0,  1, 1, 1};
//int dc[]  =  {1,  1,  0, -1, -1, -1, 0, 1};

struct info
{
    int p;
    bool isRight;
    int ind;
    info(int p, int i, bool r):p(p), ind(i), isRight(r){}
    info():info(0, 0, 0){}
    bool operator<(const info &i)const
    {
        return p < i.p || (p == i.p && isRight < i.isRight);
    }
};

vector<pii>segs;
vector<info>pranto;
map<int, int>orgDir;

int tree[4*MAX];
int lazy[4*MAX];
void build(int n, int l, int r)
{
    if(l == r){
        tree[n]++;
        lazy[n] = 0;
        return;
    }
    int mid = (l+r)>>1;
    build(n<<1, l, mid);
    build((n<<1)|1, mid+1, r);

}
int main(int argc, char* argv[])
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios_base::sync_with_stdio(false); cin.tie(NULL);
    //cout << fixed << setprecision(precision);
    int n, l;
cin >> n >>l;
cout << n-l+1 << endl;
return 0;
}


Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int n;
    R(n);
    set<int>H;
    FOR(i,1,1000000){
        if(H.count(n)){
            W(i);
            return 0;
        }
        H.insert(n);
        if(n%2==0)n/=2;
        else n=3*n+1;
    }
    return 0;
}


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

using namespace std;

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

    int ans = 1;
    for(int i=1; i<N; i++){
        if(S[i-1] != S[i]){
            ans++;
        }
    }

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

Measured memory_bytes: 512
#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;}

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

void no(){
    cout<<"No"<<endl;
}
void yes(){
    cout<<"Yes"<<endl;
}

int main(){fastio
    ll n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    a--;b--;c--;d--;
    string s;cin>>s;
    rep(i,a,c-1){
        bool f=true;
        rep(j,i,i+1){
            if(s[j]=='.')f=false;
        }
        if(f){
            cout<<"No"<<endl;return 0;
        }
    }
    rep(i,b,d-1){
        bool f=true;
        rep(j,i,i+1){
            if(s[j]=='.')f=false;
        }
        if(f){
            cout<<"No"<<endl;return 0;
        }
    }
    if(c>=d){
        rep(i,b-1,d-1){
            bool f=true;
            rep(j,i,i+2){
                if(s[j]=='#')f=false;
            }
            if(f){
                yes();return 0;
            }
        }
    }else{
        yes();return 0;
    }
    no();
    return 0;
}


Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

const int INF=1e8;
const int MAX_N=100,MAX_M=1000;

int N,M;
int A[MAX_M],B[MAX_M],C[MAX_M];

int G[MAX_N][MAX_N];

void warshall_floyd(){
	REP(k,N){
		REP(i,N){
			REP(j,N){
				G[i][j]=min(G[i][j],G[i][k]+G[k][j]);
			}
		}
	}
}

int main(){
	cin>>N>>M;
	REP(i,N){
		REP(j,N){
			if (i==j){
				G[i][j]=0;
			}else{
				G[i][j]=INF;
			}
		}
	}
	REP(i,M){
		cin>>A[i]>>B[i]>>C[i];
		A[i]--;
		B[i]--;
		G[A[i]][B[i]]=C[i];
		G[B[i]][A[i]]=C[i];
	}
	warshall_floyd();
	int ans=0;
	REP(i,M){
		int a=A[i],b=B[i],c=C[i];
		REP(j,N){
			REP(k,N){
				if (G[j][k]==G[j][a]+G[b][k]+c){
					ans++;
					j=k=N;
				}
			}
		}
	}
	ans=M-ans;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 384
function Main(input) {
	var str = input;
	var ans = 0;
	str = str.split("\n");
	var l = Number(str[0].split(" ")[0]); 	
 	var n = (l / 3).toFixed(6);
 	var ans = (n**3).toFixed(6);
 	console.log(ans);
}
 //*おまじない
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29488