akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define re(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
  vector<int> par;
  Union(int a){
  par=vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(int a,int b){
    return (find(a)==find(b));
  }
  int size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    int c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
int main(){
  char s[300000];
  cin >> s;
  long long n=strlen(s)*(strlen(s)+1)/2;
  long long y;
  char q='a';
  for(int u=0;u<26;u++){
    y=0;
    for(long long i=0;i<strlen(s);i++){
      if(q==s[i]){
        y++;
      }
    }
    n=n-y*(y+1)/2;
    q++;
  }
  cout << n+1;
}

Measured memory_bytes: 512
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int S = scan.nextInt();
        int W = scan.nextInt();
        if (S > W) {
            System.out.println("safe");
        }
        else {
            System.out.println("unsafe");
        }
        scan.close();
    }
}


Measured memory_bytes: 35740
N, M=map(int, input().split())
#A=[]
Y=[[] for _ in range(N)] #県
for i in range(M):
  p,y=map(int, input().split())
  #A.append((p,y))
  Y[p-1].append([y,i+1])

for i in range(N):
  if Y[i]:
    Y[i].sort(key=lambda x: x[0])
#indexは時間かかる
ans=[]
for i in range(N):
  for j,L in enumerate(Y[i]):
    p,y,n=i+1, L[0],L[1]
    ans.append((n,p,j+1))
ans=sorted(ans)
for n,p,y in ans:
  a=(6-len(str(p)))*"0"+str(p)+(6-len(str(y)))*"0"+str(y)
  print(a)

Measured memory_bytes: 43084
#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, a[N];
int b[N];
bool chk(int x) {
    for (int i = 0; i < n + n - 1; ++ i) {
        b[i] = a[i] >= x;
    }
    int mid = n - 1;
    for (int l = mid, r = mid; l > 0; -- l, ++ r) {
        if (b[l] == b[l - 1]) {
            return b[l];
        }
        if (b[r] == b[r + 1]) {
            return b[l];
        }
    }
    return b[0];
}
int main() {
    scanf("%d", &n);
    for (int i = 0; i < n + n - 1; ++ i) scanf("%d", &a[i]);
    int lb = 1, rb = n + n - 1;
    while (lb < rb) {
        int md = (lb + rb + 1) >> 1;
        if (chk(md)) lb = md;
        else rb = md - 1;
    }
    printf("%d\n", lb);
    return 0;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/03/09  Problem: ABC 121 A / Link: http://abc121.contest.atcoder.jp/tasks/abc121_a  ----- */


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

	LL H, W; cin >> H >> W;
	LL h, w; cin >> h >> w;




	LL ans = H*W-(h*W+H*w-h*w);


	cout << (ans) << "\n";

	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
const int N=1e5;
int ne[N],he[N],a[N],vis[N],g[N],t[N],tot,b1[N],x,y,b2[N];
void ad(int x,int y)
{
	tot++;
	ne[tot]=he[x];
	he[x]=tot;
	t[tot]=y;
}
void put(int v)
{
	if (v&1) 
	{
		x++;
		b1[x]=v;
	} else
	{
		y++;
		b2[y]=v;
	}
}
int pd(int x)
{
	if (x%2==0) return 0;
	if (x==1) return 0;
	for (int i=2;i<=sqrt(x);i++) if (x%i==0) return 0;
	return 1;
}
int dfs(int x)
{
	if (vis[x]==tot) return 0;
	vis[x]=tot;
	int i=he[x];
	while (i)
	{
		if (g[t[i]]==0||dfs(g[t[i]])) 
		{
			g[t[i]]=x;
			return 1;
		}
		i=ne[i];
	}
	return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
    put(a[1]-1);
	for (int i=2;i<=n;i++) 
	{
		if (a[i]-a[i-1]!=1) 
		{
			put(a[i-1]);
			put(a[i]-1);
		}
	}
	put(a[n]);
	for (int i=1;i<=x;i++) for (int j=1;j<=y;j++) if (pd(abs(b2[j]-b1[i]))) ad(i,j+x);
	int ans=0;
	for (int i=1;i<=x;i++) 
	{
		tot++;
		ans+=dfs(i);
	}
	x-=ans;
	y-=ans;
	if (x&1) 
	{
		ans+=3;
		x--;
		y--;
	}
	ans+=x+y;
	printf("%d\n",ans); 
}

Measured memory_bytes: 256
//arc076 F
//by Cydiater
//2017.6.30
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define up(i,j,n)	for(int i=j;i<=n;i++)
#define down(i,j,n)	for(int i=j;i>=n;i--)
#define cmax(a,b)	a=max(a,b)
#define cmin(a,b)	a=min(a,b)
#define SZ(x)		(int)x.size()

const int MAXN=2e5+5;
const int oo=0x3f3f3f3f;

int N,M,ans=0;
vector<int>upper[MAXN];

namespace Seg{
	struct tree{
		int mk,mx;
	}t[MAXN<<2];
	void rel(int k){t[k].mx=max(t[k<<1].mx,t[k<<1|1].mx);}
	void mark(int k,int mk){
		t[k].mk+=mk;
		t[k].mx+=mk;
	}
	void Pushdown(int k){
		if(!t[k].mk)return;
		mark(k<<1,t[k].mk);
		mark(k<<1|1,t[k].mk);
		t[k].mk=0;
	}
	void Build(int le,int ri,int k){
		if(le==ri){
			t[k].mx=-(M-le+1);
			return;
		}
		int mi=(le+ri)>>1;
		Build(le,mi,k<<1);
		Build(mi+1,ri,k<<1|1);
		rel(k);
	}
	void Modify(int le,int ri,int k,int l,int r,int v){
		if(le!=ri)Pushdown(k);
		if(l<=le&&ri<=r){
			mark(k,v);
			return;
		}
		int mi=(le+ri)>>1;
		if(l<=mi)	Modify(le,mi,k<<1,l,r,v);
		if(mi+1<=r)	Modify(mi+1,ri,k<<1|1,l,r,v);
		rel(k);
	}
	int Query(int le,int ri,int k,int l,int r){
		if(le!=ri)Pushdown(k);
		if(l<=le&&ri<=r)return t[k].mx;
		int mi=(le+ri)>>1,mx=-oo;
		if(l<=mi)	cmax(mx,Query(le,mi,k<<1,l,r));
		if(mi+1<=r)	cmax(mx,Query(mi+1,ri,k<<1|1,l,r));
		return mx;
	}
}using namespace Seg;

namespace solution{
	void Prepare(){
		scanf("%d%d",&N,&M);
		cmax(ans,N-M);
		up(i,1,N){
			int l,r;
			scanf("%d%d",&l,&r);
			upper[l].push_back(r);
		}
		Build(0,M+1,1);
	}
	void Solve(){
		up(i,0,M){
			up(j,0,SZ(upper[i])-1)Modify(0,M+1,1,0,upper[i][j],1);
			cmax(ans,Query(0,M+1,1,i+1,M+1)-i);
		}
		cout<<ans<<endl;
	}
}

int main(){
//	freopen("input.in","r",stdin);
	using namespace solution;
	Prepare();
	Solve();
	return 0;
}

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

Measured memory_bytes: 256
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
a = inl()
nxt = [0]*(2*n)
first = [-1]*n
prev = {}
for i in range(2*n):
    x = a[i%n]
    if x in prev:
        nxt[prev[x]] = i
    prev[x] = i

ddprint(nxt)
#print("hoge")
#exit()  #- no RE.  i.e. RE after here


loopfound = False
i=0
first[0] = 0
while True:
    i0 = i%n
    j = nxt[i0]+1
    nxtj = j + i - i0
    ddprint("  i {} j {} nxtj {} aj0 {}".format(i,j,nxtj,a[j%n]))
    if nxtj >= n*k:
        break
    j0 = j%n
    if first[j0] != -1:
        loopfound = True
        break
    first[j0] = nxtj
    i = nxtj

#print("bar")
#exit()  # still RE.  i.e. RE before here

ddprint(first)
#ddprint("nxtj {} j0 {} lpfd {}".format(nxtj,j0,loopfound))

if loopfound:
    dif = nxtj - first[j0]
    if dif<=0:  # NTBR
        print("foo")
        exit()
    i = nxtj + ((n*k - nxtj) // dif) * dif
    ddprint("nxt {} j0 {} dif {} i {}".format(nxtj,j0,dif,i))
    while True:
        i0 = i%n
        j = nxt[i0] + 1
        nxtj = j+i-i0
        if nxtj >= n*k:
            break
        i = nxtj

ddprint(i)

done = [False] * 200001
stk = []
for j in range(i,n*k):
    ddprint(j)
    ddprint(stk)
    ddprint(done[:11])
    j0 = j%n
    if done[a[j0]]:
        ddprint(a[j0])
        m = len(stk)
        for k in range(m-1,-1,-1):
            x = stk[k]
            ddprint(x)
            stk.pop()
            done[x] = False
            if x==a[j0]:
                break
    else:
        stk.append(a[j0])
        done[a[j0]] = True

for i in stk:
    printn(str(i) + ' ')
print("")


Measured memory_bytes: 44768
<?php
  list($s) = explode(" ", trim(fgets(STDIN)));

  $n = strlen($s);
  for ($i=1; $i<$n; $i++) {
    if($s[$i] == $s[$i-1]){
      echo ($i)." ".($i+1);
      exit;
    }
  }

  for ($i=2; $i<$n; $i++) {
    if($s[$i] == $s[$i-2]){
      echo ($i-1)." ".($i+1);
      exit;
    }
  }

  echo "-1 -1";

Measured memory_bytes: 16228
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
#define int 		long long
#define vi 			vector<int>
#define vec(x) 		vector<x>
#define matrix 		vector<vector<int>>
#define pii 		pair<int,int>
#define repf(i,s,e)  for(int i=s;i<e;i++)
#define repb(i,e,s) for(int i=e;i>=s;i--)
#define MOD			1000000007
#define pb 			push_back
#define ff 			first
#define ss 			second		
#define w(x)		int x; cin>>x; while(x--)
const int INF=1e18;

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
// find_by_order(k-1)  returns iterator to kth element starting from 0; Returns the kth smallest element
// order_of_key(k) returns count of elements strictly smaller than k;Returns the number of elements less than k
// erase,insert same as normal set


void solve(){
	int n;
	cin>>n;

	int ans=0;
	repf(i,1,n+1){
		if(i%3==0 || i%5==0) continue;
		ans+=i;
	}

	cout<<ans<<endl;
}
 
int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	if(fopen("input.txt", "r")){
	    freopen("input.txt", "r", stdin),
	    freopen("output.txt", "w", stdout);
	}
	
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 3592
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		while (n-- > 0) {
			int x = scanner.nextInt();
			int y = scanner.nextInt();
			int w = scanner.nextInt();
			int h = scanner.nextInt();
			int m = scanner.nextInt();
			int ans = 0;
			while (m-- > 0) {
				int nx = scanner.nextInt();
				int ny = scanner.nextInt();
				if (x <= nx && nx <= x + w && y <= ny && ny <= y + h)
					ans++;
			}
			System.out.println(ans);
		}
	}
}

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

#define ED return 0;
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) int(pow(x,y))
const long mod = 1000000007;

int main(){
    int N;
    cin >> N;
    vector<pair<int,int>> vec (N);
    int count = 0;
    bool zerochecker = true;
    for(int i = 0;i < N;i++){
        cin >> vec.at(i).first;
        vec.at(i).second = vec.at(i).first % 10;
        if(zerochecker && vec.at(i).second != 0){
            zerochecker = false;
        }
        count += vec.at(i).second;
    }
    if(zerochecker){
        cout << 0 << endl;
        ED
    }
    SORT(vec);
    if(count % 10 == 0){
        for(int i = 0;i < N;i++){
            if(vec.at(i).second != 0){
                vec.at(i).first = 0;
                break;
            }
        }
    }
    int total = 0;
    for(int i = 0;i < N;i++){
        total += vec.at(i).first;
    }
    cout << total << endl;
}


Measured memory_bytes: 256
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());

    ll A, B;
    cin >> A >> B;

    cout << max(0LL, A - 2 * B) << endl;

    return 0;
}

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

#define M 100005
#define MOD 1000000007
#define PI 3.14159265358979323846
#define ep emplace_back
#define mk make_pair
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

typedef long long int lli;
typedef unsigned long long int ulli;
typedef pair<int,int> PII;
typedef pair<lli,lli> PLL;

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

//    freopen("input.txt","r",stdin);

    int t;
    cin>>t;
    int ac = 0 , wa = 0 , tle = 0 , re = 0;
    while(t--)
    {
        string s;
        cin>>s;
        if(s == "AC")
            ac++;
        else if(s == "WA")
            wa++;
        else if(s=="TLE")
            tle++;
        else
            re++;
    }
    
    cout<<"AC x "<<ac<<"\n";
    cout<<"WA x "<<wa<<"\n";
    cout<<"TLE x "<<tle<<"\n";
    cout<<"RE x "<<re<<"\n";
}


Measured memory_bytes: 3644
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    //整数の入力
    int a = sc.nextInt();
    int b = sc.nextInt();

    int product = a * b;

    if (product % 2 == 0 ) {
      System.out.println("Even");
    } else {
      System.out.println("Odd");
    }
  }
}


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

//https://atcoder.jp/contests/abc146/tasks/abc146_f

int n, m;
string s;
vector<int> ans;

int main() {
	cin >> n >> m >> s;
	for (int i = n - 1, c = n, l = n; i >= 0; --i) {
		if (s[i] == '0')
			l = i;
		if (c - i == m || !i) {
			if (l != c) {
				ans.push_back(c - l);
				c = l;
			} else {
				cout << -1 << endl;
				return 0;
			}
		}

	}

	for (int i = ans.size() - 1; i >= 0; --i)
		cout << ans[i] << (i ? " " : "\n");

}


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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> p(m), y(m);
    vector<vector<int>> y_sort(n);
    for (int i = 0; i < m; ++i)
    {
        cin >> p[i] >> y[i];
        y_sort[p[i] - 1].push_back(y[i]);
    }
    for (int i = 0; i < n; ++i)
    {
        if (y_sort[i].size() == 0) continue;
        sort(y_sort[i].begin(), y_sort[i].end());
    }

    unordered_map<int, string> ans;
    for (int i = 1; i <= n; ++i)
    {
        string id;
        for (int k = 0; k < 6 - to_string(i).size(); ++k) id.push_back('0');
        id += to_string(i);
        for (int k = 1; k <= y_sort[i - 1].size(); ++k)
        {
            string id2;
            for (int c = 0; c < 6 - to_string(k).size(); ++c) id2.push_back('0');
            id2 += to_string(k);
            id2 = id + id2;
            ans[y_sort[i - 1][k - 1]] = id2;
        }
    }

    for (int i = 0; i < m; ++i)
    {
        cout << ans[y[i]] << endl;
    }
}

Measured memory_bytes: 16548
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int main(int argc, char *argv[])
{
	int a, b, c;
	cin >> a >> b >> c;

	if (c <= a + b) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}

	return 0;
}


Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)

	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	m := getNextInt(scanner)

	im := make([]IntMap, n)
	for i := 0; i < n; i++ {
		im[i] = IntMap{}
	}
	for i := 0; i < m; i++ {
		a := getNextInt(scanner) - 1
		b := getNextInt(scanner) - 1
		im[a].increment(b)
	}
	ans := "IMPOSSIBLE"
	for i := range im[0] {
		if im[i].get(n-1) > 0 {
			ans = "POSSIBLE"
			break
		}
	}

	fmt.Fprintln(writer, ans)

	writer.Flush()
}

// IntMap ...
type IntMap map[int]int

func (m IntMap) get(key int) int {
	if _, ok := m[key]; ok {
		return m[key]
	}
	return 0
}
func (m IntMap) increment(key int) {
	if _, ok := m[key]; ok == false {
		m[key] = 0
	}
	m[key]++
}


Measured memory_bytes: 32000
n = int(input())
A = list(map(int,input().split()))

dic = {}
xy = []
for a in A:
    if a in dic:
        dic[a] += 1
        if dic[a] == 2:
            xy.append(a)
            dic[a] = 0
    else:
        dic[a] = 1
xy.sort(reverse = True)
if len(xy) < 2:
    print(0)
else:
    print(xy[0]*xy[1])


Measured memory_bytes: 17932
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

long long N;
int res = 0;

void load(void);
void calc(void);
void output(void);

int main(){
	load();
	calc();
	output();
	return 0;
}

void load(void){
	cin >> N;
}

void calc(void){
	int i, j;
	int buf;
	for(i = 2;i < 1000001;i++){
		buf = 0;
		for(j = 0;j < 100000;j++){
			if(N % i == 0){
				buf++;
				N = (long long)(N / (long long)i);
			}else{
				break;
			}
		}
		for(j = 1;j < 100000;j++){
			buf = buf - j;
			if(buf >= 0){
				res++;
			}else{
				break;
			}
		}
		if(N == 1){
			break;
		}
	}
	if(N != 1){
		res++;
	}
}

void output(void){
	cout << res;
}

Measured memory_bytes: 3640
K, N = [int(n) for n in input().split()]
A = [int(n) for n in input().split()]
#print(K,N,A)
max_dis = 0
total_dis = 0
for i in range(len(A)):
  if i == len(A)-1:
  	dis = A[0] + (K - A[i])
  else:
  	dis = A[i+1] - A[i]
  total_dis +=dis
  if dis > max_dis:
    max_dis = dis
print(total_dis - max_dis)

Measured memory_bytes: 26444
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
const int M = 1e5 + 10;
double a[M];
int main(){
	long long n,t,s;
	double minn = 99999999;
	long long wz;
	cin>>n>>t>>s;
	for(int i=0;i<n;i++){
		cin>>a[i];
		a[i] = fabs((t-a[i]*0.006)-s);
		if(a[i]<minn){
			minn = a[i];
			wz = i+1;
		}
	}
	cout<<wz<<endl;
	return 0;
}


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

#define debug(...) fprintf(stderr, __VA_ARGS__)

#ifndef AT_HOME
#define getchar() IO::myGetchar()
#define putchar(x) IO::myPutchar(x)
#endif

namespace IO {
	static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;

	inline char myGetchar() {
		static char buf[IN_BUF], *ps = buf, *pt = buf;
		if (ps == pt) {
			ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
		}
		return ps == pt ? EOF : *ps++;
	}

	template<typename T>
	inline bool read(T &x) {
		bool op = 0;
		char ch = getchar();
		x = 0;
		for (; !isdigit(ch) && ch != EOF; ch = getchar()) {
			op ^= (ch == '-');
		}
		if (ch == EOF) {
			return false;
		}
		for (; isdigit(ch); ch = getchar()) {
			x = x * 10 + (ch ^ '0');
		}
		if (op) {
			x = -x;
		}
		return true;
	}

	inline int readStr(char *s) {
		int n = 0;
		char ch = getchar();
		for (; isspace(ch) && ch != EOF; ch = getchar())
			;
		for (; !isspace(ch) && ch != EOF; ch = getchar()) {
			s[n++] = ch;
		}
		s[n] = '\0';
		return n;
	}

	inline void myPutchar(char x) {
		static char pbuf[OUT_BUF], *pp = pbuf;
		struct _flusher {
			~_flusher() {
				fwrite(pbuf, 1, pp - pbuf, stdout);
			}
		};
		static _flusher outputFlusher;
		if (pp == pbuf + OUT_BUF) {
			fwrite(pbuf, 1, OUT_BUF, stdout);
			pp = pbuf;
		}
		*pp++ = x;
	}

	template<typename T>
	inline void print_(T x) {
		if (x == 0) {
			putchar('0');
			return;
		}
		static int num[40];
		if (x < 0) {
			putchar('-');
			x = -x;
		}
		for (*num = 0; x; x /= 10) {
			num[++*num] = x % 10;
		}
		while (*num){
			putchar(num[*num] ^ '0');
			--*num;
		}
	}

	template<typename T>
	inline void print(T x, char ch = '\n') {
		print_(x);
		putchar(ch);
	}

	inline void printStr_(const char *s, int n = -1) {
		if (n == -1) {
			n = strlen(s);
		}
		for (int i = 0; i < n; ++i) {
			putchar(s[i]);
		}
	}

	inline void printStr(const char *s, int n = -1, char ch = '\n') {
		printStr_(s, n);
		putchar(ch);
	}
}
using namespace IO;

const int N = 20;
const long long INF = 0x3f3f3f3f3f3f3f3fll;

int n, a[N];
std::map<std::pair<int, int>, long long> f[N][N];

long long DP(int l, int r, int x, int y) {
	if (l + 1 == r) {
		return 0;
	}
	if (f[l][r].count({x, y})) {
		return f[l][r][{x, y}];
	}
	long long ans = INF;
	for (int k = l + 1; k < r; ++k) {
		ans = std::min(ans, DP(l, k, x, x + y) + DP(k, r, x + y, y) + 1ll * a[k] * (x + y));
	}
	return f[l][r][{x, y}] = ans;
}

int main() {
	read(n);
	for (int i = 1; i <= n; ++i) {
		read(a[i]);
	}
	print(DP(1, n, 1, 1) + a[1] + a[n]);
}


Measured memory_bytes: 19868
x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
e=[]
for ai in a:
    for bi in b:
        e.append(ai+bi)
e.sort(reverse=True)
e=e[:k]
ans=[]
for ci in c:
    for ei in e:
        ans.append(ci+ei)
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])

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

using namespace std;

int f[105][10][5];
int pr[105][15];
int c[105];

int main() {
  //freopen("date.in", "r", stdin);
  //freopen("date.out", "w", stdout);

  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= 5; ++j)
      for (int k = 1; k <= 2; ++k)
        scanf("%d", &f[i][j][k]);
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j <= 10; ++j)
      scanf("%d", &pr[i][j]);

  long long ans = -((1LLU << 61) - 1);
  for (int i = 1; i <= 1023; ++i) {
    long long aux = 0;
    for (int j = 0; j < 10; ++j) {
      if (i & (1 << j)) {
        int x = j / 2 + 1;
        int y = 1 + j % 2;
        for (int p = 1; p <= n; ++p)
          if (f[p][x][y] == 1)
            c[p]++;
      }
    }
    for (int p = 1; p <= n; ++p) {
      aux += pr[p][c[p]];
      c[p] = 0;
    }
    ans = max(ans, aux);
  }
  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#define MOD 1000000007
using namespace std;
int main(){
  int n,m;
  int a[100005];
  
  cin>>n>>m;
  for(int i=0;i<m;i++){
    cin>>a[i];
  }
  
  long long dp[100005];
  int cnt_i=0;
  memset(dp,0,sizeof(dp));
  if(a[0]!=1){
    dp[1]=1;
  }else{
    cnt_i++;
  }
  if(a[0]!=2 && a[1]!=2){
    dp[2]=dp[1]+1;
  }else{
    cnt_i++;
  }
  
  for(int i=3;i<=n;i++){
    if(i==a[cnt_i]){
      cnt_i++;
    }else if(i!=a[cnt_i]){
      dp[i]=(dp[i-1]%MOD+dp[i-2]%MOD)%MOD;
    }
  }
 
  cout<<dp[n]<<"\n";
  return 0;
}


Measured memory_bytes: 1408
"""Binary Trees."""

class Node:
    def __init__(self, num, leftChild, rightChild):
        self.id = num
        self.parent = -1
        self.sibling = -1
        self.degree = 0
        self.depth = 0
        self.height = 0
        self.type = 'leaf'
        self.leftChild = leftChild
        self.rightChild = rightChild
        
    def show_info(self):
        print('node {}:'.format(self.id), 'parent = {},'.format(self.parent),
              'sibling = {},'.format(self.sibling),
              'degree = {},'.format(self.degree),
              'depth = {},'.format(self.depth),
              'height = {},'.format(self.height),
              '{}'.format(self.type))


def set_attributes(n_i, parent, sibling, depth):
    h1 = 0
    h2 = 0
    node = T[n_i]
    lc = node.leftChild
    rc = node.rightChild
    node.parent = parent
    node.sibling = sibling
    node.depth = depth
    if lc != -1:
        node.degree += 1
        node.type = 'internal node'
        h1 = set_attributes(lc, n_i, rc, depth + 1) + 1
    if rc != -1:
        node.degree += 1
        node.type = 'internal node'
        h2 = set_attributes(rc, n_i, lc, depth + 1) + 1
    node.height = max(h1, h2)
    return node.height



import sys

n = int(sys.stdin.readline())

T = [None] * n

rt_n = int(n * (n - 1) / 2)

for x in sys.stdin.readlines():
    num, leftChild, rightChild = list(map(int, x.split()))
    node = Node(num, leftChild, rightChild)
    T[num] = node
    rt_n -= (max(0, leftChild) + max(0, rightChild))

set_attributes(rt_n, -1, -1, 0)

T[rt_n].type = 'root'

for n in T:
    n.show_info()

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

struct cube {
	vector<string>v;
	int E = 2, S = 1, U = 0;
	void rotate(char C) {
		int a = E, b = S;
		switch (C) {
		case'E':E = U; U = 5 - a; break;
		case'S':S = U; U = 5 - b; break;
		case'L':E = S; S = 5 - a; break;
		}
	}
	bool operator==(cube b) {
		rep(i, 2){
			rep(j, 4) {
				rep(k, 4) {
					if (v[E] == b.v[b.E] && v[5 - E] == b.v[5 - b.E] && v[S] == b.v[b.S] && v[5 - S] == b.v[5 - b.S] && v[U] == b.v[b.U] && v[5 - U] == b.v[5 - b.U])return true;
					rotate('S');
				}
				rotate('E');
			}
			rotate('L');
		}
		return false;
	}
};
cube s[30];
bool used[30];
int main() {
	int n;
	while (cin >> n, n) {
		rep(i, n) {
			s[i].v = vector<string>(6);
			rep(j, 6)cin >> s[i].v[j];
		}
		vector<int>v[30];
		rep(i, n)for (int j = i + 1; j < n; j++) {
			if (s[i] == s[j]) {
				v[i].push_back(j);
			}
		}
		int cnt = 0;
		memset(used, 0, sizeof(used));
		rep(i, n) {
			if (used[i])continue;
			cnt++;
			for (int j : v[i])used[j] = true;
		}
		printf("%d\n", n - cnt);
	}
}

Measured memory_bytes: 3360
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const int INF = INT_MAX / 4;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<vector<bool> > x(5, vector<bool>(n));
        for(int i=0; i<5; ++i){
            for(int j=0; j<n; ++j){
                char c;
                cin >> c;
                x[i][j] = (c == 'X');
            }
        }

        int ng = 0;
        for(int k=0; k<n-1; ++k){
            for(int i=0; i<5; ++i){
                for(int j=0; j<n-1-k; ++j){
                    if(x[i][j] && x[i][j+1+k])
                        ng |= 1 << k;
                }
            }
        }

        vector<vector<int> > dp(11, vector<int>(1<<(n-1), INF));
        dp[0][0] = 0;
        for(int i=0; i<10; ++i){
            for(int j=(1<<(n-1))-1; j>=0; --j){
                if(~j & 1)
                    dp[i+1][(j>>1)|ng] = min(dp[i+1][(j>>1)|ng], dp[i][j]+1);
                dp[i][j>>1] = min(dp[i][j>>1], dp[i][j]+1);
            }
        }

        int ret = *min_element(dp[10].begin(), dp[10].end()) + n - 1;
        cout << ret << endl;
    }
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
#define gr vector<vpii>
#define str string
#define mask vector<bool>
#define vs vector<str>
#define pq priority_queue
#define ordered_set_of(T) tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
#define fi first
#define se second
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define nub(x) x.resize(unique(all(x)) - x.begin())
#define TWO class T1, class T2
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define MOD (int)(1E9 + 7)
#define GAME_OVER return 0
using namespace std;
using namespace __gnu_pbds;
char _$ = ' ';
struct sep {sep(char c) {_$ = c;}};
ostream& operator<<(ostream& o, sep s) {return o;}
template<TWO> ostream& operator<<(ostream& o, pair<T1, T2> x) {return o << x.fi << ' ' << x.se;}
template<TWO> istream& operator>>(istream& i, pair<T1, T2>& x) {return i >> x.fi >> x.se;}
template<class T> ostream& operator<<(ostream& o, vector<T> x) {for (auto it : x) o << it << _$; return o;}
template<class T> istream& operator>>(istream& i, vector<T>& x) {for (auto& it : x) i >> it; return i;}
int mul(int a, int b)
{
    return a * b % MOD;
}
int add(int a, int b)
{
    return (a + b) % MOD;
}
int sub(int a, int b)
{
    return (a - b + MOD) % MOD;
}
int binpow(int a, int b)
{
    int res = 1;
    while (b)
    {
        if (b % 2)
            res = mul(res, a);
        a = mul(a, a), b /= 2;
    }
    return res;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, k;
    cin >> n >> k;
    vi dp(k + 1);
    int res = 0;
    for (int i = k; i >= 1; i--)
    {
        int cur = binpow(k / i, n), d = 2;
        while (d * i <= k)
            cur = sub(cur, dp[d * i]), d++;
        dp[i] = cur;
        res = add(res, mul(cur, i));
    }
    cout << res << endl;
    GAME_OVER;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};

typedef struct node * Node;

Node root;

Node treeSearch(Node, int);
void Insert(int);
void Inorder(Node);
void Preorder(Node);

int main() {

  int n, i, x;
  char com[20];
  Node t;

  scanf("%d", &n);

  root = malloc(sizeof(struct node));
  root = NULL;

  for (i = 0 ; i < n ; i++) {
    scanf("%s", com);

    if (com[0] == 'f') {
      scanf("%d", &x);

      t = treeSearch(root, x);

      if (t != NULL) {
        printf("yes\n");
      } else printf("no\n");
    } else if ( com[0] == 'i' ) {
      scanf("%d", &x);
      Insert(x);
    } else if ( com[0] == 'p' ) {
      Inorder(root);
      printf("\n");

      Preorder(root);
      printf("\n");
    } 
  }

  return 0;
}

void Insert(int k) {

  Node y = NULL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NULL;
  z->right = NULL;

  while(x != NULL){

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

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

Node treeSearch(Node u,int k) {

  while((u != NULL) && (k != u->key)){

    if(k < u->key){
      u = u->left;
    } else {
      u = u->right;
    }
  }

  return u;
}

void Inorder(Node u) {

  if(u->left != NULL) {
    Inorder(u->left);
  }
  
  printf(" %d",u->key);

  if(u->right != NULL) {
    Inorder(u->right);
  }
}

void Preorder(Node u) {

  printf(" %d",u->key);
  
  if(u->left != NULL) {
    Preorder(u->left);
  }
  
  if(u->right != NULL) {
    Preorder(u->right);
  }
}

Measured memory_bytes: 19364
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
/*---------------------DEBUGGING--------------------------------------------*/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
/*-------------------------------------------------------------------------------------*/
//#define mp make_pair
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define pcc pair<char,char>
#define F first
#define S second
#define int long long
#define pi 3.141592653589793238462643383279502
#define M  1000000007
#define rep(i,a,n) for(int i=a;i<n;i++)
#define INF 1000000000000000000
#define N 200005
#define vi vector<int>
#define all(v) v.begin(),v.end()
//#define endl "\n"
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
signed main()
{
   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   int n;
   cin>>n;
   vector<pii>v;
   vi v1,v2;
   for(int i=0;i<n;i++)
   {
       int x,y;
       cin>>x>>y;
       v.pb({x,y});
       v1.pb(x+y);
       v2.pb(x-y);
   }
   sort(all(v1));
   sort(all(v2));
   cout<<max(v1.back()-v1[0],v2.back()-v2[0])<<endl;

}


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

vector<vector<int>> g;
vector<int> d, f;

void dfs(int v, int &t) {
	d[v] = t++;
	for (auto nv : g[v]) {
		if (d[nv]) continue;
		dfs(nv, t);
	}
	f[v] = t++;
}

int main() {
	int n;
	cin >> n;
	g.resize(n);
	rep(i, n) {
		int u, k;
		cin >> u >> k;
		u--;
		rep(i, k) {
			int v;
			cin >> v;
			v--;
			g[u].push_back(v);
		}
	}
	d.assign(n, 0);
	f.assign(n, 0);
	int t = 1;
	for (int i = 0; i < n; i++) {
		if (d[i]) continue;
		dfs(i, t);
	}
	rep(i, n) {
		cout << i + 1 << " " << d[i] << " " << f[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 3164
#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>

int main() {
	std::string str; std::cin >> str;
	if (str.size() < 2 || str.size() % 2 != 0) {
		std::cout << "No\n";
		return 0;
	}
	for (auto i = 0; i < str.size(); ++i) {
		if ((i % 2) == 0 && str[i] != 'h') {
			std::cout << "No\n"; return 0;
		}
		if ((i % 2) == 1 && str[i] != 'i') {
			std::cout << "No\n"; return 0;
		}
	}
	std::cout << "Yes\n";
}

Measured memory_bytes: 760
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#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

#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 29)
using namespace std;

//文字列から数値への変換
long long toNum(string str){
    long long num = 0, K = 1;
    for(int i = str.size() - 1; i >= 0; i--){
        num+=(str[i] - '0') * K;
        K*=10;
    }
    return num;
}

long long requestSum(string s, vector<int> vi){
    long long retval = 0;
    rep(i,vi.size() - 1){
        string div;
        for(int j = vi[i] + 1; j <= vi[i + 1]; j++){
            div+=s[j];
        }
        retval += toNum(div);
    }
    return retval;
}

int main(){
    string s;
    long long ans = 0;
    cin >> s;
    int len = s.size() - 1;

    rep(i,(1 << len)){
        vector<int> vi;
        vi.push_back(-1);
        rep(j,len){
            if((i & (1 << j)) == (1 << j)){
                vi.push_back(j);
            }
        }
        vi.push_back(len);
        ans += requestSum(s, vi);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int gcd(int a0, int a1){
    int a, b, r;
    a=a0;
    b=a1;
    while(b!=0){
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}

int main(void){
    int k;
    int sum=0;
    scanf("%d", &k);

    for(int a=1;a<=k;a++){
        for(int b=1;b<=k;b++){
            for(int c=1;c<=k;c++){
                sum+=gcd(gcd(a, b), c);
            }
        }
    }
    printf("%d\n", sum);
    return 0;
}

Measured memory_bytes: 1732
#include <iostream>
#include <algorithm>
#include <string>
#include <stdlib.h>
#include <vector>
#include <climits>
#include <math.h>
#include <map>
#include <set>
using namespace std;
int main()
{
	long long int n;
	cin>>n;
	long long int sum=0;
	for (int i = 0; i <= n; ++i)
	{
		if (i%3!=0 && i%5!=0)
		{
			sum=sum+i;
		}
	}
	cout<<sum;
}

Measured memory_bytes: 3592
n = int(input())
card1 = list(input().split())
card2 = [i for i in card1]
def bubbleSort(c1:list, n:int):
    for i in range(n):
        for j in range(n-1, i, -1):
            if c1[j][1] < c1[j-1][1]:
                c1[j], c1[j-1] = c1[j-1], c1[j]
    return c1

def selectionSort(c2:list, n:int):
    for i in range(n):
        minj = i
        for j in range(i, n):
            if c2[j][1] < c2[minj][1]:
                minj = j
        c2[i], c2[minj] = c2[minj], c2[i]
    return c2

bubblesort = bubbleSort(card1, n)
selectionsort = selectionSort(card2, n)

flag = 0
for i in range(n):
    if bubblesort[i] != selectionsort[i]:
        flag = 1

print(" ".join(bubblesort))
print("Stable")
print(" ".join(selectionsort))
if flag:
    print("Not stable")
else:
    print("Stable")



Measured memory_bytes: 5612
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.Text;

namespace AtCoder {
    public class Program {
        static int[] getKeys() {
            var Keys = Console.ReadLine().Split(' ');
            int N = Keys.Length;
            int[] Ns = new int[N];
            for (int i = 0; i < N; i++) {
                Ns[i] = int.Parse(Keys[i]);
            }
            return Ns;
        }
        static int[] getKeys(char delimiter) {
            var Keys = Console.ReadLine().Split(delimiter);
            int N = Keys.Length;
            int[] Ns = new int[N];
            for (int i = 0; i < N; i++) {
                Ns[i] = int.Parse(Keys[i]);
            }
            return Ns;
        }

        public static void Show<T>(T[,] map) {
            int H = map.GetLength(0);
            int W = map.GetLength(1);
            Console.WriteLine("-------------------------");
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    Console.Write(map[i, j] + " ");
                }
                Console.WriteLine();
            }
            Console.WriteLine("-------------------------");
        }
        public static void Show<T>(T[,] map, string delimiter) {
            int H = map.GetLength(0);
            int W = map.GetLength(1);
            Console.WriteLine("-------------------------");
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    Console.Write(map[i, j] + delimiter);
                }
                Console.WriteLine();
            }
            Console.WriteLine("-------------------------");
        }
        public static void Show<T>(IEnumerable<T> ts) {
            foreach (var item in ts) {
                Console.Write(item + " ");
            }
            Console.WriteLine();
        }
        public static void Show<T>(IEnumerable<T> ts, string delimiter) {
            foreach (var item in ts) {
                Console.Write(item + delimiter);
            }
            Console.WriteLine();
        }

        static void Main() {
            var Key = getKeys();
            long K = Key[0];
            long A = Key[1];
            long B = Key[2];
            long answer = 0;
            if (B - A > 2) {//交換
                if (K + 1 <= A) {//できないで終わる
                    answer = K + 1;
                } else {
                    long rest = K - (A - 1);
                    answer = A;
                    if (rest % 2 == 0) {
                        answer += (B - A) * rest / 2;
                    } else {
                        answer += (B - A) * (rest / 2) + 1;
                    }
                }
            } else {
                answer = K + 1;
            }
            Console.WriteLine(answer);
        }
    }
}


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

#define N_MAX 36

struct Card {
  char suit;
  int value;
};

void bubbleSort(struct Card C[], int N) {
  int i, j;
  for (i = 0; i < N; i++) {
    for (j = N - 1; j > i; j--) {
      if (C[j].value < C[j - 1].value) {
        struct Card tmp = C[j];
        C[j] = C[j - 1];
        C[j - 1] = tmp;
      }
    }
  }
}

void selectionSort(struct Card C[], int N) {
  int i, j, minj;
  for (i = 0; i < N; i++) {
    minj = i;
    for (j = i; j < N; j++) {
      if (C[j].value < C[minj].value) {
        minj = j;
      }
    }
    struct Card tmp = C[i];
    C[i] = C[minj];
    C[minj] = tmp;
  }
}

int isStable(struct Card C1[], struct Card C2[], int N) {
  int i;
  for (i = 0; i < N; i++) {
    if (C1[i].suit != C2[i].suit) {
      return 0;
    }
  }
  return 1;
}

int main(void) {
  int i, N;
  char t[10];
  struct Card C1[N_MAX], C2[N_MAX];

  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", &t);
    C1[i].suit = t[0];
    C1[i].value = atoi(&t[1]);
    C2[i].suit = t[0];
    C2[i].value = atoi(&t[1]);
  }

  bubbleSort(C1, N);
  selectionSort(C2, N);

  printf("%c%d", C1[0].suit, C1[0].value);
  for (i = 1; i < N; i++) {
    printf(" %c%d", C1[i].suit, C1[i].value);
  }
  printf("\n");
  printf("Stable\n");

  printf("%c%d", C2[0].suit, C2[0].value);
  for (i = 1; i < N; i++) {
    printf(" %c%d", C2[i].suit, C2[i].value);
  }
  printf("\n");
  if (isStable(C1, C2, N) == 1) {
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }

  return 0;
}

Measured memory_bytes: 612
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.nextLine());
		int[] A = Arrays.stream(sc.nextLine().split(" ")).mapToInt(s -> Integer.parseInt(s)).toArray();
		int[] X = new int[N];
		int S = Arrays.stream(A).sum();

		X[0] = S;
		for (int i = 1; i < N; i += 2) X[0] -= 2 * A[i];
		for (int i = 1; i < N; i++) X[i] = 2 * A[i - 1] - X[i - 1];

		Arrays.stream(X).forEach(s -> System.out.print(s + " "));
	}
}

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

using namespace std;

int main()
{
    double n,d;

    cin>>n>>d;

    double x,y;
    int cnt=0;

    for(int i=0; i<n; i++){
        cin>>x>>y;
        if(sqrt((x*x)+(y*y))<=d){
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3684
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    char x,y,z;
    cin>>x>>y>>z;
    char n='7';
    if(n==y || n==x || n==z) Yes;
    else No;
}
//./problem.exe

Measured memory_bytes: 3656
var x:longint;
    i,j:longint;
    a,max:longint;
begin
  read(x);
  for i:=1 to x do
  if i*i>x then break else
  begin
    a:=i;
    for j:=1 to x do
    if a*i>x then break else a:=a*i;
    if a>max then max:=a;
  end;
  writeln(max);
end.

Measured memory_bytes: 128
N, *A = map(int, open(0).read().split())
A.sort()
dp = [True]*3*int(1e6)
x = -1
for a in A:
  if a == -1: continue
  x = a
  while x <= A[-1]:
    x += a
    dp[x] = False
  x = a

res = 0
for i, a in enumerate(A):
  if i > 0 and a == A[i-1]: continue
  if i < N-1 and a == A[i+1]: continue
  if dp[a]: res += 1
print(res)

Measured memory_bytes: 44168