akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<map>
using namespace std;
typedef long long int lli;
typedef long long ll;
#define mod 10000000007
int main()
{
  ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
   lli l,r,d,i,count=0;
   cin>>l>>r>>d;
   for(i=l;i<=r;i++)
   {
       if(i%d==0)
        count++;
   }
   cout<<count<<"\n";
}

Measured memory_bytes: 3644
#include <iostream>
#include <vector>
using namespace std;

int main () {

  long long int n, m, input;

  while ( true ) {

    cin >> n >> m;

    if ( n == 0 ) break;

    vector< long long int > t, h;

    long long int ts = 0;
    long long int hs = 0;

    for ( long long int i = 0; i < n; i++ ) {

      cin >> input;

      t.push_back( input );

      ts += input;

    }

    for ( long long int i = 0; i < m; i++ ) {

      cin >> input;

      h.push_back( input );

      hs += input;

    }

    long long int ans_t = -1;
    long long int ans_h = -1;

    for ( long long int i = 0; i < n; i++ ) {

      for ( long long int j = 0; j < m; j++ ) {

	if ( ( t[i] - h[j] ) * 2 == ts - hs ) {

	  if ( ans_t == -1 ) {
	    ans_t = t[i];
	    ans_h = h[j];
	  }else if ( ans_t + ans_h > t[i] + h[j] ) {
	    ans_t = t[i];
	    ans_h = h[j];
	  }

	}

      }

    }

    if ( ans_t == -1 ) {
      cout << -1 << endl;
    }else {
      cout << ans_t << " " << ans_h << endl;
    }

  }

  return 0;

}

Measured memory_bytes: 1224
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();
		long[] h = new long[N];
		for (int i = 0; i < N; i++) {
			h[i] = sc.nextLong();
		}
		sc.close();

		Arrays.sort(h);

		long val = h[K- 1] - h[0];
		long min = val;

		for (int i = K; i < N; i++) {
			val = h[i] - h[i - K + 1];
			min = Math.min(min, val);
		}

		System.out.println(min);
	}
}


Measured memory_bytes: 60668
#include<bits/stdc++.h>
using namespace std;
int n,num[8] = {0,1,2,3,4,5,6,7};
long double x[8],y[8],ans = 0,t = 0;
int main(){
	cin >> n;
	for(int i = 0;i < n;i++)
		cin >> x[i] >> y[i];
	do{
	
		for(int i = 1;i < n;i++)
			ans =  ans + sqrt((x[num[i]] - x[num[i - 1]]) * (x[num[i]] - x[num[i - 1]]) + (y[num[i]] - y[num[i - 1]]) * (y[num[i]] - y[num[i - 1]]));
		t++;		
	}while(next_permutation(num,num + n));
	printf("%0.20Lf",ans / t);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 998244353;

ll dp[301][200001], dp2[301][200001];
ll n;
ll a[300];

int main() {
    cin >> n;
    rep(i,n) cin >> a[i];
    //sort(a, a+n);
    dp[0][100000] = 1;
    rep(i,n) {
        rep(j,200001) {
            if (j+a[i] <= 200000) dp[i+1][j] = dp[i][j+a[i]];
            if (j >= a[i]) dp[i+1][j] += dp[i][j-a[i]]*2;
            dp[i+1][j] %= MOD;
        }
    }
    dp2[0][100000] = 1;
    rep(i,n) {
        rep(j,200001) {
            if (j+a[i] <= 200000) dp2[i+1][j] = dp2[i][j+a[i]];
            if (j >= a[i]) dp2[i+1][j] += dp2[i][j-a[i]];
            dp2[i+1][j] %= MOD;
        }
    }
    ll sum = 0;
    for (int i = 0; i <= 100000; i++) sum = (sum + dp[n][i])%MOD;
    ll ans = 1;
    rep(i,n) ans = ans * 3 % MOD;
    ans = (ans - sum*3 + MOD*3) % MOD;
    ans = (ans + dp2[n][100000]*3) % MOD;
    cout << ans << endl;
}



Measured memory_bytes: 939264
// https://atcoder.jp/contests/abc081/tasks/arc086_b

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

const int N_MAX = 50;
const int A_I_MAX = 1e6;

int N;
int a[N_MAX];

vector<pair<int, int>> ans;

void solve() {
  int ai = A_I_MAX + 1;
  int ax = -(A_I_MAX + 1);
  int ii = -1;
  int ix = -1;
  REP(i, N) {
    if (a[i] < ai) {
      ai = a[i];
      ii = i;
    }
    if (a[i] > ax) {
      ax = a[i];
      ix = i;
    }
  }
  // printf("%d %d\n", ai, ax);
  if (ai == 0 && ax == 0) {
    puts("0");
    return;
  }
  bool positive = true;
  if (ai >= 0) {
    positive = true;
  } else if (ax <= 0) {
    positive = false;
  } else if (abs(ax) >= abs(ai)){
    REP(i, N) if (a[i] < 0) {
      ans.push_back({ix, i});
      a[i] += ax;
    }
    positive = true;
  } else {
    REP(i, N) if (a[i] > 0) {
      ans.push_back({ii, i});
      a[i] += ai;
    }
    positive = false;
  }
  if (positive) {
    REP(i, N - 1) if (a[i + 1] < a[i]) {
      ans.push_back({i, i + 1});
      a[i + 1] += a[i];
    }
  } else {
    for (int i = N - 1; i > 0; i--) if (a[i - 1] > a[i]) {
      ans.push_back({i, i - 1});
      a[i - 1] += a[i];
    }
  }
  printf("%d\n", ans.size());
  for (auto p : ans) printf("%d %d\n", p.first + 1, p.second + 1);
}

void input() {
  scanf("%d", &N);
  REP(i, N) scanf("%d", a + i);
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); ++i)
#define iter(it,c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

const int INF = ~(1<<31);
const double pi = acos(-1);
const int EPS = 1e-9;

int main(){
    cin.sync_with_stdio(false);
    int n, x;
    cin >> n >> x;
    vector<int> L(n);
    rep(i,0,n) cin >> L[i];
    int r = 0;
    int cnt = 0;
    while(r <= x){
        r += L[cnt];
        if(cnt == n+1){
            break;
        }
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}



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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  string ans = "Balanced";
  if (A + B > C + D)
    ans = "Left";
  if (A + B < C + D)
    ans = "Right";

  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define tez ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cerr.tie(NULL);
int main(){
    tez;
    int64_t h,w;
    cin>>h>>w;
    int64_t ans = h*w;
    if(h==1 || w==1){
        cout<<"1";
    }
    else{
        ( ans % 2 == 0 ) ? cout<<ans/2 : cout<<(ans/2)+1 ;
    }
    return 0;
}


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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

// 各マスについて，そこまでの最短経路のCの足し引きの和で-80から80の値を作れるかどうか記録していく
bool dp[82][82][80 * 160 * 2 + 5];
int A[82][82];
int B[82][82];
int C[82][82];
int main()
{
    int H, W;
    cin >> H >> W;
    for (int row = 0; row < H; row++) {
        for (int col = 0; col < W; col++) {
            cin >> A[row][col];
        }
    }
    for (int row = 0; row < H; row++) {
        for (int col = 0; col < W; col++) {
            cin >> B[row][col];
        }
    }

    for (int row = 0; row < H; row++) {
        for (int col = 0; col < W; col++) {
            C[row][col] = A[row][col] - B[row][col];
        }
    }

    dp[0][0][C[0][0] + 80 * 160] = true;
    dp[0][0][-C[0][0] + 80 * 160] = true;

    rep(row, H)
    {
        rep(col, W)
        {
            // もらうdpで書く（配るdpで書くほうが賢そうだが）
            for (int sum = -80 * 160; sum <= 80 * 160; sum++) {
                int prev_sum1 = sum + C[row][col];
                int prev_sum2 = sum - C[row][col];
                if (row > 0) {
                    dp[row][col][sum + 80 * 160] |= ((-80 * 160 <= prev_sum1) && (prev_sum1 <= 80 * 160) && dp[row - 1][col][prev_sum1 + 80 * 160]);
                    dp[row][col][sum + 80 * 160] |= ((-80 * 160 <= prev_sum2) && (prev_sum2 <= 80 * 160) && dp[row - 1][col][prev_sum2 + 80 * 160]);
                }
                if (col > 0) {
                    dp[row][col][sum + 80 * 160] |= ((-80 * 160 <= prev_sum1) && (prev_sum1 <= 80 * 160) && dp[row][col - 1][prev_sum1 + 80 * 160]);
                    dp[row][col][sum + 80 * 160] |= ((-80 * 160 <= prev_sum2) && (prev_sum2 <= 80 * 160) && dp[row][col - 1][prev_sum2 + 80 * 160]);
                }
            }
        }
    }

    int ans = INF_32;
    for (int sum = -80 * 160; sum <= 80 * 160; sum++) {
        if (dp[H - 1][W - 1][sum + 80 * 160]) {
            ans = min(ans, abs(sum));
        }
    }

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


Measured memory_bytes: 166144
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repr(i, s, e) for(int i=s; i>=e; i--)
#define reps(i, s, e) for(int i=s; i<e; i++)
#define inf 1e18
#define vsort(v) sort(v.begin(), v.end())
#define vsortr(v) sort(v.begin(), v.end(), greater<ll>())
#define sz(x) x.size()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T &a, T b){ if(a<b){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a){ a=b; return true; } return false; }
template<typename T> T gcd(T a, T b){ if(b==0) return a; return gcd(b, a%b); }
template<typename T> T lcm(T a, T b){ return a*b/gcd(a, b); }
template<typename T> void vdebug(vector<T> v){ for(auto vv : v){ cout << vv << " "; } cout << endl; }
template<typename T> void adebug(T arr[], int n){ rep(i, n){ cout << arr[i] << " "; } cout << endl; }
void ans(bool b){ if(b) cout << "Yes" << endl; else cout << "No" << endl; }
void ans2(bool b){ if(b) cout << "YES" << endl; else cout << "NO" << endl; }
int keta(ll num){ int k=0; while(num>0){ num/=10; k++; } return k; }
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};


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

    int alphabet[26][100];
    int n;
    string s;

    rep(i, 26){
        rep(j, 100){
            alphabet[i][j] = 0;
        }
    }

    cin >> n;
    rep(i, n){
        cin >> s;
        rep(j, s.length()){
            alphabet[s[j]-'a'][i]++;
        }
    }

    rep(i, 26){
        int mini = 10000;
        rep(j, n){
            mini = min(mini, alphabet[i][j]);
            if(mini==0) break;
        }

        rep(k, mini){
            cout << char(i+'a');
        }
        if(mini == 0){
            cout << "";
        }
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
//SHIVAM GARG
import java.util.*;
import java.lang.*;
import java.io.*;
 
/*
2
2
5 9
7
1 2 4 8 16 64 128
*/
public class Main
{
 
 
	public static void main (String[] args) throws java.lang.Exception {
	    FastReader reader = new FastReader();
	    int temp = reader.nextInt() % 1000;
		if(temp  == 0){
                System.out.println(0);
        }else{
                          System.out.println(1000-temp);
        }

			    
    }
    
 
 
 /* Iterative Function to calculate  (x^y)%p in O(log y) */
 
    public static long prime = 1000000007;
    public static long[] fact;
    static long power(long x, long y) 
    { 
        // Initialize result 
        long res = 1; 
        // Update x if it is more than or 
        // equal to p 
        x = x % prime; 
                      
        while (y > 0) 
        { 
            // If y is odd, multiply x  with result 
            if (y % 2 == 1) 
                res = (res * x) % prime; 
            // y must be even now 
            y = y >> 1; // y = y/2 
            x = (x * x) % prime; 
        } 
          
        return res; 
    } 
      
    // Returns n^(-1) mod p 
    static long modInverse(long n) 
    {   return power(n, prime-2);   } 
      
    // Returns nCr % p using Fermat's little theorem. 
    static long nCrModPFermat(int n, int r) 
    { 
        // Base case 
        if (r == 0) 
            return 1; 
        long a1 = fact[n];
        long a2 = modInverse(fact[r]) % prime;
        long a3 = modInverse(fact[n-r]) % prime;
        return ((fact[n] * a2)%prime * a3) % prime; 
    } 
	
	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        {  br = new BufferedReader(new InputStreamReader(System.in));  } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) { 
                try{    st = new StringTokenizer(br.readLine()); 
                }catch (IOException  e) { 
                    //e.printStackTrace();
                }
            } 
            return st.nextToken(); 
        }
  
        int nextInt() 
        { return Integer.parseInt(next());  } 
  
        long nextLong() 
        {  return Long.parseLong(next());  } 
  
        double nextDouble() 
        {  return Double.parseDouble(next());  } 
        
        long[] nextLongArray(int n){
            long[] a = new long[n];
            for(int i=0; i<n; i++)
            {   a[i] = nextLong();  }
            return a;
        }
        
        int[] nextIntArray(int n){
            int[] a = new int[n];
            for(int i=0; i<n; i++)
            {   a[i] = nextInt();   }
            return a;
        }
        String nextLine() { 
            String str = ""; 
            try{    str = br.readLine(); 
            } catch (IOException e) { 
                //e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	
	
}


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

int main() {
    int N,M;
    cin >> N >> M;
    int K;
    vector<int> food(M+1);
    int ans = 0;

    for(int i=0;i<N;i++){
        cin >> K;
        for(int j=0;j<K;j++){
            int A;
            cin >> A;
            food.at(A)++;
        }
    }

    for(int k = 0;k<M+1;k++){
        if(food.at(k) == N){
            ans++;
        }
    }

    cout << ans << endl;


}

Measured memory_bytes: 256
n,m=map(int,input().split())
l_ab=list(list(map(int,input().split())) for _ in range(n))
l_cd=list(list(map(int,input().split())) for _ in range(m))
for i in range(n):
    c=-100
    a=10**9
    for j in range(m):
        if a>(abs(l_ab[i][0]-l_cd[j][0])\
             +abs(l_ab[i][1]-l_cd[j][1])):
                a=abs(l_ab[i][0]-l_cd[j][0])\
                 +abs(l_ab[i][1]-l_cd[j][1])
                c=j+1
    print(c)


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

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

	int rcount = 0, bcount = 0;
	for (int i = 0;i < n;i++)
	{
		if (s[i] == 'R')rcount++;
		else bcount++;
	}

	if (rcount > bcount)cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
S = list(input())

pre_list = []
tar_list = [S[0]]
count = 1
i = 1
try:
	while i < len(S):
		pre_list = tar_list 
		tar_list = []
		tar_list.append(S[i])
		i += 1
		
		while tar_list == pre_list:
			tar_list.append(S[i])
			i += 1
	
		count += 1

except IndexError:
	pass
print(count)

Measured memory_bytes: 63088
#include <cstdio>
#include <cstring>

const int maxn = 1e5 + 10;

char S[maxn], T[maxn];
int sumS[maxn], sumT[maxn];

int main()
{
    scanf("%s %s", S, T);
    int n = strlen(S);
    int m = strlen(T);
    for (int i = 0; i < n; ++i)
        sumS[i + 1] = sumS[i] + (S[i] == 'A') + 1;
    for (int i = 0; i < m; ++i)
        sumT[i + 1] = sumT[i] + (T[i] == 'A') + 1;
    int Q;
    scanf("%d", &Q);
    while (Q--)
    {
        int a, b, c, d;
        scanf("%d %d %d %d", &a, &b, &c, &d);
        puts((sumS[b] - sumS[a - 1]) % 3 == (sumT[d] - sumT[c - 1]) % 3 ? "YES" : "NO");
    }
    return 0;
}

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

int main(int argc, char *argv[]) { ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

  ll h;cin>>h;
  ll ans=0;
  int cnt=0;
  while(1){
    ans += pow(2,cnt);
    if(h==1){
      break;
    }
    h/=2;
    cnt++;
  }
  cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException{
		Together solver = new Together();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Together {

		private int n;
		private int a[];
		private Scanner scanner;
		private int output;
		public Together() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			n = Integer.parseInt(scanner.next());
			a = new int[100002];
			Arrays.fill(a, 0);
			int b;
			for(int i=0; i<n; i++) {
				b = Integer.parseInt(scanner.next());
				a[b]++;
			}
			return;
		}

		public void solve() {
			output = 0;
			int sum;
			for(int i=0; i<100000;i++) {
				sum = a[i]+a[i+1]+a[i+2];
				output = Math.max(sum, output);
			}
		}

		public void writeOutput() {
			System.out.println(output);
		}

	}

}

Measured memory_bytes: 48048
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int abcd = sc.nextInt();
        int a = abcd / 1000;
        int b = (abcd - a * 1000) / 100;
        int c = (abcd - a * 1000 - b * 100)/10;
        int d = abcd - a * 1000 - b * 100 - c * 10;
        int ab = a * 10 + b ;
        int cd = c * 10 + d;

        if (0 < ab & ab <13){
          if (0 < cd & cd <13){
            System.out.println("AMBIGUOUS");
          }else{
            System.out.println("MMYY");
          }
        } else{
          if (0 < cd & cd <13){
            System.out.println("YYMM");
        }else{
          System.out.println("NA");
        }


    }
}
}


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

using namespace std;

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

    string res = "Three";
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;

        if (s == "Y") {
            res = "Four";
        }
    }

    cout << res << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
vector<int64_t> prod_permutation(vector<int64_t> v, vector<int64_t> w) {//v○wの計算(先にwで置換、その後vで置換)
	if (v.size() != w.size()) {
		cout << "error" << endl;
		return v;
	}
	else {
		vector<int64_t> ret;
		for (int i = 0; i<v.size(); i++) {
			ret.push_back(v[w[i]]);
		}
		return ret;
	}
}
vector<int64_t> pow_permutation(vector<int64_t> v, int64_t N) {//置換vをN乗した結果を返す。
	if (N % 2 == 0) {
		if (N == 0) {
			vector<int64_t> ret;
			for (int i = 0; i<v.size(); i++) {
				ret.push_back(i);
			}
			return ret;
		}
		else {
			vector<int64_t> ret = pow_permutation(v, N / 2);
			return prod_permutation(ret, ret);
		}
	}
	else {
		if (N == 1) {
			return v;
		}
		else {
			vector<int64_t> ret = pow_permutation(v, (N - 1) / 2);
			return prod_permutation(prod_permutation(v, ret), ret);
		}
	}
}
int main() {
	int64_t N;
	int64_t x[100000];
	int64_t M;
	int64_t K;
	int64_t a[100000];
	cin >> N;
	int64_t dx[100000];
	for (int i = 0; i<N; i++) {
		cin >> x[i];
		if (i != 0) {
			dx[i - 1] = x[i] - x[i - 1];
		}
	}
	cin >> M >> K;
	for (int i = 0; i<M; i++) {
		cin >> a[i];
	}
	vector<int64_t> v;
	for (int i = 0; i<N - 1; i++) {
		v.push_back(i);
	}
	for (int i = 0; i<M; i++) {
		int64_t tmp = v[a[i] - 2];
		v[a[i] - 2] = v[a[i] - 1];
		v[a[i] - 1] = tmp;
	}
	//vector<int64_t> ret = pow_permutation(v, K);
	//int64_t dx_permu[100000];
	//for (int i = 0; i<N - 1; i++) {
	//	dx_permu[ret[i]] = dx[i];
	//}
	//int64_t ans = x[0];
	//for (int i = 0; i<N - 1; i++) {
	//	cout << ans << endl;
	//	ans += dx_permu[i];
	//}
	//cout << ans << endl;
	//return 0;


	auto ret = pow_permutation(v, K);
	int64_t ans = x[0];
	for (int i = 0; i<N - 1; i++) {
		cout << ans << endl;
		ans += dx[ret[i]];
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()		// begin to end
#define rep(i, begin, end) for (ll i = begin; i < end; i++)				// repeat
#define repr(i, begin, end) for (ll i = begin; end < i; i--)			// repeat reverse

#endif

int main(void)
{
	ll r;
	cin >> r;

	cout << 3 * r * r;

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;                                                            
#define pb push_back                                                            
#define mp make_pair                                                                                                                                
#define sqr(a) ((a) * (a))                                                      
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);   
#define co() cout.precision(10);                                                
#define F for(li i=0;i<n;i++)
#define fo(i,a,n) for(i=a;i<n;i++)
#define ne cout<<"\n"; 
#define test int t;cin>>t;while(t--)
//#define oj #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif

typedef long long li;
typedef long double ld;

const li mod = 1000000007;
int main()
{
	li a[5],i;
	fo(i,0,5)
	{
	    cin>>a[i];
	    if(a[i]==0)
	    {
	        cout<<i+1;
	        break;
	    }
	}
}

Measured memory_bytes: 3592
n,m = gets.chomp.split(' ').map(&:to_i)
if n >= m
  puts 0 
else
  places = gets.chomp.split(' ').map(&:to_i).sort
  distances = (1..m - 1).map{|i| places[i] - places[i - 1]}.sort
  puts distances[0..m - n - 1].inject(:+)
end

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

int main (){
    int n ;
    cin >> n ;
    vector<int> a (n) ;
    rep(i, n){
        cin >> a[i] ;
    }
    vector<int> ans (n) ;
    rep(i, n){
        ans[a[i] - 1] = i + 1 ;
    }
    rep(i, n){
        cout << ans[i] << " ";
    }
    cout << endl ;
}


Measured memory_bytes: 3896
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    int X,K,D;
    cin>>X>>K>>D;

    X=abs(X);
    int ans=INF;
    int y=X/D;

    if(y>K){
        ans=abs(X-K*D);
    }else{
        K-=y;
        if(K%2==0)ans=abs(X-y*D);
        else ans=abs(X-(y+1)*D);
    }


    // if(X<=0){
    //     ans=min(abs(X+y*D),abs(X+(y-1)*D));
    // }
    // else{
    //     ans=min(abs(X-y*D),abs(X-(y-1)*D));
    // }
    cout<<ans<<endl;

    



}


Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
using ll =long long;
using P = pair<int,int>;

int main(){
    int a,b,ans;
    cin >> a >> b;
    if(a == b) ans = a+b;
    else ans = max(a,b)*2-1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
fun main() = abc167c()

@OptIn(ExperimentalStdlibApi::class)
fun abc167c() {
    val (n, m, x) = readLine()!!.split(' ').map { it.toLong() }
    val books = (1..n).map {
        val map = readLine()!!.split(' ').map { it.toLong() }
        map[0] to map.drop(1)
    }

    var answer = Long.MAX_VALUE

    for (b in bits(2, n.toInt())) {
        val filtered = books.filterIndexed { index, _ -> b[index] == 1 }

        val sum = LongArray(m.toInt())
        filtered.forEach { it.second.forEachIndexed { index, l -> sum[index] += l } }

        if (sum.all { it >= x }) {
            answer = filtered.map { it.first }.sum().coerceAtMost(answer)
        }
    }

    if (answer == Long.MAX_VALUE) answer = -1

    println(answer)
}

private fun pow(n: Long, p: Long): Long {
    var x = n
    var y = p
    var result = 1L
    while (y > 0) {
        if (y % 2 == 1L)
            result = (result * x)
        y = y shr 1
        x = (x * x)
    }
    return result
}

private fun bits(pattern: Int, length: Int): Array<IntArray> {
    val patterns = pow(pattern.toLong(), length.toLong()).toInt()
    val array = Array(patterns) { IntArray(length) }
    for (i in 0 until patterns) for (j in 0 until length) {
        array[i][length - j - 1] = (i / pow(pattern.toLong(), j.toLong()) % pattern).toInt()
    }
    return array
}


Measured memory_bytes: 42820
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##_end=(b);i<=i##_end;++i)
#define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i)
#define per(i,a,b) for(int i=(b),i##_st=(a);i>=i##_st;--i)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define dbg(x) cerr<<#x" = "<<x<<endl
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define Es(x,i) for(Edge*i=G[x];i;i=i->nxt)
typedef long long ll;
typedef pair<int,int> pii;
const int inf=~0u>>1,MOD=1e9+7;
inline int rd() {
    int x,c,f=1;while(!isdigit(c=getchar()))f=c!='-';x=c-'0';
    while(isdigit(c=getchar()))x=x*10+c-'0';return f?x:-x;
}

int main(){
	rd();
	int a=rd()-rd();
	if(a%2)puts("Borys");
	else puts("Alice");
}

Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()

const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];

void PERinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

long long PER(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * finv[n-k] % MOD;
}

long long FAC(int n){
  return fac[n];
}






using Graph = vector<vector<int> >;

ll ans;
int N,K;
Graph G;
vector<int>degrees;

void dfs(int v, int p) {
  if(p!=-1){
    if(degrees[v]==1)return;
    ans*=PER(K-2,degrees[v]-1);
    ans%=MOD;
  }else{
    ans*=PER(K-1,degrees[v]);
    ans%=MOD;
  }
  for (auto nv : G[v]) {
    if (nv == p) continue;
    dfs(nv, v);
  }
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  PERinit();
  cin>>N>>K;
  ans=K;
  G.assign(N, vector<int>());
  degrees.assign(N, 0);
  for(int i=0;i<N-1;i++){
    int a,b;
    cin>>a>>b;
    a--;b--;
    G[a].push_back(b);
    G[b].push_back(a);
    degrees[a]++;
    degrees[b]++;
  }
  dfs(0,-1);
  cout<<ans<<endl;
}


Measured memory_bytes: 21632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int n;
    string x;
    cin>>n;
    string s[n];
    int t[n];
    rep(i,n){
        cin>>s[i]>>t[i];
    }
    cin>>x;
    int ans=0;
    int co=0;
    for(int i=0;i<n;i++){
        if(x==s[i]){
            co=i;
            break;
        }
    }
    for(int i=co+1;i<n;i++){
        ans+=t[i];
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
n=int(input())
l=list(input())
kk=[]
a=0
A=ord("A")
Z=ord("Z")
for i in l:
  a=ord(i)+n
  if a<=Z:
    kk.append(chr(a))
  elif a>Z:
  	kk.append(chr(a-Z+A-1))
print("".join(kk))

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = INT64_MAX;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    ll N,K;
    cin >> N >> K;
    vll a(N);
    for(auto &v:a) cin >> v;
    DESC(a);
    out(accumulate(a.begin(), a.begin() + K, 0LL));
}

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


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

using namespace std;

int check(char a, char b){
  int ans = 0;
  if(a != b){
  ans = 1;
  }
  
  return ans;
}
int main(void){
  int sum = 0;
  string s;
  cin >> s;
  int len = s.length();
  int mid = len/2;
  //cout << mid;
  if (len%2) {
    for(int i = 0; i <= mid; i++){
      sum += check(s[mid-i], s[mid+i]);
    }
  } else {
    for(int i = 0; i < mid; i++){
      sum += check(s[mid-1-i], s[mid+i]);
    }
  }
  cout << sum << endl;
  

  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	int a, b, x, sum = 0;
	cin >> x >> a >> b;
	for(int i = 1; i <= x; i++){
		if(i/10000+i%10000/1000+i%10000%1000/100+i%10000%1000%100/10+i%10000%1000%100%10 >= a && i/10000+i%10000/1000+i%10000%1000/100+i%10000%1000%100/10+i%10000%1000%100%10 <= b ){
			sum += i;
		}
	}
	cout << sum << endl;
}

Measured memory_bytes: 256
n = int(input())
s = [input() for _ in range(n)]

d = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}

for x in s:
    if x[0] in 'MARCH':
        d[x[0]] += 1

res = 0
march = 'MARCH'
for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+1, 5):
            res += d[march[i]] * d[march[j]] * d[march[k]]

print(res)


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

int main() {
  int sx,sy,tx,ty;cin>>sx>>sy>>tx>>ty;
  rep(i, tx-sx) cout << "R";
  rep(i, ty-sy) cout << "U";
  rep(i, tx-sx) cout << "L";
  rep(i, ty-sy) cout << "D";
  cout << "D";
  rep(i, tx-sx+1) cout << "R";
  rep(i, ty-sy+1) cout << "U";
  cout << "L" << "U";
  rep(i, tx-sx+1) cout << "L";
  rep(i, ty-sy+1) cout << "D";
  cout << "R";
  
}


Measured memory_bytes: 256
N=int(input())
S=input()
open=0
output=S
for c in S:
    if c=="(":
        open=open+1

    else:
        if open>0:
            open=open-1
        else:
            output="("+output

for i in range(open):
    if open>0:
        output=output+")"

print(output)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <sstream>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <list>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<vector<int>> vvi;

int main() {
    int a, b;
    cin >> a >> b;
    int c = a + b;
    cout << (c < 10 ? to_string(c) : "error");

    return 0;
}

Measured memory_bytes: 256
#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;
  vector<int> arr(N);
  REP(i,0,N){
    cin>>arr[i];
    arr[i]--;
  }
  int ans=0;
  REP(i,0,N){
    if(i==arr[arr[i]]){
      ans++;
    }
  }
  print(ans/2);

}


Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
struct Edge
{
	int to;
	int nxt;
}e[4005];
int n,m,edgenum,head[2005],pa[2005],f[2005],g[2005],size[2005];
char s[2005];
void add(int u,int v)
{
	e[++edgenum].to=v;
	e[edgenum].nxt=head[u];
	head[u]=edgenum;
}
void dfs(int node)
{
	f[node]=g[node]=size[node]=0;
	for(int hd=head[node];hd;hd=e[hd].nxt)
	{
		int to=e[hd].to;
		if(to==pa[node])continue;
		pa[to]=node;
		dfs(to);
		size[node]+=size[to];
		g[node]+=g[to];
	}
	g[node]+=size[node];
	if(s[node]=='1')size[node]++;
	int s1=0,minp=0;
	for(int hd=head[node];hd;hd=e[hd].nxt)
	{
		int to=e[hd].to;
		if(to==pa[node])continue;
		s1+=g[to]+size[to];
		if(f[to]+size[to]>f[minp]+size[minp])minp=to;
	}
	s1-=g[minp]+size[minp];
	if(s1>=f[minp]+size[minp])f[node]=(s1-f[minp]-size[minp])&1;
	else f[node]=f[minp]+size[minp]-s1;
	pa[node]=0;
}
int main()
{
	scanf("%d",&n);
	scanf("%s",s+1);
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		add(u,v);
		add(v,u);
	}
	int ans=2147483647;
	for(int i=1;i<=n;i++)
	{
		dfs(i);
		if(f[i]==0)ans=min(ans,g[i]);
	}
	if(ans&1)printf("-1\n");
	else printf("%d\n",ans/2);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 62;

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;
}

template <typename T>
T gcd(T a, T b)
{
    if (a < b) {
        a ^= b;
        b ^= a;
        a ^= b;
    }
    return b ? gcd(b, a % b) : a;
}

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

ll a, b, k;
void input() {
    cin >> a >> b >> k;
}

void solve() {
    ll r_a = a;
    ll r_b = b;
    //cout << "a: " << a << endl;
    //cout << "b: " << b << endl;
    //cout << "k: " << k << endl;
    if(a <= k) {
        r_a = static_cast<long long>(0);
        //cout << "r_a1: " << r_a << endl;
        if( b - (k - a) < static_cast<long long>(0)) {
            r_b = static_cast<long long>(0);
            //cout << "r_b1: " << r_b << endl;
        } else {
            r_b = b - (k - a);
            //cout << "r_b2: " << r_b << endl;
        }
    } else {
        r_a = a - k;
        //cout << "r_a2: " << r_a << endl;
        r_b = b;
        //cout << "r_b: " << r_b << endl;

    }
    cout << r_a << " " << r_b;
}



int main() {
    input();
    solve();
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
x = A[n-1]
i = -1
for j in range(0, n-1):
    if A[j] <= x:
        i += 1
        A[i], A[j] = A[j], A[i]

A[i+1], A[n-1] = A[n-1], A[i+1]
for j in range(n):
    if j == 0:
        print(A[j], end="")
    elif j-1 == i:
        print(" "+"["+str(A[j])+"]",end ="")
    else:
        print(" "+str(A[j]),end="")
print()


Measured memory_bytes: 16384
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
    
    public static int printgcd(int i,int j,int k){
        BigInteger b1,b2,b3,b4;
        b1 = BigInteger.valueOf(i);
        b2 = BigInteger.valueOf(j);
        b3 = BigInteger.valueOf(k);
        b4=b1.gcd(b2);
        b4=b4.gcd(b3);
        return b4.intValue();
        
    }
	public static void main (String[] args) throws java.lang.Exception
	{
	   long sum = 0;
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		for(int i=1;i<=n;i++){
		    	for(int j=1;j<=n;j++){
		    	    	for(int k=1;k<=n;k++){
		    	    	   sum+=Long.valueOf(printgcd(i,j,k)); 
		    	    	}
		    	}
		}
		System.out.println(sum);
		
		
	}
	
	
}


Measured memory_bytes: 64676
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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 main() {
    input! {
        n: usize,
        mut v: [i64; n],
    }
    v.sort();
    let mut m = 0;
    for i in 0..n {
        m += v[i];
    }
    println!("{} {} {}",v[0], v[n-1], m);
}
//nを入力後ctrl+Z


Measured memory_bytes: 5052
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n==1){
      System.out.println("Hello World");
    }else if(n==2){
      int a = sc.nextInt();
      int b = sc.nextInt();
      System.out.println(a+b);
    }
  }
}


Measured memory_bytes: 21844
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});

reader.on("close", function() {
  // A B K
  var numbers: number[] = lines[0].split(" ").map(x => {
    return Number(x);
  });
  var numA: number = numbers[0];
  var numB: number = numbers[1];
  var numK: number = numbers[2];
  var maxNumInFirst: number = 0;
  for (var i: number = numA; i < numA + numK && i <= numB; i++) {
    console.log(i);
    maxNumInFirst = i;
  }
  for (var i: number = numB - numK + 1; i < numB + 1; i++) {
    if (maxNumInFirst < i) {
      console.log(i);
    }
  }
});


Measured memory_bytes: 9012
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,m,v,i;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>m;
  ll cnt = 0;
  ll l = m;
  while(l){
    cnt++;
    l/=10;
  }
  ll p = n*pow(10,cnt)+m;
  // cout<<p;
  if(sqrt(p) == floor(sqrt(p))) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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


Measured memory_bytes: 512
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    let n:usize = read();
    let a:Vec<u32> = (0..n).map(|_| read()).collect();

    let mut c = a[0];
    let mut cnt:u32 = 1;
    let mut ans:u32 = 0;
    for &el in a.iter().skip(1) {
        //debug!(el,c,cnt,ans);
        if el != c {
            ans += cnt/2;
            cnt = 1;
        } else {
            cnt += 1;
        }
        c = el;
    }
    ans += cnt/2;

    println!("{}", ans);

}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <numeric>
using namespace std;


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    for (int i = 0; i < n; i++) cin >> h[i];

    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (h[i] >= k) cnt++;
    }

    cout << cnt << endl;
}


Measured memory_bytes: 640
def main():
    import sys
    from bisect import bisect_left
    input = sys.stdin.readline

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

    minus = []
    plus = []
    zero = 0
    for a in A:
        if a > 0:
            plus.append(a)
        elif a < 0:
            minus.append(-a)
        else:
            zero += 1
    plus.sort()
    minus.sort()
    plus_num = len(plus)
    minus_num = len(minus)
    if plus_num * minus_num < K <= (N*(N-1))//2 - (plus_num*(plus_num-1))//2 - (minus_num*(minus_num-1))//2:
        print(0)
        exit()
    if plus_num * minus_num >= K:
        ng = 0
        ok = -10**18-1
        mid = (ng+ok)//2
        while ng - ok > 1:
            cnt = 0
            j = 0
            for a in reversed(minus):
                while True:
                    if j == plus_num:
                        break
                    if a * plus[j] < -mid:
                        j += 1
                    else:
                        break
                #print(mid, a, j)
                cnt += plus_num - j
            #print(mid, cnt)
            if cnt < K:
                ok = mid
            else:
                ng = mid
            mid = (ok+ng)//2
        print(ng)
    else:
        K -= (N*(N-1))//2 - (plus_num*(plus_num-1))//2 - (minus_num*(minus_num-1))//2
        ng = 10**18+1
        ok = 0
        mid = (ok+ng)//2
        while ng - ok > 1:
            cnt = 0
            j = plus_num-1
            for a in plus:
                while True:
                    if j == -1:
                        break
                    if a * plus[j] > mid:
                        j -= 1
                    else:
                        break
                cnt += j+1
            for a in plus:
                if a**2 <= mid:
                    cnt -= 1
                else:
                    break
            j = minus_num-1
            for a in minus:
                while True:
                    if j == -1:
                        break
                    if a * minus[j] > mid:
                        j -= 1
                    else:
                        break
                cnt += j+1
            for a in minus:
                if a**2 <= mid:
                    cnt -= 1
                else:
                    break
            #print(cnt)
            assert cnt%2 == 0
            cnt //= 2
            if cnt < K:
                ok = mid
            else:
                ng = mid
            mid = (ok+ng)//2
        print(ng)


if __name__ == '__main__':
    main()


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

int main() {
  int n, x, i, a = 0;
  cin >> n >> x;
  
  vector<int> m(n);
  for(i = 0; i < n; i++){
    cin >> m.at(i);
    a += m.at(i);
  }
  
  x -= a;
  
  sort(m.begin(), m.end());
  
  cout << n + x / m.at(0) << endl;
}


Measured memory_bytes: 256