akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

#define EPS (1e-7)

int main() {
  ll H, W, K;
  cin >> H >> W >> K;

  vector<vector<ll>> Cake(H);
  ll ichigo_num = 0;
  for (ll i = 0; i < H; i++) {
    for (ll j = 0; j < W; j++) {
      char c;
      cin >> c;
      ll num = 0;
      if (c == '#') {
        ichigo_num++;
        num = ichigo_num;
      }
      Cake[i].push_back(num);
    }
  }
  // 行単位で見ていく
  vector<ll> yoyaku;  // 予約した行番号
  for (ll i = 0; i < H; i++) {
    // 何もない行は予約する。
    if (all_of(begin(Cake[i]), end(Cake[i]), [](auto x) { return x == 0; })) {
      yoyaku.push_back(i);
    } else {
      // 何かある行は、できる限り埋める。
      for (ll j = 0; j < W; j++) {
        // 0であれば、左右のどちらかに接する0以外の数字に変換する
        if (Cake[i][j] == 0) {
          ll& ref = Cake[i][j];
          bool done = false;
          //　戻る方向
          for (ll k = j - 1; k >= 0; k--) {
            if (Cake[i][k] != 0) {
              ref = Cake[i][k];
              done = true;
              break;
            }
          }
          // 進む方向
          if (!done) {
            for (ll k = j + 1; k < W; k++) {
              if (Cake[i][k] != 0) {
                ref = Cake[i][k];
                done = true;
                break;
              }
            }
          }
        }
      }
    }
  }

  // 最後に予約した行を上下いずれかの行のコピーとする。
  // 予約が連続していないか気を付ける。
  // 行ごとに見ていき、予約済みか見る。
  for (ll i = 0; i < H; i++) {
    // 予約してある行であるか
    if (any_of(begin(yoyaku), end(yoyaku), [i](auto x) { return x == i; })) {
      auto& ref = Cake[i];
      bool done = false;
      // 戻る方向
      for (ll j = i - 1; j >= 0; j--) {
        if (none_of(begin(yoyaku), end(yoyaku), [j](auto x) { return x == j; })) {
          // 予約されていない行が見つかった
          ref = Cake[j];
          done = true;
          break;
        }
      }
      // 進む方向
      if (!done) {
        for (ll j = i + 1; j < H; j++) {
          if (none_of(begin(yoyaku), end(yoyaku), [j](auto x) { return x == j; })) {
            // 予約されていない行が見つかった
            ref = Cake[j];
            done = true;
            break;
          }
        }
      }
    }
  }

  for (const auto& cake_row : Cake) {
    for (const auto& x : cake_row) {
      cout << x << " ";
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 1920
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int state = 0;
		int n = sc.nextInt();
		String s = sc.next();
		int ans = 0;
		for(int i = 0; i < n; i++) {
			char c = s.charAt(i);
			if(c == 'A') {
				state = 1;
			} else if(c == 'B' && state == 1) {
				state = 2;
			} else if(c == 'C' && state == 2) {
				ans++;
				state = 0;
			} else {
				state = 0;
			}
		}
		System.out.println(ans);

	}

}


Measured memory_bytes: 22228
//
// Created on 2020/04/19.
//


#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <ios>
#include <iomanip>
#include <numeric>

#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;


int main() {
    double ans;
    double r;
    cin>>r;
    static const double pi =acos(-1);

    ans = 2 * r * pi;
    printf("%.20f\n",ans);

    return 0;
}


Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repv(i,a,b) for(ll i=b-1;i>=a;i--)
#define MAXN 300005
#define endl "\n"

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;}

ll a,b,c,d;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>a>>b>>c>>d;
    ll p=((c*d)/__gcd(c,d));
    cout<<(b-a+1)-(b/c-(a-1)/c)-(b/d-(a-1)/d)+(b/p-(a-1)/p)<<endl;
}

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

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
 
#define nl '\n'
#define ll long long 
#define ull unsigned long long
#define debug(x)       { cerr << #x << " = " << x << endl; } 
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
 
const int Max = (int)2e5+5;
 
//functions
ll lcm(ll a,ll b) {if(a==0 || b==0){return 0;}else{return (a*b)/__gcd(a,b);}}
 
//direction arry
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
 
//____________________________________________________________________________________________________
void solve()
{
    int k,a,b;
    cin>>k;
    cin>>a>>b;
    for(int i=a;i<=b;i++)
    {
        if(i%k==0)
        {
            cout<<"OK"<<endl;
            return ;
        }
    }
    cout<<"NG"<<endl;
}
int main()
{
    fastread;
    int tc=1;
    // cin>>tc;
    while(tc--){
        solve();
    }
    return 0;
}

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

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

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#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,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N, K;
  cin >> N >> K;
  VI cs(N), rs(N);
  REP(i,N){
	cin >> cs[i] >> rs[i];
  }
  VVI G(N);
  REP(i,K){
	int u, v;
	cin >> u >> v;
	--u;
	--v;
	G[u].PB(v);
	G[v].PB(u);
  }

  using Type = pair<int,PII>;
  priority_queue<Type, vector<Type>, greater<Type>> pq;
  map<PII,int> dist;
  pq.push(Type(0,MP(0,0)));
  dist[MP(0,0)] = 0;
  int ans = 1e9;
  while(!pq.empty()){
	Type ty = pq.top();
	pq.pop();
	if(dist[ty.SS] < ty.FF) continue;
	int c = ty.FF;
	int u = ty.SS.FF;
	int r = ty.SS.SS;
	if(u == N-1){
	  ans = c;
	  break;
	}

	int nc = c + cs[u];
	if(!dist.count(MP(u,rs[u])) || nc < dist[MP(u,rs[u])]){
	  dist[MP(u,rs[u])] = nc;
	  pq.push(MP(nc,MP(u,rs[u])));
	}
	if(r > 0){
	  for(int to: G[u]){
		if(!dist.count(MP(to,r-1)) || c < dist[MP(to,r-1)]){
		  dist[MP(to,r-1)] = c;
		  pq.push(MP(c,MP(to,r-1)));
		}
	  }
	}
  }
  cout << ans << endl;

  return 0;
}

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

int main() {
  vector<int> a(5);
  int ans=0;
  rep(i,5){
    cin>>a.at(i);
    ans+=((a.at(i)/10)+(a.at(i)%10==0 ? 0:1))*10;
    a.at(i)=a.at(i)%10+(a.at(i)%10==0 ? 10:0);
    //cout<<ans<<" ";
  }
  sort(a.begin(),a.end());
  ans=ans-10+a.at(0);
  cout<<ans;
}
      

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

int main() {
  int N;
  cin >> N;
  vector<int> L(2*N);
  for (int i=0; i<2*N; i++) cin >> L.at(i);
  sort(L.begin(), L.end(), greater<int>());
  int total = 0;
  for (int i=0; i<2*N; i+=2)
    total += min(L.at(i), L.at(i+1));
  cout << total << endl;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
left=0
right=10**5
for _ in range(m):
    l,r=map(int,input().split())
    if l>= left:
        left = l
    if r<= right:
        right = r
if right>=left:
    print(right-left+1)
else:
    print("0")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
#define reps(i, n) for(int i = 1; i <= n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;
int main()
{
	int n;
	ll a, b;
	cin >> n >> a >> b;;
	ll x[100010], y[100010];
	rep(i, n) cin >> x[i];
	ll ans=0;
	reps(i, n-1) ans+=min(a*(x[i]-x[i-1]), b);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main() {
	int N;
	cin >> N;
	int a;
	int b[100001];
	for (int i = 0; i < 100001; ++i) {
		b[i] = 0;
	}
	for (int i = 0; i < N; ++i) {
		cin >> a;
		if (a == 1) {
			b[1]++;
			b[2]++;
		}
		else if (a == 100000) {
			b[100000]++;
			b[99999]++;
		}
		else {
			b[a]++;
			b[a - 1]++;
			b[a + 1]++;
		}
	}
	int X = 0;
	for (int i = 0; i < 100001; ++i) {
		X = max(X, b[i]);
	}
	cout << X << endl;
	return 0;
}

Measured memory_bytes: 640
using System;
using System.Linq;

class F
{
	static void Main()
	{
		var h = Console.ReadLine().Split().Select(int.Parse).ToArray();
		int r1 = h[0], c1 = h[1], r2 = h[2], c2 = h[3];
		Console.WriteLine(Sum(r1, r2, c2) - Sum(r1, r2, c1 - 1));
	}

	static MInt Sum(int r1, int r2, int c)
	{
		MInt t = MInt.MNcr(c + r1, r1), v = 0;
		for (int i = r1; i <= r2; ++i)
		{
			t *= c + i + 1;
			t /= i + 1;
			v += t;
		}
		return v;
	}
}

struct MInt
{
	const int M = 1000000007;
	public long V;
	public MInt(long v) { V = (v %= M) < 0 ? v + M : v; }

	public static implicit operator MInt(long v) => new MInt(v);
	public static MInt operator +(MInt x) => x;
	public static MInt operator -(MInt x) => -x.V;
	public static MInt operator +(MInt x, MInt y) => x.V + y.V;
	public static MInt operator -(MInt x, MInt y) => x.V - y.V;
	public static MInt operator *(MInt x, MInt y) => x.V * y.V;
	public static MInt operator /(MInt x, MInt y) => x * y.Inv();

	public MInt Pow(int i) => MPow(V, i);
	public MInt Inv() => MPow(V, M - 2);
	public override string ToString() => $"{V}";

	static long MPow(long b, int i)
	{
		for (var r = 1L; ; b = b * b % M)
		{
			if (i % 2 > 0) r = r * b % M;
			if ((i /= 2) < 1) return r;
		}
	}

	public static long MFactorial(int n) { for (long x = 1, i = 1; ; x = x * ++i % M) if (i >= n) return x; }
	public static long MNpr(int n, int r)
	{
		if (n < r) return 0;
		for (long x = 1, i = n - r; ; x = x * ++i % M) if (i >= n) return x;
	}
	public static MInt MNcr(int n, int r) => n < r ? 0 : n - r < r ? MNcr(n, n - r) : (MInt)MNpr(n, r) / MFactorial(r);
}


Measured memory_bytes: 13396
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <numeric>

using namespace std;


void func()
{
	int K;
	string S;
	cin >> K;
	cin >> S;

	if (S.length() <= K)
		cout << S << endl;
	else
		cout << S.substr(0, K) << "..." << endl;
	return;
}

int main() {

//while (1)
		func();
	return 0;
}


Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> X(N);
  for(int i=0; i<N; i++){
    cin >> X[i];
  }
  sort(X.begin(), X.end());
  int ans;
  for(int i=X[0]; i<=X[N-1]; i++){
    int temp=0;
    for(int j=0; j<N; j++){
      temp+=(X[j]-i)*(X[j]-i);
    }
    if (i==X[0]) ans=temp;
    else ans=min(ans, temp);
  }
  cout << ans << endl;
}

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

int main(void){
    int N,X;
    cin >> N >> X;
    int m[N],min,sum,count;
    
    cin >> m[0];
    min = sum = m[0];
    for(int i = 1;i < N;i++){
        cin >> m[i];
        if(min > m[i])min = m[i];
        sum += m[i];
    }
    X -= sum;
    count = N + (X / min);
    cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int Digits(llong num){
  int cnt = 0;
  while(num > 0){
    num / 10;
    cnt++;
  }
  return cnt;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    S[3] = '8';
    cout << S << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int a[51][51];
bool b[51][51];
int main()
{
    int i,j,n,m;
    cin>>n>>m;
    for (i=1;i<=n;i++)
    for (j=1;j<=m;j++)
    {
        char c;
        cin>>c;
        if (c=='#') b[i][j]=1;
    }
    for (i=1;i<=n;i++)
    {
    for (j=1;j<=m;j++)
    if (!b[i][j]) 
    {
        a[i][j]=b[i-1][j-1]+b[i-1][j]+b[i-1][j+1]+b[i][j-1]+b[i][j+1]+b[i+1][j-1]+b[i+1][j]+b[i+1][j+1];
        cout<<a[i][j];
    }
    else cout<<'#';
    cout<<endl;
    }
    return 0;
}

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

#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define MOD 1000000007
typedef pair<li, li> PI;


int main(void)
{
	li n;
	cin >> n;
	map<li, li> m;
	rep(i, n) {
		li a;
		cin >> a;
		m[a]++;
	}
	li res = 0;
	for (auto && kv : m) {
		if (kv.second % 2 > 0) {
			res++;
		}
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
/*
g++ -std=c++11 -Wall -g -fsanitize=undefined -D_GLIBCXX_DEBUG abc045/c.cpp
*/
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SZ(x) ((int)(x).size())
typedef long long ll;


string s;
ll ans = 0;
// 01 + 234 + 56 + 7 とかなら v = [1, 4, 6]
void func(vector<int> v){
    ll a = 0;
    int n = v.size();
    int cnt = 0;
    rep(i, n){
        a += stoll(s.substr(cnt, v[i] + 1 - cnt));
        cnt = v[i] + 1;
    }
    a += stoll(s.substr(cnt, s.length() - cnt));
    ans += a;
}

void makev(int n){
        // {0, 1, ..., n-1} の部分集合の全探索
    for (int bit = 0; bit < (1<<n); ++bit)
    {
        /* きちんとできていることを確認してみる */
        // bit の表す集合を求める
        vector<int> S;
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { // i が bit に入るかどうか
                S.push_back(i);
            }
        }
        func(S);

        // // bit の表す集合の出力
        // cout << bit << ": {";
        // for (int i = 0; i < (int)S.size(); ++i) {
        //     cout << S[i] << " ";
        // }
        // cout << "}" << endl;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);//おまじないでcin, cout早くする
    cin >> s;
    int n = s.length();
    makev(n - 1);

    // ans += stoll(s);
    cout << ans << "\n";
    
    return 0;
}

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





int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll k,a,b,ans;
	cin>>k>>a>>b;
		if(b-a>2){
			k=k-(a-1);
			if(k%2==0){
				ans=a+(b-a)*(k/2);
			}else{  
				ans=a+(b-a)*(k/2)+1;
			}
		}else{
			ans=k+1;
		}cout<<ans;
}

Measured memory_bytes: 256
A=int(input())
dict_f={}
def divisor(N):
   l={}
   for i in range(2,N+1):
      cnt=0
      while N%i==0:
         cnt+=1
         N//=i
      if cnt>0:
         l[i]=cnt
   return l
for i in range(2,A+1):
   D=divisor(i).items()
   for j,k in D:
      try:
         dict_f[j]=dict_f[j]+k
      except KeyError:
         dict_f[j]=k
dict_f=dict_f.values()
def num(N):
   return len(list(filter(lambda x: x >= N-1, dict_f)))
print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;

int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	int m1, d1, m2, d2;
 	cin >> m1 >> d1 >> m2 >> d2;
 	cout << (m1!=m2);
	return 0;
}


Measured memory_bytes: 256
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    data=[parseMap(split(readline())) for i in 1:n]
    arr=Vector{Tuple{Int,Int}}()
    for i in 1:n
        for j in 1:n
            if i==j
                continue
            end
            push!(arr,(data[i][1]-data[j][1],data[i][2]-data[j][2]))
        end
    end
    cnt=Dict{Tuple{Int,Int},Int}()
    M=0
    for i in arr
        if haskey(cnt,i)
            cnt[i]+=1
        else
            cnt[i]=1
        end
        M=max(M,cnt[i])
    end
    println(n-M)
end
main()

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

int main() {
	int y,m,d;
	char c1,c2;
	cin>>y>>c1>>m>>c2>>d;
	if(m<=4){
		cout<<"Heisei";
	}
	else {
		cout<<"TBD";
	}
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>

int main(){
    int N;
    int h[110],x[110], y[110];
    int i, j, k;
    int hmax, hnow;
    int tmpx, tmpy, tmph;

    scanf("%d", &N);

    for(i=0; i<N; i++){
        scanf("%d %d %d", &x[i], &y[i], &h[i]);
    }
    for(i=0; i<N; i++){
        if(h[i]>0){
            tmpx = x[i]; x[i] = x[0]; x[0] = tmpx;
            tmpy = y[i]; y[i] = y[0]; y[0] = tmpy;
            tmph = h[i]; h[i] = h[0]; h[0] = tmph;
            break;
        }
    }
    for(i=0; i<=100; i++){
        for(j=0; j<=100; j++){
            hmax = h[0] + abs(i-x[0]) + abs(j-y[0]);
            if(hmax<1){
                break;
            }
            for(k=1; k<N; k++){
                hnow = hmax - abs(i-x[k]) - abs(j-y[k]);
                if(hnow<0){
                    hnow = 0;
                }
                if(h[k] != hnow){
                    break;
                }
            }
            if(k>=N){
                break;
            }
        }
        if(k>=N){
            break;
        }
    }

    printf("%d %d %d", i, j, hmax);

    return 0;
}

Measured memory_bytes: 128
import math
a, b, c =  map(int,input().split())

rad = math.radians(c)

S = a*b*math.sin(rad)/2.0
C = math.sqrt(a*a+b*b-2*a*b*math.cos(rad))
h = 2*S/a
print("%.10f %.10f %.10f"%(S,a+b+C,h))


Measured memory_bytes: 5712
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define INF         100000000000000000
#define PI          3.1415926535897932384626433832795l



#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#define p(a) cout<<a<<"\n"


// ll mod = 1000000007;
// #define l(i, )
// #define rl(i, a, b) for(int i = a; i < b; i++)






// struct mycomp {
//     bool operator() (const pair<int,int> &a, const pair<int,int> &b) const{
//         if (a.second-a.first != b.second-b.first)
//         return (a.second-a.first > b.second-b.first);
//         return a.first < b.first;
//     }
// };



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


ll extended_gcd(ll a, ll b, ll& x, ll& y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1, y1;
	ll d = extended_gcd(b, a%b, x1, y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;
}

////////////////////SIEVE OF ERATOSTHENES//////////////////////
vector<int> sieveoferatosthenes(int n)
{
	vector<bool> prime(n+1, true);
	for(int i = 2; i <= sqrt(n); i++)
	{
		if(prime[i])
		{
			for(int j = i*i; j<=n; j+=i)
			{
				prime[j]=false;
			}
		}
	}	
	vector<int> all_primes;
	for(int i = 2; i <=n; i++)
	{
		if(prime[i]) all_primes.pb(i);
	}
	return all_primes;
}

////////////////////BINARY EXPONENTIATION///////////////////////
ll bin_exp(ll a, ll b, ll mod)
{
	ll ans = 1;
	while(b)
	{
		if(b%2)
		{
			b--;
			ans = (ans%mod*a%mod)%mod;
		}
		b/=2;
		a = (a%mod*a%mod)%mod;
	}
	return ans;
}


///////////////////////////BFS//////////////////////////////////
void bfs(vector<int>& distance, vector<int> a[], vector<bool>& visited, int u, vector<int>& parent)
{
	visited[u]=true;
	parent[u]=-1;
	distance[u]=0;
	queue<int> q;

	q.push(u); 
    while (!q.empty()) { 
  
        int f = q.front(); 
        q.pop(); 
  		for(int i =0; i < a[f].size(); i++)
  		{
  			if(visited[a[f][i]]==false)
  			{
  				distance[a[f][i]]=distance[f]+1;
  				parent[a[f][i]]=f;
  				visited[a[f][i]]=true;
  				q.push(a[f][i]);
  			}
  		}
    } 

}

void solve()
{

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

	// #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// #endif
	string s;
	cin>>s;
	int i1, i2;
	for(int i = 0; i < s.size(); i++)
	{
		if(s[i]=='A')
		{ 
			i1 = i;
			break;
		}
	}
	for(int i = s.size()-1; i >=0; i--)
	{
		if(s[i]=='Z')
		{ 
			i2 = i;
			break;
		}
	}
	p(i2-i1+1);

	return 0;
}	

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

int main() {
  int N,K,R,S,P;
  cin>>N>>K>>R>>S>>P;
  string T;
  cin>>T;
  int ans=0;
  char hand[N];
  for (int i=0;i<N;i++){
    if(i-K<0){
      if(T.at(i)=='r'){
        hand[i]='P';
        ans=ans+P;
      }
      if(T.at(i)=='s'){
        hand[i]='R';
        ans=ans+R;
      } 
      if(T.at(i)=='p'){
        hand[i]='S';
        ans=ans+S;
      }
      continue;
    }
    
    if((i-K>=0)&&(i+K>=N)){
      if((T.at(i)=='r')&&(hand[i-K]!='P')){
        ans=ans+P;
        hand[i]='P';
      }
      if((T.at(i)=='s')&&(hand[i-K]!='R')){
        ans=ans+R;
        hand[i]='R';
      }
      if((T.at(i)=='p')&&(hand[i-K]!='S')){
        ans=ans+S;
        hand[i]='S';
      }          
      continue;
    }
    
    /* K回前が同じ*/
    
    if((T.at(i)=='r')&&(hand[i-K]=='P')){
      if(T.at(i+K)=='r'){
        hand[i]='R';
      }
      if(T.at(i+K)=='s'){
        hand[i]='S';
      } 
      if(T.at(i+K)=='p'){
        hand[i]='R';
      }
      continue;
    }
    if((T.at(i)=='s')&&(hand[i-K]=='R')){
      if(T.at(i+K)=='r'){
        hand[i]='S';
      }
      if(T.at(i+K)=='s'){
        hand[i]='P';
      } 
      if(T.at(i+K)=='p'){
        hand[i]='P';
      }
      continue;
    }
    if((T.at(i)=='p')&&(hand[i-K]=='S')){
      if(T.at(i+K)=='r'){
        hand[i]='R';
      }
      if(T.at(i+K)=='s'){
        hand[i]='P';
      } 
      if(T.at(i+K)=='p'){
        hand[i]='P';
      }
      continue;
    } 
    if(T.at(i)=='r'){
        hand[i]='P';
        ans=ans+P;
      }
      if(T.at(i)=='s'){
        hand[i]='R';
        ans=ans+R;
      } 
      if(T.at(i)=='p'){
        hand[i]='S';
        ans=ans+S;
      }   
  }
  
  /*for(int i=0;i<N;i++){
    cout<<hand[i];
  }*/
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

struct edge{
    int src,dst;
    string cost;
    edge(int src,int dst,string cost):
    src(src),dst(dst),cost(cost){}
    };
vector<edge> ve;
string d[42];
string INF="{";
int n,s;
bool negcy=false;
int bellman_ford(int st){
    rep(i,n+1) d[i]=INF;
    d[st]="";
    int cnt=0;
    bool su=false;
    while(1){
        bool update =false;
        rep(i,ve.size()){
            edge m=ve[i];
            if(d[m.src]!=INF&&d[m.dst]>m.cost+d[m.src]){
                d[m.dst]=m.cost+d[m.src];
                update=true;
                if(cnt>=n*5&&m.dst==s) su=true;
            }
        }
        if(!update) break;
        if(cnt>=n*7){
            negcy=su;break;
        }
        ++cnt;
    }
}
int main(){
    int a,g;
    while(cin>>n>>a>>s>>g,n){
        ve.clear();
        int sr,ds;
        string co;
        rep(i,a){
            cin>>sr>>ds>>co;
            ve.pb(ds,sr,co);
        }
        negcy=false;
        bellman_ford(g);
        if(d[s]==INF||negcy) cout<<"NO"<<endl;
        else cout<<d[s]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3588
#include <stdio.h>


int main(void) {
	int a,b,length,square;
	
	scanf("%d %d", &a, &b);
	
	length = (a+b) * 2;
	square = a*b;
	
	printf("%d %d\n",square,length);
	
	return 0;
}
 	
	

Measured memory_bytes: 596
#include<iostream>
using namespace std;
int main(){
  int A, B, K;
  cin >> A >> B >> K;
  int cnt = 0, n = 0;
  int min;
  if(A<B) n=A+1;
  else n=B+1;
  while(cnt<K){
    n--;
    if(A%n==0 && B%n==0){
      cnt++;
    }
  }
  cout << n << endl;
  return 0;
} 

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int n = sc.nextInt();
		int k = sc.nextInt();

		double ans = 0;
		double n2 = n;
		double value = 1;

		for(double i=n;i>0;){
			if(i*value<k){
				value *= 2;
			} else {
				ans += 1.0/(n*value);
				i--;
			}
		}

		// 出力
		System.out.println(ans);
	}
}

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

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1


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


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


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


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


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


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


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


def mt(f):
    import time

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

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

    return wrap


@mt
def slv(N, M, A):
    ans = INF
    s = set(range(1, M+1))
    for _ in range(M):
        c = Counter()
        for a in A:
            for b in a:
                if b in s:
                    c[b] += 1
                    break
        k, v = c.most_common()[0]
        
        ans = min(ans, v)
        s.remove(k)
    return ans


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


if __name__ == '__main__':
    main()


Measured memory_bytes: 65496
N, Q = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N - 1)]
PX = [list(map(int, input().split())) for _ in range(Q)]

graph = [[] for _ in range(N + 1)]
for A, B in AB:
  graph[A].append(B)
  graph[B].append(A)
graph = tuple(graph)
#print("graph:", graph)
  
X = [0] * (N + 1)
for p, x in PX:
  X[p] += x
#print("X:", X)

stack = [1]
check = [0] * (N + 1)
check[1] = 1
cnt = [0] * (N + 1)
cnt[1] = X[1]

while stack:
  s = stack.pop()
  for g in graph[s]:
    if check[g] == 0:
      check[g] = 1
      cnt[g] = cnt[s] + X[g]
      stack.append(g)
print(*cnt[1::])

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int N,K;
int A[202020];
int B[202020];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>K;
	ll sum=0;
	FOR(i,N) {
		cin>>A[i+1];
		sum+=A[i+1];
	}
	K=min(K,100);
	
	
	FOR(i,K) {
		ZERO(B);
		for(j=1;j<=N;j++) {
			B[max(0,j-A[j])]++;
			B[min(N+1,j+A[j]+1)]--;
		}
		
		int cur=0;
		FOR(j,N+1) {
			cur+=B[j];
			A[j]=cur;
		}
	}
	FOR(j,N+1) if(j) cout<<A[j]<<" ";
	cout<<endl;
	
	
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 5236
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007

int ctoi(char c) {
    // 'a' == 97, 'z' == 122
    // int a = 'a', z = 'z';
    if ('a' <= c && c <= 'z') {
        return (int)c;
    }
    return -1;
}


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

    // input
    string S;
    cin >> S;
    size_t len = S.length();
    int vec[26] = {};
    
    // output
    int idx_char;
    REP(i, len) {
        idx_char = ctoi(S[i]) - 97;
        vec[idx_char]++;
    }
    
    REP(i, 26) {
        if (vec[i] == 0) {
            cout << (char)(i+97) << '\n';
            return 0;
        }
    }
    
    cout << "None" << "\n";
    
    return 0;
}


Measured memory_bytes: 512
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        x: u32,
        p: u32,
    }
    let p = p as f64 / 100.0;
    let ans = if x % 2 == 0 {
        let x = (x / 2) as f64;
        x / p
    } else {
        let x = (x / 2) as f64;
        1.0 + p * (x / p) + (1.0 - p) * ((x + 1.0) / p)
    };
    println!("{:.10}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include<stack>
#include<functional>
#include<queue>
#include<regex>
#include<time.h>

using namespace std;


#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

#define Tof(x) (x) ? Yes : No
#define TOF(x) (x) ? YES : NO
#define tof(x) (x) ? yes : no

using ll = long long;

constexpr ll MOD = 1000000007;
constexpr ll INF = 1050000000;


/*vectorの要素を全部確認するやつだよ。普通に拡張for文したほうがいいよ。

for (vector<int>::iterator itr = ans.begin(); itr != ans.end(); ++itr) {
	cout << *itr << " ";
}

*/


/*for文でx,yを上下左右確認するやつだよ。正直使いづらいよ。

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


for (int i = 0; i < 4; i++) {
	int ny = y + dy[i];
	int nx = x + dx[i];
}

*/


/*繰り返し二乗法だよ。modもとってくれるよ。n^kをmodで割った余りでやってくれるよ。

ll POW_MOD(ll n, ll k, ll mod) {
	ll r = 1;

	for (; k > 0; k >>= 1) {
		if (k & 1) {
			r = (r * n) % mod;
		}
		n = (n * n) % mod;
	}
	return r;
}

*/


/*実行開始からの経過時間を表すよ。

while (clock() < 1900000) {  }

*/


/*まだ使えないテクニックのメモだよ。

for (int bit = 0; bit < (1<<n); ++bit)//bit全探索用のfor文だよ

*/


/*2重for文書くのめんどくなった時用だよ。

for (int i = 0; i < h; ++i) {
	for (int j = 0; j < w; ++j) {

	}
}

*/

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

	if (x < a) {
		cout << 0 << endl;
	}
	else {
		cout << 10 << endl;
	}

	return 0;
}


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

int main() {
  double a,ans;
  int b;
  cin >> a;
  b = a;
  if(b%2 == 0) ans = (a/2)/a;
  else ans = ((a+1)/2)/a;
  cout << fixed;
  cout << setprecision(8) << ans << endl;;
}


Measured memory_bytes: 256
mod=1000000007
n,m=map(int,input().split())
d=set([])
w=[0]*(n+2)

for i in range(m):
    a=int(input())
    d.add(a)
for i in range(n):
    if i==0 and 1 not in d:
        w[1]=1
    elif i==0 and 1 in d:
        w[1]=0
    if i==0 and 2 not in d:
        w[2]=1
    elif i==0 and 2 in d:
        w[2]=0
    if i>0:
        if i+1 not in d:
            w[i+1]=(w[i+1]+w[i])%mod
        if i+2 not in d:
            w[i+2]=w[i]
print(w[-2]%mod)


Measured memory_bytes: 51160
#include <bits/stdc++.h>
using namespace std;
bool good(int x){
  if(x == 1) return true;
	for(int i = 2; i < x; i++){
      if(x%i == 0){
        int cx = x;
        while(cx%i == 0 && cx != 1) cx /= i;
		if(cx == 1) return true;
      }
    }
  return false;
}
int main(){
  int n; cin >> n;
  while(!good(n)) n--;
  cout << n << endl;
  return 0;
}
  


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
  
int main(void)
{
    double s[1000],t1,t2;
    int n,i;
    while(1){
        scanf("%d",&n);
        if(n==0)break;
        t1=0;
        for(i=0;i<n;i++){
            scanf("%lf",&s[i]);
            t1+=s[i];
        }
        t1/=n;
        t2=0;
        for(i=0;i<n;i++)t2+=pow(s[i]-t1,2);
        printf("%.5f\n",sqrt(t2/n));
    }
    return 0;
}


Measured memory_bytes: 2088
//Author rahuliitkgp
/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define ff              first
#define ss              second
#define SZ(x)           ((int)(x).size())
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//#endif
}

int main() {
    cpp();
    ll k, a, b;
    cin>>k>>a>>b;
    ll x = (a+k-1)/k;
    ll y = (b/k);
    if(y>=x){
        cout<<"OK"<<endl;
    }
    else{
        cout<<"NG"<<endl;
    }
    return 0;
}



Measured memory_bytes: 3668
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
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;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
vector<ll> pw3(15,1);vector<ll> pw10(19,1);


int main(){
    {rep1(i,14) pw3[i]=3*pw3[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    ll N; cin>>N;
    map<ll,ll,greater<ll> > m;
    rep(i,N){
        ll x; cin>>x;
        m[x]++;
    }
    ll ans=1,now=0;
    for(auto x:m){
        while(1){
            if(x.b>=2){
                ans*=x.a;
                now++;
                if(now==2){
                    cout<<ans<<endl;
                    return 0;
                }
                x.b-=2;
            }
            else break;
        }
    }
    cout<<0<<endl;
}


Measured memory_bytes: 9836
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

signed main(){
  int N;cin>>N;
  if(N%2==1){
    print(0);
    re 0;
  }
  else{
    int ans=0,itr=10;
    while(itr<=N){
      ans+=N/itr;
      itr*=5;
    }
    print(ans);
    
  }

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define lc (x<<1)
#define rc (x<<1|1)
#define gc getchar()//(p1==p2&&(p2=(p1=buf)+fread(buf,1,size,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define IT iterator
#define vi vector<int>
#define TP template<class o>
#define SZ(a) ((int)a.size())
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N=2e5+10,size=1<<20,mod=(int)1e9+7,inf=2e9;

//char buf[size],*p1=buf,*p2=buf;
template<class o> void qr(o &x) {
    char c=gc; x=0; int f=1;
    while(!isdigit(c)){if(c=='-')f=-1; c=gc;}
    while(isdigit(c)) x=x*10+c-'0',c=gc;
    x*=f;
}
template<class o> void qw(o x) {
    if(x/10) qw(x/10);
    putchar(x%10+'0');
}
template<class o> void pr1(o x) {
    if(x<0)x=-x,putchar('-');
    qw(x); putchar(' ');
}
template<class o> void pr2(o x) {
    if(x<0)x=-x,putchar('-');
    qw(x); putchar('\n');
}

int n;
ll ans;

ll power(ll a,ll b=mod-2) {
	ll c=1;
	while(b) {
		if(b&1) c=c*a%mod;
		b /= 2; a=a*a%mod;
	}
	return c;
}

void ad(ll &x,ll y) {x=(x+y)%mod;}

struct rec {
	int x,y;
	bool operator <(rec b) const {return x<b.x;}
} a[N];

struct BIT {
	ll c[N];
	BIT() {memset(c,-63,sizeof c);}
	void add(int x,ll y) {for( ;x<=n;x+=x&-x) c[x]=max(c[x],y);}
	ll ask(int x) {ll y=c[0]; for( ;x;x-=x&-x) y=max(y,c[x]);return y; }
} u,v;

int y[N];
int find(int x) {return lower_bound(y+1,y+n+1,x)-y;}

int main() {
	qr(n);
	for(int i=1;i<=n;i++) {
		qr(a[i].x); qr(a[i].y);
		y[i]=a[i].y;
	}
	sort(y+1,y+n+1); 
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++) {
		int x=a[i].x,y=a[i].y,id=find(y);
		ans=max(ans,u.ask(id)+y+x);
		ans=max(ans,v.ask(n-id+1)-y+x);
		u.add(id,-x-y);
		v.add(n-id+1,-x+y);
	}
	pr2(ans);
	return 0;
}


Measured memory_bytes: 9108
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int MOD = (int)1e9 + 7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int add(int &a, int b) { return (a += b) >= MOD ? a -= MOD : a; }

int main() {
    int H, W; cin >> H >> W;
    vector<string> a(H);
    for (int i = 0; i < H; i++) cin >> a[i];

    vector<vector<int>> dp(H, vector<int>(W, 0));
    dp[0][0] = 1;
    for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) {
        if (a[i][j] == '.') {
            if (i - 1 >= 0) add(dp[i][j], dp[i - 1][j]);
            if (j - 1 >= 0) add(dp[i][j], dp[i][j - 1]);
        }
    }
    cout << dp[H - 1][W - 1] << endl;
    return 0;
}

Measured memory_bytes: 5248
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<long double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

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

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }
#define INF 1LL<<60

struct enemy {
    ll x;
    ll h;

    bool operator<(const enemy& other) const {
        if (x < other.x) return true;
        else return false;
    }
};

bool cmp(const enemy & a, const enemy & b) {
    return a.x < b.x; 
}

int main() {
    int N;
    ll D, A;
    cin >> N >> D >> A;
    vector<enemy> E(N);
    map<ll, int> cord_idx;
    REP(i, N) {
        cin >> E[i].x >> E[i].h;
        cord_idx[E[i].x] = i;
    }

    sort(ALL(E));

    vector<int> correspond_right_side(N, -1);
    REP(i, N) {
        enemy tmp = {E[i].x+2*D, 0};
        auto itr = upper_bound(E.begin(), E.end(), tmp, cmp);
        if(itr != E.end())
            correspond_right_side[i] = int(itr - E.begin());
        cerr << "i=" << i << " right_side=" << correspond_right_side[i]<< endl;
    }

    ll ans = 0;
    int head = 0;
    vector<ll> damages(N+1);
    while(head < N) {
        // cerr << "head = " << head << " E[" << head << "].h = " << E[head].h << " damages[" << head << "] = " << damages[head] << endl;
        if(head>0 && E[head].h <= damages[head]) {
            cerr << head << " has already been treated." << endl;
            // if(head+1<N && E[head+1].x <= E[head].x + 2*D)
            damages[head+1] += damages[head];
            head++;
            continue;
        }
        ll num = ceil(double(E[head].h - damages[head]) / double(A));
        // cerr << "num = " << num << " E[head].h = " << E[head].h << endl;
        damages[head] += A * num;


        if(head+1<N && correspond_right_side[head]!=-1) {
            // cerr << "decrese" << endl;
            damages[correspond_right_side[head]] -= A*num;
        }

        // if(head+1<N && E[head+1].x <= E[head].x + 2*D)
        //     damages[head+1] += A * num;
        ans += num;

        head++;
        damages[head] += damages[head-1];
    }

    // REP(i, N) {
    //     cerr << "damages[" << i << "] = " << damages[i] << endl;
    // }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 18176