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

int cnt;
int l,n;
int A[1000000];
vector<int> G;

void insertionSort(int A[],int n,int g){
	for(int i=g;i<n;i++){
		int v=A[i];
		int j=i-g;
	while(j>=0 && A[j]>v){
		A[j+g]=A[j];
		j-=g;
		cnt++;
	}
	A[j+g]=v;
	}
}

void shellSort(int A[],int n){
	for(int h=1; ; ){
		if(h>n)break;
		G.push_back(h);
		h=h*3+1;
	}
	
	for(int i=G.size()-1;i>=0;i--){
		insertionSort(A,n,G[i]);
	}
}

int main(){
	cin>>n;
	for(int i=0;i<n;i++) cin>>A[i];
	cnt=0;
	
	shellSort(A,n);
	cout<<endl;
	
	cout << G.size() <<endl;
	for(int i=G.size()-1;i>=0;i--){
		cout<<G[i];
		if(i) cout<<" ";
	}
	cout<<endl;
	cout<<cnt<<endl;
	for(int i=0;i<n;i++) cout<<A[i]<<endl;
	
	return 0;
}

 


Measured memory_bytes: 7048
local mfl, mce, mmi = math.floor, math.ceil, math.min
local SegTree = {}
SegTree.updateAll = function(self)
  for i = self.stagenum - 1, 1, -1 do
    for j = 1, self.cnt[i] do
      self.stage[i][j] = self.func(self.stage[i + 1][j * 2 - 1], self.stage[i + 1][j * 2])
    end
  end
end
SegTree.create = function(self, n, func, emptyvalue)
  self.func, self.emptyvalue = func, emptyvalue
  local stagenum, mul = 1, 1
  self.cnt, self.stage, self.size = {1}, {{}}, {}
  while mul < n do
    mul, stagenum = mul * 2, stagenum + 1
    self.cnt[stagenum], self.stage[stagenum] = mul, {}
  end
  for i = 1, stagenum do self.size[i] = self.cnt[stagenum + 1 - i] end
  self.stagenum = stagenum
  for i = 1, mul do self.stage[stagenum][i] = emptyvalue end
  self:updateAll()
end
SegTree.getRange = function(self, left, right)
  if left == right then return self.stage[self.stagenum][left] end
  local start_stage = 1
  while right - left + 1 < self.size[start_stage] do
    start_stage = start_stage + 1
  end
  local ret = self.emptyvalue
  local t1, t2, t3 = {start_stage}, {left}, {right}
  while 0 < #t1 do
    local stage, l, r = t1[#t1], t2[#t1], t3[#t1]
    table.remove(t1) table.remove(t2) table.remove(t3)
    local sz = self.size[stage]
    if (l - 1) % sz ~= 0 then
      local newr = mmi(r, mce((l - 1) / sz) * sz)
      table.insert(t1, stage + 1) table.insert(t2, l) table.insert(t3, newr)
      l = newr + 1
    end
    if sz <= r + 1 - l then
      ret = self.func(ret, self.stage[stage][mce(l / sz)])
      l = l + sz
    end
    if l <= r then
      table.insert(t1, stage + 1) table.insert(t2, l) table.insert(t3, r)
    end
  end
  return ret
end
SegTree.inc = function(self, idx)
  self.stage[self.stagenum][idx] = self.stage[self.stagenum][idx] + 1
  for i = self.stagenum - 1, 1, -1 do
    local dst = mce(idx / 2)
    local rem = dst * 4 - 1 - idx
    self.stage[i][dst] = self.func(self.stage[i + 1][idx], self.stage[i + 1][rem])
    idx = dst
  end
end
SegTree.new = function(n, func, emptyvalue)
  local obj = {}
  setmetatable(obj, {__index = SegTree})
  obj:create(n, func, emptyvalue)
  return obj
end

local n, m, q = io.read("*n", "*n", "*n")
local t = {}
for i = 1, m do
  local l, r = io.read("*n", "*n")
  t[i] = {l, r}
end
table.sort(t, function(x, y) return x[2] < y[2] end)
local st = SegTree.new(t[m][2], function(x, y) return x + y end, 0)
t[m + 1] = {1000000007, 1000000007}
local tq = {}
for i = 1, q do
  local ql, qr = io.read("*n", "*n")
  tq[i] = {i, ql, qr}
end
table.sort(tq, function(x, y) return x[3] < y[3] end)

local cpos = 1
for i = 1, q do
  local l, r = tq[i][2], tq[i][3]
  while t[cpos][2] <= r do
    st:inc(t[cpos][1])
    cpos = cpos + 1
  end
  tq[i][4] = st:getRange(l, r)
end

table.sort(tq, function(x, y) return x[1] < y[1] end)
for i = 1, q do
  print(tq[i][4])
end


Measured memory_bytes: 41844
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric> // accumulate(v.begin(), v.end(), 0)

using namespace std;
#define ll long long

int main(){
  int T, X;
  cin >> T >> X;
  cout << showpoint << setprecision(10) << (double)T / X << endl;
  return 0;
}

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

ans = 'APPROVED'
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            ans = 'DENIED'

print(ans)

Measured memory_bytes: 3064
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni();
        HashSet<String> set = new HashSet<>();
        for (int i = 0; i < n; i++) {
            set.add(in.ns());
        }
        out.println((set.size()==3)?"Three":"Four");
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 22996
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
using namespace std;
typedef long long ll;

ll ds(ll digit) {
	ll res = 0;
	while (digit != 0) {
		res += digit % 10;
		digit /= 10;
	}
	return res;
}
ll MOD = 1000000007;
int main() {
	ll N, K;
	cin >> N >> K;
	ll cnt[2000010];
		for (ll i = 0; i < N; ++i) {
			ll a;
			cin >> a;
			cnt[a - 1]++;
		}
	sort(cnt, cnt + N);
	ll ans = 0;
	for (ll i = 0; i < N - K; i++) {
		ans +=cnt[i];
	}
	cout << ans << endl;
}

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

int main(){
    int n,m;
    cin >> n >> m;
    vector<pair<int,int>> card(m);
    for(int i=0; i<m; i++){
        int l,r;
        cin >> l >> r;
        card[i]=make_pair(l,r);
    }
    int mxl=0,mnr=1e9;
    for(int i=0; i<m; i++){
        if(card[i].first>mxl)mxl=card[i].first;
        if(card[i].second<mnr)mnr=card[i].second;
    }
    mnr=min(mnr,n);
    int ans=mnr-mxl+1;
    //cout << mnr << " " << mxl << endl; 
    if(ans<0)ans=0;
    cout << ans << endl;

}

Measured memory_bytes: 1024
#include<stdio.h>
#define N 100
#define TIME_O 0
#define TIME_I 1
#define TIME_II 2

void search(void);
void visit(int);

int t,n;
int G[N+2][N+2],time[N+2],d[N+1],f[N+1];

int main(){
  int k,u,v,i,j;

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    for(i=1;i<=n;i++){
      G[i][j]=0;
    }
  }

  for(i=1;i<=n;i++){
    scanf("%d %d",&u,&k);
    for(j=1;j<=k;j++){
      scanf("%d",&v);
      G[u][v]=1;
    }
  }

  search();

  return 0;
  
}

void search(){

  int i;
  for(i=1;i<=n;i++){
    time[i]=TIME_O;
  }
  t=0;

  for(i=1;i<=n;i++){
    if(time[i]==TIME_O) visit(i);
  }
  
  for(i=1;i<=n;i++){
    printf("%d %d %d\n",i,d[i],f[i]);
  }
  
}

void visit(int u){
  int v;
  time[u]=TIME_I;
  d[u]=++t;
  for(v=1;v<=n;v++){
    if(G[u][v]==0)continue;
    if(time[v]==TIME_O){
      visit(v);
    }
  }

  time[u]=TIME_II;
  f[u]=++t;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n = 0;
    int max;
    int min;
    cin >> n;
    
    vector<int> sun(n);
    
    cin >> sun.at(0)>>sun.at (1);

    if(sun.at(0)>=sun.at(1)){
        max = sun.at(0);
        min = sun.at(1);
    }
    else{
        max = sun.at(1);
        min = sun.at(0);
    }
    if(n==2);
    else{
        for(int i = 2; i < n; i++){
         cin >> sun.at(i);
         if(sun.at(i) <= min) min = sun.at(i);
         if(max <= sun.at(i)) max = sun.at(i);
        }
    }
        cout << max - min <<endl;
        return 0;
}

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

    long long ans=1000000000;
    sort(x.begin(),x.end());

    for(int i=x[0];i<=x[n-1];i++){
        long long tmp=0;
        for(int j=0;j<n;j++){
            tmp+=pow(x[j]-i,2);
        }
        ans=min(ans,tmp);
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if(a==b&&b==c){
      System.out.println(1);
    }else if(a==b||b==c||c==a){
      System.out.println(2);
    }else{
      System.out.println(3);
    }
  }
}

Measured memory_bytes: 22100
#include<bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define mod 1000000007
#define inf (1ll<<60)
#define eps 1e-9
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
using namespace std;

int main() {
    
    
    fast();
    int t;
    cin>>t;
    string k;
    set<string> s;
    while(t--){
        cin>>k;
        s.insert(k);
    }
    cout<<s.size();
    
    //cout<<a/d<<" "<<c/b<<endl;
    
   // cout<<x<<" "<<y<<endl;
    
    
    
	return 0;
}


Measured memory_bytes: 19232
#include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<math.h>
#include<set>
#include<iomanip>
#include<stdio.h>
#include<deque>
#include<stack>
#include<map>
#include<queue>
#include<cstring>
#include<unordered_map>
#define M 1000000007
#define pb push_back
#define mp make_pair
#define int long long
using namespace std;
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int a,b;
	cin>>a>>b;
	int s=1,o=0;
	while(s<b)
	{
		s+=a-1;
		o++;
	}
	cout<<o<<endl;
}

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

price=[0]*M
keys=[0]*M
for i in range(M):
  a,b=map(int,input().split())
  price[i]=a
  c=list(map(int,input().split()))
  k=0
  for j in range(len(c)):
    k|=1<<(c[j]-1)
  keys[i]=k
  
INF=((10**5)*12+1)
dp=[INF]*(2**N)
dp[0]=0
for i in range(len(keys)):
  for j in range(len(dp)-1,-1,-1):
    if dp[j]!=INF:
      dp[j|keys[i]]=min(dp[j|keys[i]],dp[j]+price[i])

if dp[-1]==INF:
  print(-1)
else:
  print(dp[-1])


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

int main(){
    int A,B,K;
    cin>>A>>B>>K;
    int ans=0,s=0;
    for(int i=min(A,B);i>0;i--){
        if(A%i==0&&B%i==0){
            s++;
            if(s==K){
                ans=i;
                break;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf=0x3f3f3f3f;
const ll maxh=5e4+10;
const ll maxn=1010;
ll a[maxn],b[maxn];
ll dp[maxh];
int main()
{
    ios::sync_with_stdio(false);
    ll h,n;
    while(cin>>h>>n)
    {
        for(ll i=0;i<n;i++)
            cin>>a[i]>>b[i];
        memset(dp,0x3f,sizeof(dp));
        dp[0]=0;
        for(ll i=0;i<n;i++)
            for(ll j=0;j<=h;j++)
        {
            dp[j+a[i]]=min(dp[j+a[i]],dp[j]+b[i]);
        }
        ll minn=inf;
        for(ll i=h;i<maxh;i++)
        {
            minn=min(minn,dp[i]);
        }
        cout<<minn<<endl;
    }
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;

int main(){
    int n,k;cin>>n>>k;int ans=k;
    for(int i=1;i<n;i++) ans*=k-1;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;

int main(){
  int N,K;
  cin>>N>>K;
  if(!(0<=K && K<=(N-2)*(N-1)/2)){
    cout<<-1<<endl;
    return 0;
  }
  
  
  vector<P>ans;
  //ウニの構築
  for(int i=2;i<=N;i++){
    ans.push_back(P(1,i));
  }
  //ちょうどK個になるよう減らす
  vector<P>ve;
  for(int i=2;i<=N;i++){
    for(int j=i+1;j<=N;j++){
      ve.push_back(make_pair(i,j));
    }
  }
  for(int i=0;i<(N-2)*(N-1)/2-K;i++){
    ans.push_back(ve[i]);
  }
  
  cout<<ans.size()<<endl;
  for(int i=0;i<ans.size();i++){
    cout<<ans[i].first<<" "<<ans[i].second<<endl;
  } 
  return 0;
}




Measured memory_bytes: 3728
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P;
map<int, int> dp;
#define REP(i, n) for (int i = 0; i < n; i++)

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll A, B, C, K;
  cin >> A >> B >> C >> K;
  ll ans;
  if (K > (A + B)) {
    ans = A - (K - (A + B));
  } else if (A > K) {
    ans = K;
  } else {
    ans = A;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3692
import math
n = input()
for i in range(n):
    p = map(float, raw_input().split())
    x1, y1, x2, y2, x3, y3 = p[0], p[1], p[2], p[3], p[4], p[5]
    
    px = ((y1- y3) * (y1**2 - y2**2 + x1**2 - x2**2) - (y1 - y2) * (y1**2 - y3**2 + x1**2 - x3**2)) / (2 * (y1 - y3) * (x1 - x2) - 2 * (y1 - y2) * (x1 - x3))
    py = ((x1- x3) * (x1**2 - x2**2 + y1**2 - y2**2) - (x1 - x2) * (x1**2 - x3**2 + y1**2 - y3**2)) / (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 - y3))
    r = math.sqrt((x1 - px)**2 + (y1 - py)**2)
    print("%.3f %.3f %.3f" % (px, py, r))

Measured memory_bytes: 4428
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

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

  const double PI = 3.14159265359;

  double hangle = PI * (60 * h + m) / 360;
  double mangle = PI * m / 30;

  double hx = cos(hangle) * a, hy = sin(hangle) * a;
  double mx = cos(mangle) * b, my = sin(mangle) * b;

  double dx = hx - mx, dy = hy - my;
  double dist = sqrt(dx * dx + dy * dy);
  cout << fixed << setprecision(10) << dist << endl;

  return 0;
}

Measured memory_bytes: 4100
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int i = 0;
		while (true) {

			i = i + 1;
			int x = scan.nextInt();
			if (x == 0) {
				break;
			} else {
				System.out.println("Case " + i + ": " + x);
			}
		}
	}
}

Measured memory_bytes: 41188
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    K, S = il()

    ret = 0
    for x in range(K + 1):
        for y in range(K + 1):
            z = S - x - y
            if z < 0: continue
            if z <= K: ret += 1
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10192
h,n,*L=map(int,open(0).read().split())
dp=[float('inf')]*(h+10100)
dp[0]=0
for a,b in zip(*[iter(L)]*2):
    for i in range(h):
        t=dp[i]+b
        if t<dp[i+a]:
            dp[i+a]=dp[i]+b
print(min(dp[h:]))

Measured memory_bytes: 43868
import math
while True:
    a,b,c=input().split()
    if b=="+":
        print("{}".format(int(float(a))+int(float((c)))))
    elif b=="*":
        print("{}".format(int(a)*int(c)))
    elif b=="-":
        print(int(a)-int(c))
    elif b=="/":
        print(math.floor(int(a)/int(c)))
    elif b=="?":
        break


Measured memory_bytes: 5672
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define VVVI vector<vector<vector<ll>>>
#define VVVVI vector<vector<vector<vector<ll>>>>
#define REP(i,n) for(ll i=0,_n=(n);(i)<(ll)_n;++i)
#define REPR(i,n) for(ll i=(ll)(n)-1;0<=(i);--i)
#define RANGE(i,a,b) for(ll i=(ll)a,_b=(ll)(b);(i)<_b;++i)
#define RANGER(i,a,b) for(ll i=(ll)(b)-1,_a=(ll)(a);(_a)<=i;--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
#define FI first
#define SE second
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template<typename T>void maxUpdate(T& a, T b) {a = max(a, b);}
template<typename T>void minUpdate(T& a, T b) {a = min(a, b);}

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N;
	while(cin>>N) {
		ll ans = INF;
		RANGE(i, 1, sqrt(N)+10) {
			if(N%i==0) {
				minUpdate(ans, i+N/i-2);
			}
		}
		
		cout<<ans<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
public class Main {
	
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		sc=new Scanner(System.in);
		out=new PrintWriter(System.out);
		
		int n=sc.nextInt();
		long x=sc.nextLong();
		int ans=0;
		for(int i=0;i<n;i++) {
			long a=sc.nextLong();
			long b=sc.nextLong();
			if(a*a+b*b<=x*x)
				ans++;
		}
		out.println(ans);
		
		sc.close();
		out.close();
		
	}
}


Measured memory_bytes: 59444
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <bitset>
#define pb push_back
#define mp make_pair
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<30)
#define LLINF (1<<60)
#define MOD 1000000007
#define rep(i, n) for(int i=0;i<n;i++)
using ll = long long;
using namespace std;

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

    int a, b, c;
    cin >> a >> b >> c;
    cout << a + b + c - max(a, max(b, c)) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<string>
using namespace std;

typedef long long LL; 

int getnum()
{
	int x = 0, f = 1;
	char ch = getchar();
	while (ch < '0' || ch > '9') {
		if (ch == '-') f = -1; ch = getchar();
	}
	while (ch >= '0' && ch <= '9') {
		x = x * 10 + ch - '0'; ch = getchar();
	}
	return x * f;
}

const int N = 200010;
int n;
int cnt = 0;
int head[N];
struct edge
{
	int v, nxt, w;
}vec[N << 1];
int minr, Size, root;
bool vis[N];
int size[N];
int W[N];
int F[N];
int m = 0;
struct way
{
	int u, v; LL w;
}E[N * 50];
LL val; int P;

void addedge(int u, int v, int w)
{
	vec[++cnt] = (edge){v, head[u], w}; head[u] = cnt;
}

void get_read()
{
	n = getnum();
	for (int i = 1; i <= n; ++i) W[i] = getnum();
	for (int i = 1; i <= n - 1; ++i) {
		int u = getnum(), v = getnum(), w = getnum();
		addedge(u, v, w); addedge(v, u, w);
	}
}

void getroot(int u, int fa)
{
	size[u] = 1; int ret = 0;
	for (int i = head[u]; i; i = vec[i].nxt) {
		int v = vec[i].v;
		if (v == fa || vis[v]) continue;
		getroot(v, u);
		size[u] += size[v];
		ret = max(ret, size[v]);
	}
	ret = max(ret, Size - size[u]);
	if (ret < minr) minr = ret, root = u;
}

void Find(int u, int fa, LL dep)
{
	if (dep + W[u] < val) val = dep + W[u], P = u;
	for (int i = head[u]; i; i = vec[i].nxt) {
		int v = vec[i].v;
		if (v == fa || vis[v]) continue;
		Find(v, u, dep + vec[i].w);
	}
}

void Link(int u, int fa, LL dep)
{
	E[++m] = (way){P, u, dep + W[u] + val};
	for (int i = head[u]; i; i = vec[i].nxt) {
		int v = vec[i].v;
		if (v == fa || vis[v]) continue;
		Link(v, u, dep + vec[i].w);
	}
}

void DFS(int u)
{
	vis[u] = true;
	val = 1e18; P = 0; Find(u, 0, 0); Link(u, 0, 0);
	for (int i = head[u]; i; i = vec[i].nxt) {
		int v = vec[i].v;
		if (vis[v]) continue;
		minr = Size = size[v]; root = v;
		getroot(v, u); DFS(root);
	}
}

bool operator < (way a, way b)
{
	return a.w < b.w;
}

int Get(int u)
{
	return F[u] == u ? u : F[u] = Get(F[u]);
}

void get_work()
{
	minr = Size = n; root = 1;
	getroot(1, 1); DFS(root);
	sort(E + 1, E + m + 1);
	for (int i = 1; i <= n; ++i) F[i] = i;
	LL sum = 0;
	for (int i = 1; i <= m; ++i) {
		int p = Get(E[i].u), q = Get(E[i].v);
		if (p != q) {
			F[p] = q; sum += E[i].w;
		}
	}
	printf("%lld", sum);
}

signed main()
{
//	freopen("1.in", "r", stdin);
	
	get_read();

	get_work();

	return 0;
}
/*
4
1 3 5 1
1 2 1
2 3 2
3 4 3
*/

Measured memory_bytes: 74624
n=int(input())
h=list(map(int,input().split()))
res=[-1]*n
res[0]=0
res[1]=abs(h[0]-h[1])
for i in range(2,n):
  res[i]=min(abs(h[i-1]-h[i])+res[i-1],abs(h[i-2]-h[i])+res[i-2])

print(res[-1])


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

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

    sort(a, a + N);  
    int value = 0;
    for (int i = 0; i < K; ++i) {
        value += a[i];
        }
    cout << value << endl;
}

Measured memory_bytes: 3572
import bisect

en2asc = lambda s: ord(s) - 97

S = input()
T = input()
if not set(S) >= set(T):
    print(-1)
    exit()

lst = [[] for _ in range(26)]
for i, s in enumerate(S):
    lst[en2asc(s)].append(i)

L = len(S)
cur = 0
for t in T:
    t = en2asc(t)
    b = bisect.bisect_left(lst[t], cur % L)
    if b == len(lst[t]):
        cur = (cur // L + 1) * L
        b = bisect.bisect_left(lst[t], cur % L)
    cur = cur // L * L + lst[t][b] + 1
print(cur)

Measured memory_bytes: 13544
N,Q = map(int,input().split())
S = input()

AC = [0,0]
for i in range(2,N+1):
  if S[i-2:i]=="AC":
    AC.append(AC[-1]+1)
  else:
    AC.append(AC[-1])
for i in range(Q):
  l,r = map(int,input().split())
  Ans = AC[r]-AC[l]
  print(Ans)

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int m = (n+1)/2;
  vector<int> v(m);
  rep(i,n) {
    if((n&1)==(a[i]&1)){
      cout << 0 << endl;
      return 0;
    }
    int j = a[i]/2;
    if (j>=m || v[j] == 2){
      cout << 0 << endl;
      return 0;
    }
    v[j]++;
  }
  if((n&1) && v[0]>1){
    cout << 0 << endl;
    return 0;
  }

  int M =  1000000007;
  int ans = 1;
  rep(i,n/2) ans = ans*2%M;
  cout << ans << endl;

}

Measured memory_bytes: 3748
def main():
    while True:
        s_num = int(input())
        
        if s_num == 0:
            return
        
        s_dat = input()
        s_dat = s_dat.split(" ")
        
        for j in range(len(s_dat)):
            s_dat[j] = int(s_dat[j])
            
        s_dat.sort()

        answer = sa(s_dat)
        print(answer)

def sa(array):
    min_dist = 1000000 + 1
    
    for i in range(len(array) - 1):
        dist = array[i + 1] - array[i]
        
        if dist <= min_dist:
            min_dist = dist

    return min_dist
    
main()



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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define D()
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 10000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

int main(void) {
     int N,K,d;
     int A;
     
    cin >> N >> K;
int B[N];
     for(int i=0;i<N;++i){
         B[i] = 0;
     }
for(int i=0;i<K;++i){
    cin >> d;
   for(int j = 0; j <d; ++j){
        cin >> A;
        B[A-1] = 1;
    }
} 
int g = 0;
for(int i=0;i<N;++i){
    //printf("%d ", B[i]);
    if(B[i] == 0){
         g = g + 1;
    }
}

printf("%d\n",g);
  return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
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;
}

const ll INF = 1e17;
ll N, M, L, Q;
ll fuel[305][305];
ll dist[305][305];
ll s[105000], t[105000];
ll A[100000], B[100000], C[100000];

void input() {
    cin >> N >> M >> L;
    for(int i = 1; i <= M; i++) cin >> A[i] >> B[i] >> C[i];
    cin >> Q;
    for(int i = 1; i <= Q; i++) cin >> s[i] >> t[i];
}

void solve() {
    input();
    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= N; j++) {
            fuel[i][j] = INF;
            dist[i][j] = INF;
        }
        fuel[i][i] = 0;
        dist[i][i] = 0;
    }
    for(int i = 1; i <= M; i++) {
        chmin(fuel[A[i]][B[i]], C[i]);
        chmin(fuel[B[i]][A[i]], C[i]);
    }
    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= N; j++) {
            for(int k = 1; k <= N; k++) {
                chmin(fuel[j][k], fuel[j][i] + fuel[i][k]);
            }
        }
    }
    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= N; j++) {
            if(i == j) continue;
            if(fuel[i][j] <= L) chmin(dist[i][j], 1LL);
        }
    }
    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= N; j++) {
            for(int k = 1; k <= N; k++) {
                chmin(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
    for(int i = 1; i <= Q; i++) {
        if(dist[s[i]][t[i]] < INF) cout << dist[t[i]][s[i]] - 1 << "\n";
        else cout << -1 << "\n";
    }
    return;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef struct pair<int,int> P;
typedef long long ll;
bool k[100001]={};
ll x[100001];
ll y[100001];
int main() {
	int a,b;
	cin>>a>>b;

	cout<<(a+b)%24<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
#include <string>
#include <cmath>  //sqrt 
#include <iomanip> //setprecision
using namespace std;

int main(){
    cout << fixed << setprecision(6);
    int a; cin >> a;
    string s; cin >> s;
    int n = s.size();
    for (int i = 0; i <n; i++)
    {
        for (int j = 0; j < a; j++)
        {
            if(s[i]=='Z') s[i]='A';
            else s[i] += 1;
        }
        
    }
    cout << s << endl;
    
    return 0;
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    string s;
    cin>>s;
    int n=s.size();
    ll cnt=0,ans=0;
    rep(i,n-1){
        if(s[i]=='A')cnt++;
        else if(s[i]=='B'&&s[i+1]=='C'){ans+=cnt; i++;}
        else cnt=0;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
int main() {
	long N, K;
	cin >> N >> K;
	long ans = N % K;
	ans = min(ans, K - ans);
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void solve()
{
    int64_t X, Y;
	std::cin >> X >> Y;

	bool exist = false;
	for (int64_t i = 0; i <= 100; i++)
	{
		for (int64_t j = 0; j <= 100; j++)
		{
			if (i + j == X && 2 * i + 4 * j == Y)
			{
				exist = true;
			}
		}
	}

	std::string ans = exist ? "Yes": "No";
	std::cout << ans << std::endl;
}

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


Measured memory_bytes: 3580
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <queue>
#include <sstream>

using namespace std;

typedef long long ll;

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

vector<ll> memo(999999,-1);
map<ll,ll> a;

const ll mod=1e9+7;

ll dp(ll n){
    if(n==0) return 1;
    else if(a[n]==1) return 0;
    if(memo[n]!=-1) return memo[n];
    return memo[n]=(dp(n-1)+dp(n-2))%mod;
}

int main(){
    int N,M;
    cin>>N>>M;
    rep(i,M){
        int A;
        cin>>A;
        a[A]=1;
    }
    memo[0]=1;
    if(a[0]==1)memo[1]=0;
    else memo[1]=1;
    cout<<dp(N)<<endl;
    return 0;
}

Measured memory_bytes: 18944
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define f first
#define s second

using namespace std;
typedef long long ll;

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

	int h,w,m;
	cin >> h >> w >> m;
	vector<int> r(h,0),c(w,0);
	vector<pair<int,int> > ls(m);
	for(int i=0;i<m;i++){
		int a,b;
		cin >> a >> b;
		a--,b--;
		r[a]++;
		c[b]++;
		ls[i] = {a,b};
	}
	set<pair<int,int> > st(all(ls));
	int sz1 = 0, sz2 = 0;
	for(int i=0;i<h;i++){
		sz1 = max(sz1,r[i]);
	}
	for(int i=0;i<w;i++){
		sz2 = max(sz2,c[i]);
	}
	set<int> ls1, ls2;
	for(int i=0;i<h;i++){
		if(r[i] == sz1){
			ls1.insert(i);
		}
	}
	for(int i=0;i<w;i++){
		if(c[i] == sz2){
			ls2.insert(i);
		}
	}
	int res = sz1+sz2-1;;
	for(int it1 : ls1){
		for(int it2 : ls2){
			if(!st.count({it1,it2})){
				res = sz1+sz2;
				break;
			}
		}
		if(res == sz1+sz2){
			break;
		}
	}
	cout << res << '\n';
	
	return 0;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> A(200010, 0);
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
  }
  
  for (int i = K+1; i <= N; i++) {
    if (A[i] > A[i-K]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  
}

Measured memory_bytes: 4048
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

int main()
{
    char b;
    cin >> b;
    if (b == 'A')
    {
        cout << 'T' << endl;
    }
    else if (b == 'T')
    {
        cout << 'A' << endl;
    }
    else if (b == 'G')
    {
        cout << 'C' << endl;
    }
    else
    {
        cout << 'G' << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
map<ll,ll>dp;
ll mod=1e9+7;
ll f(ll x)
{
    if(x==0)return dp[0]=1;
    else if(x==1)return dp[1]=2;
    else if(dp[x])return dp[x];
    else
    {
    return dp[x]=(f(x/2)+f((x-1)/2)+f((x-2)/2))%mod;
    }
}
int main()
{

    ll x;
    cin>>x;
    cout<<f(x)<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
int a[maxn];
int main()
{
   double x,y,z,w;
     cin>>x>>y>>z>>w;
     printf("%.6f ",(double)(x*y)/2);
     if(z==x/2.0&&w==y/2.0)
        cout<<1<<endl;
     else
        cout<<0<<endl;


    return 0;
}


Measured memory_bytes: 384
n, m = map(int, input().split())
b = [0] * m
count = 0

for _ in range(n):
    a = list(map(int, input().split()))
    for i in range(1, a[0] + 1):
        b[a[i] - 1] += 1

for i in range(m):
    if b[i] == n:
        count += 1

print(count)


Measured memory_bytes: 3060
using System;
using System.Text;
using System.Collections.Generic;
class Solve{
    int N;
    long[] a;
    long L;
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Read();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        int c = -1;
        for(int i=0;i<N-1;i++){
            if(a[i]+a[i+1] >= L){
                c = i+1;
            }
        }
        if(c == -1){
            sb.Append("Impossible\n");
        }
        else{
            sb.Append("Possible\n");
            int i=1;
            while(i<c){
                sb.Append(i+"\n");
                i++;
            }
            i=N-1;
            while(i>c){
                sb.Append(i+"\n");
                i--;
            }
            sb.Append(c+"\n");
        }
    }
    void Read(){
        string[] str = Console.ReadLine().Split(' ');
        N = int.Parse(str[0]);
        L = Int64.Parse(str[1]);
        a = new long[N];
        str = Console.ReadLine().Split(' ');
        for(int i=0;i<N;i++){
            a[i] = int.Parse(str[i]);
        }
    }    
}

Measured memory_bytes: 19528
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);

int main()
{
	fastio;
	int n,k;
	long long s=0;
	cin>>n>>k;
	long long a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		s+=a[i];
	}
	sort(a,a+n);
	if(n<=k)
	{
		cout<<0<<"\n";
		return 0;
	}
	if(k==0)
	{
		cout<<s<<"\n";
		return 0;
	}
	for(int i=n-1;i>=0;i--)
	{
		s-=a[i];
		k--;
		if(k==0)
		{
			cout<<s<<"\n";
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#pragma GCC optimize ("-O3")
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL);
#define tolower(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define toupper(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define ll long long int
ll max(ll a, ll b) {  return a > b ? a : b; }
ll gcd(ll a, ll b) { if (a == 0) { return b; } return b == 0 ? a : gcd(b, a % b);}
#define case(i) cout<<"Case #"<<i<<": ";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr << '\n'; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) { cerr << "[ " << *it << " = " << a << " ]"; err(++it, args...);}
#define pii pair <ll , ll >
#define pb push_back
#define PRECISION 10
const ll inf = 9223372036854775800;
const int MAXN = 100001;
const int LOGN = 22;
const int MAXBIT = 62;
const long double PI = 3.141592653589793;
const int DIGITSIZE = 18;
ll mod = 1e9 + 7;
ll MOD = 998244353;
int x4[] = {1, -1, 0, 0};
int y4[] = {0, 0, 1, -1};
int x8[] = {1, 1, 1, -1, -1, -1, 0, 0};
int y8[] = {1, 0, -1, 1, 0, -1, 1, -1};
bool takeTestCases = 0;
bool printCaseNo = 0;

void getac(int T) {
	string s;
	cin >> s;
	int n = s.length();
	cout << s;
	if (s[n - 1] == 's') {
		cout << "es";
	} else {
		cout << 's';
	}
}
int  main()
{

	fastio;
	int t = 1;
	if (takeTestCases) { cin >> t; }
	int t_t = 1;
	while (t--) {
		if (printCaseNo)
		case (t_t);
		getac(t_t);
		t_t++;
	}
	cerr << "Total time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
	return 0;
}


Measured memory_bytes: 3836
using System;

namespace ABC133A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n,a,b;
            string[] input;

            input = Console.ReadLine().Split(' ');
            n = int.Parse(input[0]);
            a = int.Parse(input[1]);
            b = int.Parse(input[2]);

            int output;

            output = n*a < b ? n*a : b;
            
            Console.WriteLine(output);

        }
    }
}


Measured memory_bytes: 11092
package main

import (
	"fmt"
	"sort"
)

func pow2(n int) int {
	if n == 0 {
		return 1
	}
	return 2 * pow2(n-1)
}

func main() {
	abc := make([]int, 3)
	var k int
	fmt.Scan(&abc[0], &abc[1], &abc[2], &k)
	sort.Ints(abc)
	fmt.Println(abc[2]*pow2(k) + abc[1] + abc[0])
}

Measured memory_bytes: 512
import numpy as np

a, b, x = map(float, input().split())
ans = 0
if a*a*b > 2*x:
    ans =180.0/np.pi*np.arctan((a*b*b)/(2*x))
else:
    ans = 180.0/np.pi*np.arctan((2*(a*a*b-x))/a**3)

print(ans)



Measured memory_bytes: 12496
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint a, b, c;
    cin >> a >> b >> c;
    // cout << fixed << setprecision(10) << sqrt(a) + sqrt(b) << "\n";
    // cout << fixed << setprecision(10) << sqrt(c) << "\n";
    if (c - a - b < 1) {
        cout << "No"
             << "\n";
    } else {
        if (4LL * a * b < (c - a - b) * (c - a - b))
            cout << "Yes"
                 << "\n";
        else
            cout << "No"
                 << "\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    ll mmax = -1e12;
    ll pmin = 1e12;
    int mc = 0;
    int mpos = 0;
    int ppos = 0;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        if(a[i] <= 0) mc++;
        if(a[i] <= 0 && a[i] > mmax)
        {
            mmax = a[i];
            mpos = i;
        }
        if(a[i] > 0 && a[i] < pmin)
        {
            pmin = a[i];
            ppos = i;
        }
    }
    ll ans = 0;
    if(mc % 2 == 0)
    {
        for(int i = 0; i < n; i++)
        {
            ans += abs(a[i]);
        }
        cout << ans << endl;
        return 0;
    }
    else
    {
        if(abs(mmax) > abs(pmin))
        {
            for(int i = 0; i < n; i++)
            {
                if(i == ppos)
                {
                    ans -= a[i];
                }
                else
                {
                    ans += abs(a[i]);
                }
            }
            cout << ans << endl;
            return 0;
        }
        else
        {
            for(int i = 0; i < n; i++)
            {
                if(i == mpos)
                {
                    ans += a[i];
                }
                else
                {
                    ans += abs(a[i]);
                }
            }
            cout << ans << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>

int main(){
    int a, b, c;
    std::cin>>a>>b>>c;

    std::string ans;
    if(a <= c && c <= b){
        ans = "Yes";
    }else{
        ans = "No";
    }
    std::cout<<ans<<std::endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
typedef pair<int, int> p;
 
#define MOD 1000000007
 
int main() {
	cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    string S;
    cin >> N >> S;

    vector<map<int, vector<int> > > m(N);

    for(int i = 0; i < N; i++) {
        int a = S[i] - 'a';
        m[0][a].push_back(i);
    }

    int ans = 0;

    bool x = true;

    for(int i = 0; x; i++) {

        x = false;

        int count = 0;
        
        for(auto j = m[i].begin(); j != m[i].end(); j++) {

            if(j -> second.size() < 2) continue;

            x = true;
            
            int front = j -> second[0];

            for(int k = 1; k < j -> second.size(); k++) {

                int back = j -> second[k];
 
                if(front + i < back) {
                    ans = i + 1;
                }
            }

            for(int k = 0; k < j -> second.size(); k++) {
                int d = j -> second[k];
                if(N - 1 <= d) break;
                int a = S[d + 1] - 'a';
                m[i + 1][count * 26 + a].push_back(d + 1);
            }
            count++;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 345224
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x1, x2, x3, x4, y1, y2, y3, y4;
    cin >> x1 >> y1 >> x2 >> y2;
    x3 = x2 - (y2-y1);
    y3 = y2 + (x2-x1);
    x4 = x1 - (y2-y1);
    y4 = y1 + (x2-x1);
    printf("%d %d %d %d\n", x3, y3, x4, y4);
}


Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-label"

#define DEBUG 1
#define dd if (DEBUG)

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, A) for (auto & a : A)
#define all(a) (a).begin (), (a).end ()
#define rall(a) (a).rbegin (), (a).rend ()
#define sz(a) (int) (a).size ()
#define szl(a) (int) (a).length ()
#define FASTIO cin.sync_with_stdio (0); cin.tie (0); cin.exceptions (cin.failbit);

typedef long long ll;
typedef pair <int, int> pii;
#define f first
#define s second
#define mp(a, b) make_pair((a), (b))
typedef vector <int> vi;
typedef vector <vi> mi;
typedef vector <ll> vll;
typedef vector <vll> mll;
#define pb(a) push_back ((a))

const ll MOD = 1e+9+7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int INFi = 0x3f3f3f3f;
const ll MAXN = 1e+6+7;

double dist (double a, double b)
{
    return a*a + b*b;
}

int main ()
{
    FASTIO;
    int i, j, n;
    pair <double, double> m;
    cin >> n;
    vector <pair <double, double> > A (n);
    trav (a, A)
    {
        cin >> a.f >> a.s;
        m.f += a.f;
        m.s += a.s;
    }
    m.f /= n; m.s /= n;
    double P = 0.1, d, e;
	for (int i = 0; i < 30000; i++) {
		int f = 0;
		d = dist(m.f - A[0].f, m.s - A[0].s);
		for (int j = 1; j < n; j++) {
			e = dist(m.f - A[j].f, m.s - A[j].s);
			if (d < e) { d = e; f = j; }
		}
		m.f += (A[f].f - m.f)*P;
		m.s += (A[f].s - m.s)*P;
		P *= 0.999;
	}
    printf ("%.7lf\n", sqrt (d));

    return 0;
}




Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
using namespace std;
#define len(n) (int)n.length()
#define dump cout
#define pb push_back
#define ll long long

class CL
{
	public:
	CL* prev;
	ll key;
	CL* next;
};

CL* NIL;

void output(CL* li, ll n)
{
	for (ll i = 0; i < n; i++) {
		if (li[i].key == -1)
			break;
	    cout << li[i].key << " ";
	}
	cout << endl;
}

CL* Search(ll key)
{
	CL* cur = NIL->next;
	while((cur != NIL) && (cur->key != key))
	{
		cur = cur->next;
	}
	return cur;
}

int main()
{
	// ios::sync_with_stdio(false);
	
	ll n;
	scanf("%d",&n);

	// init
	NIL = new CL();
	NIL->next = NIL;
	NIL->prev = NIL;
	
	for (ll i = 0; i < n; i++) {
	    char opt[20];
		string op;
		ll key;
		scanf("%s %d", opt, &key);
		op = opt;
		if (op == "insert")
		{
					CL* elem = new CL();
			elem->next = NIL->next;
			elem->next->prev = elem;
			elem->prev = NIL;
			elem->key = key;
			NIL->next = elem;
				}
		else if (op == "delete")
		{
					CL* elem = Search(key);
			if (elem == NIL)
				continue;
			
			elem->prev->next = elem->next;
			elem->next->prev = elem->prev;
			delete elem;
		}
		else if (op == "deleteFirst")
		{
			CL* elem = NIL->next;
			elem->prev->next = elem->next;
			elem->next->prev = elem->prev;
			delete elem;
		}
		else if (op == "deleteLast")
		{
			CL* elem = NIL->prev;
			elem->prev->next = elem->next;
			elem->next->prev = elem->prev;
			delete elem;
		}
	}
	CL* ptr = NIL->next;
	bool isStart = true;
	while(true)
	{
		if(ptr == NIL)
			break;
		if (!isStart)
		{
			printf(" ");
		}
				
		printf("%d", ptr->key);
			isStart = false;
		ptr = ptr->next;
	}
	printf("\n");
	
	delete NIL;
	return 0;
}

Measured memory_bytes: 34536