akhauriyash/Code-Regression huggingface dataset:
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <bitset>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <chrono>
#include <random>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

template<typename T> T gcd(T a, T b) {
    if (a < b) return gcd(b, a);
    T r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

template<typename T> T lcm(const T a, const T b) {
    return a / gcd(a, b) * b;
}

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

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

// End of template.

int main() {
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    // cin.read(buf, sizeof buf); // 注意: ./a.out < in か pbp | ./a.out で入力すること

    int x, y, z;
    cin >> x >> y >> z;
    swap(x, y);
    swap(x, z);
    print3(x, y, z);

    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000


int main(){
	
	int N;
	cin>>N;
	
	vector<long long> A(N+1,0);
	
	map<long long,long long> mp;
	mp[0]++;
	for(int i=0;i<N;i++){
		cin>>A[i+1];
		A[i+1] += A[i];
		mp[A[i+1]]++;
	}
	
	long long ans = 0;
	
	for(auto a:mp){
		ans += a.second * (a.second-1);
	}
	
	cout<<ans/2<<endl;
	
	
	
	return 0;
}

Measured memory_bytes: 14336
/* Hamming Number */
import java.io.*;

public class Main{
	public static void main(String args[]){
		try{
			new Main();
		}catch(IOException e){
			e.printStackTrace();
		}
	}
	
	public Main() throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while((line = in.readLine()) != null){
			String[] tmp = line.split(" ");
			int m = Integer.parseInt(tmp[0]);
			if(m==0) break;
			int n = Integer.parseInt(tmp[1]);
			
			int c = 0;
			for(int i=m; i<=n; i++){
				if(is_hamming(i)){
					c++;
				}
			}
			System.out.println(c);
		}
	}
	
	public boolean is_hamming(int n){
		while(n%2==0){
			n = n/2;
		}
		
		while(n%3==0){
			n = n/3;
		}
		
		while(n%5==0){
			n = n/5;
		}
		
		if(n==0) return false;
		if(n==1) return true;
		
		return false;
	}
}

Measured memory_bytes: 9684
#include"bits/stdc++.h"
using namespace std;

void Main() {
  long long A, B, N;
  cin >> A >> B >> N;

  long long x = min(B - 1, N);
  cout << (A * x) / B - A * (x / B) << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}



Measured memory_bytes: 3532
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define F first
#define S second
#define mset(x,v) memset(x, v, sizeof(x))
#define left(x) 2*x
#define right(x) (2*x) + 1
#define ALL(t) (t).begin(),(t).end() 
#define ret return 0
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define rev(s) reverse(s.begin(),s.end())
#define WL(t) while(t --)
#define MOD 1000000007
int main()
{
      boost;
      int n;
      cin>>n;
      int mat[2][n];
      forn(i,2)
      {
            forn(j,n)
            {
                  cin>>mat[i][j];
            }
      }
      forn(i,2)
      {
            forn(j,n)
            {
                  int x=0,y=0;
                  if(i-1>=0)
                  x=mat[i-1][j];
                  if(j-1>=0)
                  y=mat[i][j-1];
                  
                  mat[i][j]=mat[i][j]+max(x,y);
            }
      }
      cout<<mat[1][n-1]<<endl;
}


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

int main()
{
    long long N,A,B,ans=0;
    cin>>N>>A>>B;
    long long div=N/(A+B);
    long long Mod=N%(A+B);
    ans+=(div*A);
    ans+=min(Mod,A);
    cout<<ans<<endl;
}


Measured memory_bytes: 3648
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_sum = sum(a)
aa = a[::-1]
bb = b[::-1]

for i in range(n):
    aa[i + 1] = max(0, aa[i + 1] - max(0, bb[i] - aa[i]))
    aa[i] = max(0, aa[i]-bb[i])

print(a_sum-sum(aa))

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

struct UnionFindTree {
    vector<int> par, rnk;
    int operator [](int x) { return find(x); }
    void build(int n) { par.assign(n, -1); rnk.assign(n, 0); }
    int find(int x) { return par[x] < 0 ? x : (par[x] = find(par[x])); }
    bool same(int x, int y) { return find(x) == find(y); }
    int size(int x) { return -par[find(x)]; }
    bool unite(int x, int y) {
        if ((x = find(x)) == (y = find(y))) return 0;
        rnk[x] = max(rnk[x], rnk[y] + 1); par[x] += par[y]; par[y] = x; return 1;
    }
    bool uniteByRank(int x, int y) { return rnk[find(x)] < rnk[find(y)] ? unite(y, x) : unite(x, y); }
};

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(M), B(M);
    for (int i = 0; i < M; ++i) cin >> A[i] >> B[i], A[i]--, B[i]--;

    UnionFindTree uf;
    uf.build(N);

    vector<ll> ans(M, (ll)N * (N - 1) / 2);
    for (int i = M - 1; i > 0; --i) {
        ans[i - 1] = ans[i];
        if (!uf.same(A[i], B[i])) {
            int s = uf.size(A[i]), t = uf.size(B[i]);
            ans[i - 1] -= (ll)s * t;
            uf.uniteByRank(A[i], B[i]);
        }
    }

    for (ll x : ans) cout << x << endl;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793


  
int main(){
   int n;
   cin >> n;
   VI a(n);
   rep(i,n)cin >> a.at(i);
   int ans=0;
   rep(i,n){
      if(a.at(a.at(i)-1)==i+1)ans++;
   }
   cout << ans/2 << endl;
}

Measured memory_bytes: 3760
#!/usr/bin/env python3
import sys

# https://en.wikipedia.org/wiki/Cycle_detection
def floyd_cycle_finding(f, x0):
    '''
    循環していない部分の長さをlam
    循環部分の長さをmuとして
    (lam, mu)
    を返す
    >>> floyd_cycle_finding(lambda x: x**2 % 3, 2)
    (1, 1)
    >>> floyd_cycle_finding(lambda x: x**2 % 1001, 2)
    (2, 4)
    >>> floyd_cycle_finding(lambda x: x**2 % 16, 2)
    (2, 1)
    >>> floyd_cycle_finding(lambda x: x*2 % 5, 3)
    (0, 4)
    >>> floyd_cycle_finding(lambda x: x*2 % 5, 0)
    (0, 1)
    '''
    tortoise = f(x0)
    hare = f(f(x0))
    while tortoise != hare:
        tortoise = f(tortoise)
        hare = f(f(hare))
    lam = 0
    tortoise = x0
    while tortoise != hare:
        tortoise = f(tortoise)
        hare = f(hare)
        lam += 1
    mu = 1
    hare = f(tortoise)
    while tortoise != hare:
        hare = f(hare)
        mu += 1
    return lam, mu

def solve(N: int, X: int, M: int):
    f = lambda x: x**2 % M

    def g(x):
        while True:
            yield x
            x = f(x)
            
    lam, mu = floyd_cycle_finding(f, X)
    ans = 0
    gg = g(X)
    k = max((N - lam) // mu, 0)
    for i in range(min(N, lam)):
        ans += next(gg)
    for i in range(mu):
        ans += k * next(gg)
    for i in range(max((N-lam)%mu, 0)):
        ans += next(gg)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    print(solve(N, X, M))


def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 9308
#include "bits/stdc++.h"
using namespace std;

int main() {
	int N, t, x, y, bt = 0, bx = 0, by = 0;
	bool check = true;
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> t >> x >> y;
		int dis = abs(x - bx) + abs(y - by);
		if (dis > t - bt || dis % 2 != (t - bt) % 2) check = false;
		bt = t, bx = x, by = y;
	}
	if (check) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        CF_Reader in = new CF_Reader();

        int n = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();
        int[] counts = new int[n];

        for (int i = 1; i < n + 1; i++) {
            for (int j = i + 1; j < n + 1; j++) {
                int diff = j - i;
                int possibleShortCut = Math.abs(i - x) + 1 + Math.abs(y - j);
                counts[Math.min(diff, possibleShortCut)]++;
            }
        }
        for (int i = 1; i < n; i++) out.println(counts[i]);

        out.close();
    }


    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

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

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

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

        char nextCharacter() throws IOException {
            return next().charAt(0);
        }

        String nextLine() throws IOException {
            return br.readLine().trim();
        }
    }
}


Measured memory_bytes: 22740
#pragma warning(disable:4996)

#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <cmath>
#include <map>
#include <array>
#include <set>
#include <queue>
#include <complex>
#include <iterator>
#include <random>
#include <time.h>
#include <tuple>
#include <functional>
#include <list>
#include <limits.h>
#define mp make_pair
#define ni(x) scanf("%d", &(x))
#define nii(x,y) scanf("%d%d",&(x),&(y))
#define mul(x,y) ((ll)(x)*(y)%mod)
#define mtp make_tuple
#define F(i,n) for(int i = 0; i < (n); i++)
#define FF(i,n) for(int i = 1; i <= (n); i++)
#define FE(i,n) for(int i = 0; i <= (n); i++)

#ifndef __GNUG__
int __builtin_popcount(int n) {
	int x = 0;
	while (n)n -= n&(-n), x++;
	return x;
}
#endif

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int mod = 1000000007;
const int inf = 2012345678;
const ll infl = 9012345678901234567;
const double pi = 3.1415926535897932384626433832795;
//----------------------------------------------------------------------------//

int main() {
#ifndef __GNUG__
	freopen("input.txt", "r", stdin);
#endif
	int n; ni(n);
	printf("%d\n", 180 * (n - 2));
	return 0;
}


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

int main() {
    int n;cin >>n;
    map<int,int>odd;
    map<int,int>even;
    for (int i = 0; i < n; ++i) {
        int v;cin >>v;
        if(i%2==0)even[v]++;
        else odd[v]++;
    }
    vector<pair<int,int>>op;
    vector<pair<int,int>>ep;
    for(auto p:odd){
        op.push_back({p.second,p.first});
        op.push_back({0,0});
    }
    for(auto p:even){
        ep.push_back({p.second,p.first});
        ep.push_back({0,0});
    }
    sort(all(op));
    reverse(all(op));
    sort(all(ep));
    reverse(all(ep));
    int ans=0;
    if(op[0].second==ep[0].second){
        ans=min(n-ep[1].first-op[0].first,n-ep[0].first-op[1].first);
    }
    else {
        ans=n-ep[0].first-op[0].first;
    }
    cout <<ans <<endl;
    return 0;
}



Measured memory_bytes: 7284
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;

const int maxn = 0;
int n;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(NULL);
	string z;
	cin >> z;
	map < string , bool > mp;
	mp["maerd"] = 1;
	mp["remaerd"] = 1;
	mp["esare"] = 1;
	mp["resare"] = 1;
	reverse(z.begin() , z.end());
	string s = "" , ans = "";
	for(int i=0;i<z.size();i++)
	{
		s += z[i];
		if(mp[s])
		{
			ans += s;
			s = "";
		}
		if(s.size() > 10) break;
	}
	if(z == ans) cout << "YES";
	else cout << "NO";
}

Measured memory_bytes: 592
#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int N;
	cin >> N;
	int A[N];
	for (int i = 0; i < N; i++)
		cin >> A[i];

	for (int i = 0; i < N; i++) {
		int v = A[i];
		int j = i - 1;
		while (j >= 0 && A[j] > v) {
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;

		for (int j = 0; j < N - 1; j++) {
			cout << A[j] << " ";
		}
		cout << A[N - 1] << endl;
	}

	return 0;
}

Measured memory_bytes: 3032
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  char a[4];
  for(int i=0;i<4;i++){
    cin>>a[i];
  }
  sort(a,a+4);
  if(a[0]==a[1]&&a[1]!=a[2]&&a[2]==a[3])cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

int main(){
  int count=0;
  string a,b;
  cin>>a;
  cin>>b;
  
  if(a.size()!=(b.size()-1)){
    cout<< "No"<<endl;
    return 0;
  }
  
  for(int i=0;i<a.size();++i){
    if(a[i]!=b[i]){
      count++;
    }
  }
  
  if(count>=1){
    cout<<"No"<<endl;
  }else{
    cout<<"Yes"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include<bits/stdc++.h>
#include <string>
#define loop(i,n) for(int i=0;i<(int)n;i++)

using namespace std;


int main()
{

string s;
cin>>s;

string ans;

for(int i=0;i<s.size();i++){

    if(s[i]=='B'){
        if(ans.size()==0)
            continue;

        else
            ans.erase(ans.size()-1);
    }
    else{

        ans=ans+s[i];
    }

}

cout<<ans;

}




Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,-1,0,1,1,-1,1,-1,0};
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;
}
int main(){
    ll n;cin >> n;
    while(n--){
        ll a,b,c,d;cin >>a >> b>> c >> d;
        if(a<b||b>d){cout << "No" <<endl;continue;}
        if(b<=c) {cout << "Yes" <<endl;continue;}
        ll g=__gcd(b,d);
        if(c<b-g+(a%g))cout << "No" <<endl;
        else cout << "Yes" <<endl;
    }
}   

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define PI 3.14159265358979323846264338327950L
 
int main(){
  int a,b;
  cin >> a >> b;
  int ans;

  ans = a * b;
  cout << ans;
 


  

  }


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include<stdlib.h>
#include<string.h>
#define ll long long
#define ull unsigned long long int
#define T int test; scanf("%d",&test); while(test--)
#define pb push_back
#define in insert
#define PI acos(-1)
#define sc(n) scanf("%d",&n)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define lsc(n) scanf("%lld",&n)
#define lsc2(a,b) scanf("%lld%lld",&a,&b)
#define rep(i,n) for(i=0;i<n;i++)
#define fr(i,a,b) for(i=a;i<b;i++)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/__gcd(a,b)
using namespace std;



int main()
{
	map<int,int>mp;
	int n,i,m;
	sc(n);
	rep(i,n-1)
	{
		sc(m);
		mp[m]++;
	}
	rep(i,n)
	{
		cout << mp[i+1] << endl;
	}
    return 0;
}


Measured memory_bytes: 13072
S=input()
T=input()
a=[None]*26
b=[None]*26
k=1
for i in range(26):
    for j in range(len(S)):
        if S[j]==chr(97+i):
            if a[i]==None:
                a[i]=T[j]
            else:
                if T[j]!=a[i]:
                    k=0
                    break
for i in range(26):
    for j in range(len(S)):
        if T[j]==chr(97+i):
            if b[i]==None:
                b[i]=S[j]
            else:
                if S[j]!=b[i]:
                    k=0
                    break
if k==1:print("Yes")
else:print("No") 

Measured memory_bytes: 42556
#include<bits/stdc++.h>
#define ll long long int
#define vec vector<ll>
#define mat vector<vec>

using namespace std;

const ll mod=1000000007;
const ll inf=LONG_LONG_MAX;
ll dx4[4]={1,0,-1,0};
ll dy4[4]={0,-1,0,1};
ll dx8[8]={1,0,-1,1,-1,1,0,-1};
ll dy8[8]={1,1,1,0,0,-1,-1,-1};

int main(){

  vec a(3);
  ll k;
  cin >> a[0] >> a[1] >> a[2] >> k;
  sort(a.begin(),a.end());

  cout << ((ll)pow(2,k))*a[2]+a[1]+a[0] << endl;



}

Measured memory_bytes: 3956
//////// Don't_be_late 
// https://atcoder.jp/contests/abc177/tasks/abc177_a
// date: 2020-08-29T21:00:28.777315
// memo: 

//<editor-fold desc="my macro">

#include<bits/stdc++.h>
#ifdef LOCAL
    #include<my/dump.h>
#else
    #define dump(...) 42 
    #define dumpi(x) 42 
#endif

typedef long long ll;
using namespace std;

#define repe(x, a) for(auto& (x) : (a))
#define _overload3(_1, _2, _3, name, ...) name
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2,)(__VA_ARGS__)
#define _rep3(i, a, b) for(ll i=a, i##_len=(b);i<i##_len;i++)
#define _rep2(i, n) _rep3(i,0,n)
#define repd(...) _overload3(__VA_ARGS__,_repd3,_repd2,)(__VA_ARGS__)
#define _repd3(i, a, b) for(ll i=b-1, i##_len=(a);i>=i##_len;i--)
#define _repd2(i, n) _repd3(i,0,n)
#define loop(...) _overload3(__VA_ARGS__,,_loop2,_loop1)(__VA_ARGS__)
#define _loop2(i, a) for(ll i=a;; i++)
#define _loop1(i) _loop2(i,0)

#define all(x) x.begin(),x.end()
#define SIZE(x) ((ll)(x).size())

#define F first
#define S second
#define vec vector
#define umap unordered_map
#define uset unordered_set

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

#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define inrange(x,start,stop) ((start) <= (x) && (x) < (stop))
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; }

template <typename Cont, typename Func>
Cont fmap(const Cont &container, Func functor) {
    Cont result(container.size());
    std::transform(container.begin(), container.end(), result.begin(), functor);// [](int x){return x * 2;}
    return result;
}
template <typename Cont, typename Pred>
Cont filter(const Cont &container, Pred predicate) {
    Cont result;
    std::copy_if(container.begin(), container.end(), std::back_inserter(result), predicate);// [](int x){return x == 2;}
    return result;
}   

template<typename T, typename ...Args>
void ci(T& first, Args&... args) {
    ((cin >> first), ..., (cin >> args)); //C++17
}

template<char Sep, typename T, typename ...Args>
void print_seq(const T& first, const Args&... args) {
    ((cout << first), ..., (cout << Sep << args)); //C++17
}

void co(){ cout << endl; }
template<typename... Words>
void co(Words... words) {
    print_seq<' '>(words...);
    cout << endl;
}
#define coi(x) cout<<(x)<<" "

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define sankou(n,a,b) cout << ((n) ? (a) : (b) ) << endl

#define asrt(expr...) assert((expr))
//</editor-fold>

#define INF 1e19
#define MOD 1e9+7
#define MAXR 1e5

int solve() {
    ll D,T,S;
    ci(D,T,S);
//    co(D <= T * S );
    Yes(D <= T * S );
    return 0;

}

int main(){
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    
    solve();
    return 0;
}


Measured memory_bytes: 3620
#include<stdio.h>
#include<math.h>
#include<algorithm>
//#define M(a,b) a<b?a:b
int main(){
	int a,b,c,n,r;
	for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
		for(scanf("%d",&n);n--;){
			scanf("%d",&r);
			puts(
				(2*r>std::min(std::min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
				"OK":"NA"
			);
		}
	}
}

Measured memory_bytes: 0
fun main(args: Array<String>) {
    val s = readLine()!!
    for (i in (1 until s.length)) {
        if (s[i] == s[i - 1]) {
            println("$i ${i + 1}")
            return
        }

        if (i == 1) {
            continue
        }

        if (s[i] == s[i - 2]) {
            println("${i - 1} ${i + 1}")
            return
        }
    }
    println("-1 -1")
}

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

typedef long long ll;

#define REP(i, n) for (int i = 0; i < int(n); i++)
#define REPD(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < int(b); i++)
#define FORD(i, a, b) for (int i = b - 1; i >= int(a); i--)
#define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w)

#define ALL(x) (x).begin(), (x).end()

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

ll powmod(ll n, ll x)
{
    vector<ll> vll(32);
    vll[0] = n;
    FOR(i, 1, 32)
    {
        vll[i] = (vll[i - 1] * vll[i - 1]) % MOD;
    }
    ll ret = 1;
    int cnt = 0;
    while (x > 0) {
        if (x & 1) {
            ret = (ret * vll[cnt]) % MOD;
        }
        x >>= 1;
        cnt++;
    }
    return ret;
}

int main()
{
    ll n, k;
    cin >> n >> k;
    /*
    vector<ll> prime(k + 1, 0);
    FOR(i, 2, k + 1)
    {
        for (int j = i; j < k + 1; j += i) {
            if (prime[j] == 0) {
                prime[j] =i;
            }
        }
    }*/
    ll ans = 0;
    vector<ll> numgcd(k + 1);
    for (int i = k; i >= 1; i--) {
        numgcd[i] = powmod(k / i, n);
        for (int j = i * 2; j <= k; j += i) {
            numgcd[i] -= numgcd[j];
            numgcd[i] = (numgcd[i] + MOD) % MOD;
        }
        ll add = (numgcd[i] * i) % MOD;
        ans = (ans + add) % MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4036
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>

#define ll long long
#define ull unsigned long long
#define ui unsigned int

using namespace std;

int N;
ll M;
ll a[100005];
ll lcm = 1;

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

int main()
{
	scanf("%d %lld", &N, &M);
	
	bool ans = true;

	for (int i = 0; i < N; ++i)
	{
		scanf("%lld", &a[i]);
		a[i] >>= 1;

		lcm = lcm * a[i] / get_gcd(lcm, a[i]);
		if (lcm > 1e9) ans = false;
	}

	if (ans)
	{
		for (int i = 0; i < N; ++i)
		{
			if (((lcm / a[i]) & 1LL) == 0)
			{
				ans = false;
				break;
			}
		}
	}

	if (ans) printf("%lld\n", (M / lcm + 1) / 2);
	else printf("0\n");

	return 0;
}

Measured memory_bytes: 896
N,X,Y=map(int,input().split())
X-=1
Y-=1

length=[0]*(N-1)
for i in range(N-1):
    for j in range (i+1,N):
        l=min(j-i,abs(X-i)+abs(Y-j)+1)
        length[l-1]+=1
for i in range(N-1):
    print(length[i])

Measured memory_bytes: 3444
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using ll = long long;
using p = pair<ll, ll>;

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

    vector<ll> n(3);
    cin >> n[0] >> n[1] >> n[2];

    ll ans = 0;
    while (true) {
        sort(n.begin(), n.end());
        if (n[0] == n[1] && n[1] == n[2]) {
            break;
        } 
        
        ans++;
        if (n[0] + 2 <= n[2]) {
            n[0] += 2;
        } else if (n[0] == n[1]) {
            n[0]++; n[1]++;
        } else if (n[1] == n[2]) {
            n[1]++; n[2]++;
        }
    }
    
    cout << ans << endl;
    return 0;
}



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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> cnt(N, 0);
  for (int i = 0; i < Q; i++) {
    int a;
    cin >> a;
    cnt[a - 1]++;
  }
  for (int c : cnt) {
    cout << (c + K - Q > 0 ? "Yes" : "No") << '\n';
  }
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define MAXN 500005
#define LIMIT 1500
#define LOGN 20
#define ll long long
#define pb push_back
#define ld long double
using namespace std;
int d,w;
int pond[15][15],pref[15][15];
int gar[15][15];
bool checkHori(int pos, int l, int r){
	if(l<0||r>w-1||pos<0||pos>d-1)return 0;
	for(int i=l;i<=r;i++)if(pond[pos][i]==1)return 0;
	return 1;
}
bool checkVerti(int pos, int l, int r){
	if(l<0||r>d-1||pos<0||pos>w-1)return 0;
	for(int i=l;i<=r;i++)if(pond[i][pos]==1)return 0;
	return 1;
}
int main(){
	ios::sync_with_stdio(0);
	while(cin>>d){
		if(d==0)return 0;
		cin>>w;
		rep(i,d){
			rep(j,w){
				cin>>gar[i][j];
				pond[i][j]=0;
			}
		}
		int best=0;
		rep(q,10){
			//cout<<q<<endl;
			rep(i,d){
				rep(j,w){
					if(gar[i][j]==q)pond[i][j]=1;
				}
			}
			rep(i,d){
				rep(j,w){
					pref[i][j]=pond[i][j];
					if(i!=0)pref[i][j]+=pref[i-1][j];
					if(j!=0)pref[i][j]+=pref[i][j-1];
					if(i!=0&&j!=0)pref[i][j]-=pref[i-1][j-1];
				}
			}
			//cout<<d<<' '<<w<<endl; 
			for(int r1=0;r1<d;r1++){
				for(int r2=r1;r2<d;r2++){
					for(int c1=0;c1<w;c1++){
						for(int c2=c1;c2<w;c2++){
							int area=pref[r2][c2];
							//cout<<r1<<' '<<r2<<' '<<c1<<' '<<c2<<endl;
							if(r1!=0)area-=pref[r1-1][c2];
							if(c1!=0)area-=pref[r2][c1-1];
							if(r1!=0&&c1!=0)area+=pref[r1-1][c1-1];
							if(area==(r2-r1+1)*(c2-c1+1)){
								//cout<<r1<<' '<<c1<<' '<<r2<<' '<<c2<<endl;
								if(checkHori(r1-1,c1-1,c2+1)&&checkHori(r2+1,c1-1,c2+1)&&
								checkVerti(c1-1,r1-1,r2+1)&&checkVerti(c2+1,r1-1,r2+1)){
									int cur=0;
									for(int i=r1;i<=r2;i++){
										for(int j=c1;j<=c2;j++){
											cur+=q+1-gar[i][j];
										}
									}
									best=max(best,cur);
								}
							}
						}
					}
				}
			}
		}
		cout<<best<<endl;
	}
	return 0;
}


Measured memory_bytes: 3144
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::io::{Write, BufWriter};

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}


fn gcd(a: i64, b: i64)  -> i64 {
    if a < b {
        return gcd(b, a);
    }
    if b == 0 {
        return a;
    }
    return gcd(b, a % b);
}

fn lcm(a: i64, b: i64) -> i64 {
    return a * b / gcd(a, b);
}

fn non_divide(a: i64, c: i64, d: i64) -> i64 {
    if a == 0 {
        return 0;
    }

    let ret = a - a / c - a / d + a / lcm(c, d);
    return ret;
}

fn main() {
    input! {
        a: i64,
        b: i64,
        c: i64,
        d: i64,
    }

    println!("{}", non_divide(b, c, d) -  non_divide(a-1, c, d));
}

Measured memory_bytes: 4352
#include <iomanip>
#include <iostream>
#include <algorithm>
using namespace std;
int n, m; double e[111][111], dp[111][111];
int main() {
	while (cin >> n >> m, n | m) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) cin >> e[i][j];
		}
		for (int i = 0; i < n; i++) dp[0][i] = 1.0;
		for (int i = 1; i < m; i++) {
			for (int j = 0; j < n; j++) {
				dp[i][j] = 0.0;
				for (int k = 0; k < n; k++) {
					dp[i][j] = max(dp[i][j], dp[i - 1][k] * e[k][j]);
				}
			}
		}
		cout << fixed << setprecision(2) << *max_element(dp[m - 1], dp[m - 1] + n) << endl;
	}
	return 0;
}

Measured memory_bytes: 3376
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,m;
  cin>>n>>m;
  ll l=0,r=n+m;
  while(l+1<r){
    ll mid=(l+r)/2;
    if(mid<=n){
      if(mid*2<=m) l=mid;
      else r=mid;
      continue;
    }
    ll t=mid-n;
    if((mid+t)*2<=m) l=mid;
    else r=mid;
  }
  cout<<l<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
bool comp(int &a,int &b){
  return a>b;
}
int main(){
  int n,k;
  cin>>n>>k;
  int l[51];
  rep(i,n) cin>>l[i];
  sort(l,l+n,comp);
  int res=0;
  rep(i,k){
    res+=l[i];
  }
  prin(res);
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{

    int a;
    int b;
    int c;
    int d;
    int k;

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

    printf("%d", c * 60 + d - k - a * 60 - b);


    printf("\n");
}

Measured memory_bytes: 2148
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;
//#define int long long
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long double ld;
typedef long long ll;
#define X first
#define Y second
#define all(o) o.begin(), o.end()
#define endl '\n'
#define IOS ios::sync_with_stdio(0), cin.tie(0)

int gcd(int x,int y){ return (!y ? x : gcd(y, x%y)); }
const int maxn = 1e6 + 10;
const int mod = 1e9 + 7;
const int base[] = {4001, 737};
inline int mu(int x,int y){
	return 1LL * x * y % mod;
}
inline int ad(int x,int y){
	return (x + y) % mod;
}
int h[2][maxn], pw[2][maxn];
int gh(int l,int r, int k){
	return ad(h[k][r], mod - mu(h[k][l], pw[k][r - l]));
}
pii gh2(int l,int r){
	return {gh(l, r, 0), gh(l, r, 1)};
}
int32_t main(){
	//IOS;
	int n; string s;
	cin >> n >> s;
	for(int i=0; i<2; i++){
		pw[i][0] = 1;
		for(int j=1; j<maxn; j++)
			pw[i][j] = mu(pw[i][j - 1], base[i]);
		for(int j=1; j<=n; j++)
			h[i][j] = ad(mu(h[i][j - 1], base[i]), s[j - 1] + 33);
	}
	int lo = 0, hi = n;
	while(hi - lo > 1){
		int mid = hi + lo >> 1;
		map<pii,bool> mp;
		bool can = 0;
		for(int r=n; r-mid>=0; r--){
			mp[gh2(r - mid, r)] = 1;
			if(r >= 2* mid){
				auto val = gh2(r - 2 * mid, r - mid);
				if(mp[val])
					can = 1;
			}
		}
		if(can)
			lo = mid;
		else
			hi = mid;
	}
	cout << lo << endl;
}


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

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;


signed main(){
    int a, b, h, w;
    cin >> a >> b >> h >> w;
    cout << a * b - (a * w) - (b * h) + (w * h) << endl;
}


Measured memory_bytes: 256
using System;

namespace ABC087
{
    class B
    {
        static void Main(string[] args)
        {
            int A = int.Parse(Console.ReadLine());
            int B = int.Parse(Console.ReadLine());
            int C = int.Parse(Console.ReadLine());
            int X = int.Parse(Console.ReadLine());

            int Total = 0;
            int count = 0;
            for (int i = 0; i <= A; i++)
            {
                for (int j = 0; j <= B; j++)
                {
                    for (int k = 0; k <= C; k++)
                    {
                        Total = 500 * i + 100 * j + 50 * k;
                        if (Total == X) { count++; break; }
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include<stdio.h>

int main(void){

	int A[100][100] = { 0 };
	int b[100] = { 0 };
	int c[100] = { 0 };
	int n, m, i, j;

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

	for (i = 0; i < n; i++){
		for (j = 0; j < m; j++){
			scanf("%d", &A[i][j]);
		}
	}
	for (j = 0; j < m; j++){
		scanf("%d", &b[j]);
	}

	for (i = 0; i < n; i++){
		for (j = 0; j < m; j++){
			c[i] += A[i][j] * b[j];
		}
		printf("%d\n", c[i]);
	}

	return 0;
}

Measured memory_bytes: 648
#include<iostream>
#include<vector>
#include<map>
using namespace std;
int main(){
	int N,W,w,v,maxV=0;
	long wei[100001]={0};
	cin>>N>>W;
	for(int i=0;i<N;i++){
		cin>>w>>v;
		for(int j=maxV;j>=0;j--){
			if(wei[j]!=0 || j==0){
				if(wei[j]+w<=W){
					if(wei[j+v]==0)wei[j+v]=wei[j]+w;
					else wei[j+v]=min(wei[j+v],wei[j]+w);
					maxV=max(maxV,j+v);
				}
			}
		}
	}
	cout<<maxV;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int p[n];
    for (int i = 0; i < n; i++)
    {
        cin >> p[i];
    }

    int cnt = 0;    
    for (int i = 1; i < n-1; i++)
    {
        if(p[i-1] > p[i] && p[i] > p[i+1]) cnt ++;
        else if(p[i-1] < p[i] && p[i] < p[i+1]) cnt ++;        
    }
    cout << cnt << endl;   
}

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

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

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

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

int N;
vector<int> V, C;

signed main()
{
    cin >> N;
    V.resize(N);
    C.resize(N);
    REP(i, N) { cin >> V[i]; }
    REP(i, N) { cin >> C[i]; }

    int ans = 0;
    REP(i, N) {
        int tmp = V[i] - C[i];
        if(tmp > 0) { ans += tmp; }
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
// using System.Linq;

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            // float[] ABCD = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // int[] ST = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            long K = long.Parse(Console.ReadLine());
            // int[] AB = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int A = int.Parse(Console.ReadLine());
            // int b = int.Parse(Console.ReadLine());
            // string A = Console.ReadLine();
            // string B = Console.ReadLine();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(int.Parse);
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // var X = Console.ReadLine();
            long sum = 100;
            long nen = 0;
            while(sum<K){
                sum+= sum/100;
                nen ++;
            }
            Console.WriteLine(nen);
            
        }
    }
}

Measured memory_bytes: 17660
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 100100100;
const double EPS = 1e-9;

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

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    int ans = Inf;
    rep(i, n - 2) {
      string sub;
      int a;
      sub = s.substr(i, 3);
      a = stoi(sub);
      ans = min(ans, abs(a - 753));
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
char s[110];
int p=0;
int g(double a,int b,double c){
  if(b==2)return a+c;
  if(b==3)return a-c;
  if(b==4)return a*c;
  return a/c;
}
double f(){
  int i,r=0,o[3];
  double n[3],a;
  char c[]={")=+-*/"};
  while(1){
    for(a=0;'0'<=s[p]&&s[p]<='9';p++)a=a*10+s[p]-'0';
    if(s[p]=='('){
      p++;
      a=f();
    }
    for(i=0;s[p]-c[i];i++);
    for(;r&&o[r-1]/2>=i/2;r--)a=g(n[r-1],o[r-1],a);
    n[r]=a;
    o[r++]=i;
    p++;
    if(i/2==0)return n[0];
  }
  return 0;
}
  
int main(){
  int n;
  scanf("%d",&n);
  while(n--){
    p=0;
    scanf("%s",s);
    printf("%d\n",(int)f(s));
  }
  return 0;
}

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

int main(){
  long N;
  cin >> N;
  vector<long> a,b,c;
  for(int j = 0; j < N; j++){
    long tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  for(int j = 0; j < N; j++){
    long tmp;
    cin >> tmp;
    b.push_back(tmp);
  }
  for(int j = 0; j < N; j++){
    long tmp;
    cin >> tmp;
    c.push_back(tmp);
  }
  
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  
  long ans = 0;
  for(auto x : b){
    auto itr_a = lower_bound(a.begin(), a.end(), x);
    long num_a = itr_a - a.begin();
    
    auto itr_c = upper_bound(c.begin(), c.end(), x);
    long num_c = c.end() - itr_c;
    ans += num_a * num_c;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3316
N,K = map(int,input().split())
res = [0]*(K+1)
ans = 0
MOD = 10**9+7
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

for k in range(K,0,-1):
    y = make_divisors(k)
    s = K//k
    tmp = pow(s, N, MOD)
    val = tmp-res[k]
    ans += k*val
    for yy in y:
        res[yy] += val
print(ans%MOD)


Measured memory_bytes: 75356
package main

import (
	"fmt"
	"sort"
)

type Manual []int

func (manual Manual) asValue() Manual {
	var intSlice []int
	for _,val := range manual {
		intSlice = append(intSlice,val)
	}

	return Manual(intSlice)
}

func (manual Manual) remove(index int) {
	copy(manual[index:],manual[index + 1:])

	manual = manual[:len(manual) - 1]
}

func (manual Manual) noDuplication() Manual {
	var noDup Manual
	m := manual.asValue()
	sort.Sort(sort.IntSlice([]int(m)))

	before := make(map[int]bool)
	for _,val := range m {
		if ok := before[val];!ok {
			before[val] = true
			noDup = append(noDup,val)
		}
	}
	return noDup
}

func (manual Manual) evenNumber() Manual {
	sampleManual := manual.asValue()
	sort.Sort(sort.IntSlice([]int(sampleManual)))

	countInt := make(map[int]int,sampleManual.count())
	for _,val := range sampleManual {
		countInt[val]++
	}

	var m Manual
	for key,val := range countInt {
		if !isEven(val) {
			m = append(m,key)
		}
	}

	return m
}

func (manual Manual) count() int {
	return len(manual)
}

func isEven(num int) bool {
	if num % 2 == 0 {
		return true
	}
	return false
}

func main() {
	var manual Manual
	var N int
	var num int

	fmt.Scan(&N)
	manual = make(Manual,N)
	for count := 0;count < N; count++ {
		fmt.Scan(&num)
		manual[count] = num
	}

	fmt.Println(manual.evenNumber().count())
}


Measured memory_bytes: 10752
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;



int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n; cin >> n;
	printf("%d", 180 * (n - 2));
	return 0;
}


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

Measured memory_bytes: 128
void main() {
  problem();
}

void problem() {
  const N = scan!int;
  const A = scan!long(N);

  void solve() {
    long xorAll;
    long[] ans;
    foreach(a; A) xorAll ^= a;
    A.map!(a => (xorAll ^ a).to!string).array.joiner(" ").writeln;
  }

  solve();
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

// -----------------------------------------------


Measured memory_bytes: 16760
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int i,n,a,b,s=0;
	cin>>n>>a>>b;
	for(i=1;i<=n;i++)
	{
		int p=i,k=0,q;
		while(p!=0)
		{
			q=p%10;
			p/=10;
			k+=q;
		}
		if(k>=a&&k<=b) s+=i;
	}
	cout<<s;
	return 0;
}

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int sx,sy;
    int tx,ty;
    Scd2(sx,sy);
    Scd2(tx,ty);

    int x = tx-sx;
    int y = ty-sy;

    Rep(i,x) printf("R");
    Rep(i,y) printf("U");
    Rep(i,x) printf("L");
    Rep(i,y) printf("D");
    printf ("D");
    Rep(i,x+1) printf("R");
    Rep(i,y+1) printf("U");
    printf ("L");
    printf ("U");
    Rep(i,x+1) printf("L");
    Rep(i,y+1) printf("D");
    printf ("R");

    return 0;
}



Measured memory_bytes: 256
# Import
from collections import deque

# I/O
def read(): return input()
def read_int(): return int(input())
def read_array(type=int): return list(map(type, input().split()))
def read_tupple(type=None):
    tmp = input().split()
    if type is None: return map(int, tmp)
    assert len(tmp) == len(type)
    return [type[i](tmp[i]) for i in range(len(tmp))]

# Implementation
N = read_int()
A = read_array()
A.sort()
ans = 1
for i in range(N):
    ans *= A[i]
    if ans > int(1e18):
        print(-1)
        exit()
print(ans)

Measured memory_bytes: 84236