akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define FOR(i, j, k) for (int i = j; i < k; i++)
#define REP(i, j) FOR(i, 0, j)
#define RFOR(i, k, j) for (int i = k - 1; i >= j; i--)
#define RREP(i, j) RFOR(i, j, 0)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<pii> vpii;

template <class T> bool chmax(T &a, const T &b) {
    if (a < b) { a = b; return 1; }
    return 0;
}

template <class T> bool chmin(T &a, const T &b) {
    if (b < a) { a = b; return 1;}
    return 0;
}

template <typename T> istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x; 
    return is;
}

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n;
    cin >> n;
    vi s(1 << n);
    cin >> s;

    multiset<int> used; 
    multiset<int> not_used; 
    REP(i, s.size())  not_used.insert(-s[i]);
    used.insert(*not_used.begin());
    not_used.erase(not_used.begin());

    REP(t, n) {
        vector<int> tmp;
        for (auto e: used) {
            auto it2 = not_used.upper_bound(e);
            if (it2 != not_used.end()) {
                tmp.push_back(*it2);
                not_used.erase(it2);
            }
        }
        for (auto e: tmp) {
            used.insert(e);
        }
    }

    if (not_used.size() > 0) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 14328
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>

#define MAX 3234566667LL

using namespace std;

queue<long long> q;

int main()
{
    int K, i;
    long long current;

    scanf("%d", &K);

    for(i = 1; i <= 9; ++i)
        q.push(i);
    while(--K){
        current = q.front();
        q.pop();

        if(current % 10 != 0 && current * 10 + current % 10 - 1 <= MAX)
            q.push(current * 10 + current % 10 - 1);
        if(current * 10 + current % 10 <= MAX)
            q.push(current * 10 + current % 10);
        if(current % 10 != 9 && current * 10 + current % 10 + 1 <= MAX)
            q.push(current * 10 + current % 10 + 1);
    }

    printf("%lld", q.front());

    return 0;
}


Measured memory_bytes: 768
from itertools import combinations_with_replacement
N, M, Q = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(Q)]
ans = 0

def calc(arr):
    score = 0
    for a, b, c, d in X:
        if arr[b - 1] - arr[a - 1] == c:
            score += d
    return score


def dfs(arr):
    global ans
    if len(arr) == N:
        ans = max(ans, calc(arr))

    elif len(arr) == 0:
        for nx in range(1, M + 1):
            dfs(arr + [nx])

    else:
        for nx in range(arr[-1], M + 1):
            dfs(arr + [nx])


dfs([])
print(ans)

Measured memory_bytes: 9208
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
using namespace std;

typedef long long ll;
typedef unsigned long long u_ll;

int N;
ll ans = 0;

int A = 0, B = 0;

int main() {
	cin >> A >> B;
	ans = A - 2 * B;
	if (ans < 0) {
		ans = 0;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
import Data.List

main = do
  n <- map(read::[Char]->Int) <$> words <$> getLine
  l <- sort <$> map(read::[Char]->Int) <$> words <$> getLine
  print $ abc l

abc::[Int]->Int
abc [] = 0
abc (x:y:xs) = min x y + abc xs

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

#define pb push_back
#define all(x) (x).begin(), (x).end()
#define for1(i, a, b) for (int i = (int)a; i < (int)(b); ++i)
#define rfor1(i, a, b) for (int i=(int)b-1;i>=(int)a;i--)
#define for2(i, a, b) for (int i = (int)a; i <= (int)(b); ++i)
#define for3(i, a, b) for (int i = (int)a; i < (int)(b); i=i+2)
#define for4(i, a, b) for (int i = (int)a; i <= (int)(b); i=i+2)
#define tc(t) int t; cin>>t; while(t--)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, d;
    cin >> n >> d;
    int cnt = 0;
    while (n--) {
        long long a, b;
        cin >> a >> b;
        ll o = pow(a, 2) + pow(b, 2);
        double e = sqrt(o);
        if (e <= d) {
            cnt++;
        }
        
    }
    cout << cnt << "\n";
}









Measured memory_bytes: 3668
int main() {
    int H, W, i, x, y;
    for(;scanf("%d%d", &H, &W);){
        if(H == 0 && W == 0)break;
        for(i=0;i<H;i++){
            if(i==0|| i==(H-1))
                for(x=0;x<W;x++)
                    printf("#");
            else{
                printf("#");
                for(x=1;x<(W-1);x++)
                    printf(".");
                printf("#");}
            printf("\n");}
        printf("\n");}
    return 0;
}

Measured memory_bytes: 572
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    cout << abs(a - b) << endl;
    return 0;
}




Measured memory_bytes: 3112
#include<cstdio>
#include<cstring>
#define LL long long
using namespace std;
char str[15];
LL ans;
void dfs(LL sum,int now,int len)
{
    if(now==len)
    {
	       ans+=sum;
        return;
    }
    for(int i=now; i<len; i++)
    {
        LL tmp=0;
        for(int j=now; j<=i; j++)
            tmp=tmp*10+(str[j]-'0');
        dfs(sum+tmp,i+1,len);
    }
    return;
}
int main()
{
    while(scanf("%s",str)!=EOF)
    {
        ans=0;
        int len=strlen(str);
        dfs(0,0,len);
        printf("%lld\n",ans);
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
#define MAX 1000003
using namespace std;
  
typedef long long ll;
const int mod = 1000000007;
  
int prime[MAX];
unordered_map<int, int> max_map;
  
// Function to return a^n
ll power(ll a, ll n)
{
    if (n == 0)
        return 1;
    int p = power(a, n / 2) % mod;
    p = (p * p) % mod;
    if (n & 1)
        p = (p * a) % mod;
    return p;
}
  
// Function to find the smallest prime factors
// of numbers upto MAX
void sieve()
{
    prime[0] = prime[1] = 1;
    for (int i = 2; i < MAX; i++) {
        if (prime[i] == 0) {
            for (int j = i * 2; j < MAX; j += i) {
                if (prime[j] == 0) {
                    prime[j] = i;
                }
            }
            prime[i] = i;
        }
    }
}
  
// Function to return the LCM modulo M
ll lcmModuloM(const int* ar, int n)
{
  
    for (int i = 0; i < n; i++) {
        int num = ar[i];
        unordered_map<int, int> temp;
  
        // Temp stores mapping of prime factor to
        // its power for the current element
        while (num > 1) {
  
            // Factor is the smallest prime factor of num
            int factor = prime[num];
  
            // Increase count of factor in temp
            temp[factor]++;
  
            // Reduce num by its prime factor
            num /= factor;
        }
  
        for (auto it : temp) {
  
            // Store the highest power of every prime
            // found till now in a new map max_map
            max_map[it.first] = max(max_map[it.first], it.second);
        }
    }
  
    ll ans = 1;
  
    for (auto it : max_map) {
  
        // LCM is product of primes to their highest powers modulo M
        ans = (ans * power(it.F, it.S)) % mod;
    }
  
    return ans;
}

// C function for extended Euclidean Algorithm (used to
// find modular inverse.
ll gcdExtended(ll a, ll b, ll *x, ll *y)
{
    // Base Case
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }
  
    ll x1, y1; // To store results of recursive call
    ll gcd = gcdExtended(b%a, a, &x1, &y1);
  
    // Update x and y using results of recursive
    // call
    *x = y1 - (b/a) * x1;
    *y = x1;
  
    return gcd;
}
  
// Function to find modulo inverse of b. It returns
// -1 when inverse doesn't
ll modInverse(ll b, ll m)
{
    ll x, y; // used in extended GCD algorithm
    ll g = gcdExtended(b, m, &x, &y);
  
    // Return -1 if b and m are not co-prime
    if (g != 1)
        return -1;
  
    // m is added to handle negative x
    return (x%m + m) % m;
}
  
// Function to compute a/b under modlo m
ll modDivide(ll a, ll b, ll m)
{
    a = a % m;
    ll inv = modInverse(b, m);
    if (inv <= -1)
    {
        return inv+m;
    }
    else
    {
        return (inv * a) % m;
    }
}
  

  
  
int main()
{
    sieve();
    int n;
    int a[100009];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll lcm = lcmModuloM(a, n);
    
    ll ans = 0;
    for(int i=0;i<n;i++){
        ans = (ans + modDivide(lcm,a[i],mod))%mod;
    }
    cout<<ans<<"\n";
    return 0;
}



Measured memory_bytes: 4608
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int m = scan.nextInt();

		if (n == m) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 22996
#include <stdio.h>
 
int main(void) {
    int i,j;
    // your code goes here
    for(i=1;i<10;i++){
        for(j=1;j<10;j++){
            printf("%dx%d=%d\n", i, j, i*j);
        }
    }
    return 0;
}

Measured memory_bytes: 524
/*
Author : Xinyuan
*/
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int  ll;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int nxt() {int x;scanf("%d", &x);return x;}

ll _sieve_size;
bitset<10000010> bs;   // 10^7 should be enough for most cases
vector<ll> primes;   // compact list of primes in form of vector<int>


// first part

void sieve(ll upperbound) {          // create list of primes in [0..upperbound]
  _sieve_size = upperbound + 1;                   // add 1 to include upperbound
  bs.set();                                                 // set all bits to 1
  bs[0] = bs[1] = 0;                                     // except index 0 and 1
  for (ll i = 2; i <= _sieve_size; i++) if (bs[i]) {
    // cross out multiples of i starting from i * i!
    for (ll j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
    primes.push_back((int)i);  // also add this vector containing list of primes
} }       

map<int, int> primeFactors(ll N) {   // remember: vi is vector of integers, ll is long long
  map<int, int> factors;                    // vi `primes' (generated by sieve) is optional
  ll PF_idx = 0, PF = primes[PF_idx];     // using PF = 2, 3, 4, ..., is also ok
  while (N != 1 && (PF * PF <= N)) {   // stop at sqrt(N), but N can get smaller
    while (N % PF == 0) { N /= PF; factors[PF]++; }    // remove this PF
    PF = primes[++PF_idx];                              // only consider primes!
  }
  if (N != 1) factors[N]++;
  return factors;         // if pf exceeds 32-bit integer, you have to change vi
}



int main(){
    ll n;
    sieve(1e7);
    cin >> n;
    map<int, int> p = primeFactors(n);
    int ans = 0;
    for(auto x : p){
        int i = 1;
        while(x.second >= i){
            ans++;
            x.second -= i;
            i++;
        }
    } 
    printf("%d\n", ans);
    return 0;
}



Measured memory_bytes: 12640
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> mp;
typedef pair<mp ,int> mypair;
typedef pair<mp,pair<mp,mp> > tri;
typedef long long int ll;
void print(vector<int> a){
	for(int i=0;i<a.size();i++)cout<<a[i]<<' ';
	cout<<endl;
}
void print(vector<mp> a){
	for(int i=0;i<a.size();i++)cout<<" ("<<a[i].first<<" ,"<<a[i].second<<")" ;
	cout<<endl;
}
int main(){
	int n,m;
	cin>>n>>m;
	vector<int> x,y,d;
	vector<mp> mx(n),my(n),md(n);
	for(int i=0;i<n;i++){
		int x1,x2,y1,y2,d1,d2;
		cin>>x1>>y1>>d1>>x2>>y2>>d2;
		x.push_back(x1);
		x.push_back(x2);
		y.push_back(y1);
		y.push_back(y2);
		d.push_back(d1);
		d.push_back(d2);
		mx[i]=mp(x1,x2);
		my[i]=mp(y1,y2);
		md[i] =mp(d1,d2);
	}
	sort(x.begin(),x.end());
	sort(y.begin(),y.end());
	sort(d.begin(),d.end() );
	//cout<<endl;
	//print(x);
	//print(y);
	//print(d);
	//cout<<endl;
	//print(mx);
	//print(my);
	//print(md);
	//cout<<endl;
	//sort(map.begin(),map.end() );
	ll  ans = 0;
	for(int i=0;i<x.size()-1;i++){
			if(x[i]==x[i+1])continue;
		for(int j=0;j<y.size()-1;j++){
				if(y[j]==y[j+1])continue;
			for(int k=0;k<d.size()-1;k++){
				if(d[k]==d[k+1])continue;
				int cnt=0;
				for(int t=0;t<n;t++){
					mp nx = mx[t];
					mp ny = my[t];
					mp nd = md[t];
					
					if(nx.first<=x[i]&&x[i+1]<=nx.second&&
							ny.first<=y[j]&&y[j+1]<=ny.second&&
							nd.first<=d[k]&&d[k+1]<=nd.second){
						cnt++;
					}
				}
				if(cnt>=m){
					ll tmp=(ll( x[i+1]-x[i]))*(ll(y[j+1]-y[j]) )*(ll(d[k+1]-d[k]) );
					//cout<<x[i]<<' '<<y[j]<<' '<<d[k]<<" "<<tmp<<endl;
					ans+=tmp;
				}
			}	
		}
	}
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
#define ll long long
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int main(){
	fastio();
	int n,m;
	cin>>n>>m;
	if(n-m) cout<<"No";
	else cout<<"Yes";
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)
typedef long long ll;
vii getCnt(vi &v) {
	sort(all(v));
	vii ans;
	int cnt = 1;
	rep(i, 1, v.size()) {
		if(v[i] == v[i - 1]) {
			cnt++;
		}
		else {
			ans.pb(mp(cnt, v[i - 1]));
			cnt = 1;
		}
	}
	ans.pb(mp(cnt, v.back()));
	sort(all(ans));
	reverse(all(ans));
	return ans;
}
void print(vii a) {
	for(auto i : a) {
		cout<<i.y<<" "<<i.x<<endl;
	}
	cout<<endl;
}
void solve(){
	int n;
	cin>>n;
	vi odd, even;
	rep(i, 0, n) {
		int tem;
		cin>>tem;
		if(i % 2) 
			even.pb(tem);
		else
			odd.pb(tem);
	}
	vii A, B;
	A = getCnt(odd);
	B = getCnt(even);
	A.pb(mp(0, -1));
	B.pb(mp(0, -2));
//	cout<<"A : "<<endl;
//	print(A);
//	cout<<"B : "<<endl;
//	print(B);
	int ans = 0;
	rep(i, 0, 2) {
		rep(j, 0, 2) {
			if(A[i].y == B[j].y) continue;
			ans = max(ans, A[i].x + B[j].x);
		}
	}
	cout<<n - ans<<endl;
}
int main() {
	int t;
//	cin>>t;
	t = 1;
	while(t--){
		solve();
	}
}


Measured memory_bytes: 1784
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            //for(int i = 0;;i++){
                int a = sc.nextInt();
                int b = sc.nextInt();

                if(a ==0 && b == 0){
                    break;
                }
                for(int u = 1;u <= a;u++){
                    for(int e = 0; e < b;e++){
                        System.out.print("#");
                    }
                    System.out.println("");

                }                   System.out.println("");
            //}        sc.close(); 
        }

    }
}


Measured memory_bytes: 34600
#include<bits/stdc++.h>
using namespace std;
int main ()
{
    int n,x,t;
    scanf("%d %d %d",&n,&x,&t);
    int h=n/x;
    if(h*x!=n)
        h++;
    printf("%d\n",h*t);
    return 0;
}

Measured memory_bytes: 3808
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,m;cin>>n>>m;
  priority_queue<pair<ll,int>>Q;
  rep(i,n){
    ll x;cin>>x;
    Q.push(make_pair(x,1));
  }
  rep(i,m){
    ll x,y;
    cin>>x>>y;
    Q.push(make_pair(y,x));
  }
  ll sum=0;int k=0;
  while(k<n){
    k+=Q.top().second;
    if(k>n){sum+=Q.top().first*(Q.top().second-k+n);break;}
    sum+=Q.top().first*Q.top().second;
    Q.pop();
    //cout<<sum<<endl;
  }
  cout<<sum<<endl;
}



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

int main() {
    int a, b; cin >> a >> b;
    string s = "";
    if(a > b) {
        for(int i = 0; i < a; i++) cout << b;
    }else{
        for(int i = 0; i < b; i++) cout << a;
    }
    return 0;
}


Measured memory_bytes: 256
from collections import deque
H, W = map(int, input().split())
A = [list(input()) for i in range(H)]
Q = deque()
h = 0
for i in range(H):
    for j in range(W):
        if A[i][j] == '#':
            Q.append([i, j])
        else:
            h += 1
Qtmp = deque()

yudrl = [0, 1, 0, -1]
xudrl = [1, 0, -1, 0]

c = 0
while h > 0:
    c += 1
    while len(Q) > 0:
        Qtmp.append(Q.pop())
    while len(Qtmp) > 0:
        q = Qtmp.pop()

        for i in range(4):
            y = q[0] + yudrl[i]
            x = q[1] + xudrl[i]

            if y < 0 or y > H - 1 or x < 0 or x > W - 1:
                continue
            if A[y][x] == '#':
                continue
            A[y][x] = '#'
            h -= 1
            Q.append([y, x])
print(c)

Measured memory_bytes: 164188
#include<cstdio>
#include<map>
using namespace std;
int n,ans;
map<int,int> m;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		int x; scanf("%d",&x); ++m[x];
	}
	for(map<int,int>::iterator it=m.begin();it!=m.end();++it){
		if(it->second>=it->first) ans+=it->second-it->first;
		else ans+=it->second;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 4736
from collections import deque
import sys
input = sys.stdin.readline

def main():
    N, Q = map(int, input().split())
    edges = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        edges[b-1].append(a-1)
        edges[a-1].append(b-1)

    counts = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        counts[p-1] += x

    parent_nodes = deque()
    parent_nodes.append(0)
    visited_nodes = set()
    while parent_nodes:
        parent = parent_nodes.popleft()
        if parent in visited_nodes:
            continue
        visited_nodes.add(parent)
        for child in edges[parent]:
            if child in visited_nodes:
                continue
            counts[child] += counts[parent]
            parent_nodes.append(child)

    print(' '.join(list(map(str, counts))))

if __name__ == "__main__":
    main()

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

#define ll long long
#define f first
#define s second
#define inf 1e15

#define N 300005

string s;
ll n,m,x,y,d,k;
ll a[N];

int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
	int t=1;
//	cin>>t;
	while(t--){
	    
	    double d,T,S;
	    cin>>d>>T>>S;
	   
	   if((double)d/S>T){
	       cout<<"No";
	   }
	   else
	   {
	       cout<<"Yes";
	   }
	    
	    
	    
	    
	}
	return 0;
}


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

using namespace std;


int main() {
	int n;
	double x1, x2, x3, y1, y2, y3, ox, oy, r;
	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
		ox = ((y2 - y1) * ((y3 * y3 - y1 * y1) + (x3 * x3 - x1 * x1)) - (y3 - y1) * ((y2 * y2 - y1 * y1) + (x2 * x2 - x1 * x1))) /
			(2 * ((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1)));
		if (y2 != y1) {
			oy = (2 * (x1 - x2) * ox + (y2 * y2 - y1 * y1) + (x2 * x2 - x1 * x1)) / (2 * (y2 - y1));
		}
		else {
			oy = (2 * (x1 - x3) * ox + (y3 * y3 - y1 * y1) + (x3 * x3 - x1 * x1)) / (2 * (y3 - y1));
		}

		r = sqrt((ox - x1) * (ox - x1) + (oy - y1) * (oy - y1));
		printf("%.3lf %.3lf %.3lf\n", ox, oy, r);
	}
	return 0;
}


Measured memory_bytes: 2608
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
#define pb push_back
#define fi first
#define se second
const ll mod = 1e9+7;
const int N = 1e5+6;
void solve(){
	int a,b; 
	cin>>a>>b; 
	cout<<max({a+b,a-b,a*b})<<endl;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1; 
//	cin>>t; 
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 3484
//minamoto
#include<bits/stdc++.h>
#define R register
#define pb push_back
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
const int N=1005,M=2e5+5;
struct eg{int v,nx;}e[M];int head[N],tot;
inline void add(R int u,R int v){e[++tot]={v,head[u]},head[u]=tot;}
int ans[M];
int dfn[N],low[N],st[N],col[N],tim,top,cnt,n,m;
void tarjan(int u){
	dfn[u]=low[u]=++tim,st[++top]=u;
	go(u)if(!dfn[v])tarjan(v),cmin(low[u],low[v]);
		else if(!col[v])cmin(low[u],dfn[v]);
	if(dfn[u]==low[u])
		for(++cnt;st[top+1]!=u;--top)col[st[top]]=u;
}
int q[M<<3],fr[N],vis[N];
inline int trs(R int &x,R int y){return x==y?0:(x=!x?y:1023,1);}
void bfs(int rt){
	int h=1,t=0,u;
	fp(i,1,n)vis[i]=fr[i]=0;
	go(rt)fr[v]=v,q[++t]=v,vis[v]=1;
	while(h<=t){
		u=q[h++],vis[u]=0;
		go(u)if(v!=rt&&trs(fr[v],fr[u])&&!vis[v])q[++t]=v,vis[v]=1;
	}
	go(rt)ans[i]=(fr[v]==1023)^(col[rt]==col[v]);
}
int main(){
//	freopen("testdata.in","r",stdin); 
	scanf("%d%d",&n,&m);
	for(R int i=1,u,v;i<=m;++i)scanf("%d%d",&u,&v),add(u,v);
	fp(i,1,n)if(!dfn[i])tarjan(i);
	fp(i,1,n)bfs(i);
	fp(i,1,m)puts(ans[i]?"diff":"same");
	return 0;
}

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

int main() {
    string s1;
    while(cin >> s1, s1 != ".") {
        string s2; cin >> s2;
        const int n = s1.size(), m = s2.size();
        int cnt = 0;
        bool in_str = false;
        int i = 0, j = 0;
        while(i < n && j < m) {
            if(s1[i] != s2[j]) {
                if(!in_str) {
                    cnt = 2;
                    break;
                }
                cnt += 1;
                while(i < n && s1[i] != '\"') i++;
                while(j < m && s2[j] != '\"') j++;
                i = i + 1; j = j + 1;
            } else {
                in_str ^= s1[i] == '\"';
                i++, j++;
            }
        }
        if(i != n || j != m || cnt >= 2) {
            cout << "DIFFERENT" << endl;
        } else if(cnt == 1) {
            cout << "CLOSE" << endl;
        } else {
            cout << "IDENTICAL" << endl;
        }
    }
}



Measured memory_bytes: 3156
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int A, B, C, X, Y;
        A = scanner.nextInt();
        B = scanner.nextInt();
        C = scanner.nextInt();
        X = scanner.nextInt();
        Y = scanner.nextInt();
        int ans = (int) 1e9;
        for (int i = 0; i < 2 * (X + Y) + 1; i = i + 2) {
            int ABpizza = i;
            int Apizza = Math.max(0, X - (i / 2));
            int Bpizza = Math.max(0, Y - (i / 2));
            ans = Math.min(ans, Apizza * A + Bpizza * B + ABpizza * C);
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 21972
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String s = sc.next();
		String t = sc.next();
		int length = s.length();
		boolean[][] mapS = new boolean[26][length];
		boolean[][] mapT = new boolean[26][length];
		for (int i=0; i<26; i++){
			for (int j=0; j<length; j++){
				mapS[i][j] = false;
				mapT[i][j] = false;
			}
		} // 初期化する
	    	
		char x;
		int l=0;
		for (x = 'a'; x <= 'z'; x++) {
					// System.out.println(x+"c"+l);

			for(int i=0;i<length;i++){
				char sHead = s.charAt(i);
				char tHead = t.charAt(i);

					// System.out.println("i  "+i );
					// System.out.println("sHead "+sHead);
					// System.out.println("tHead "+tHead);
				if(sHead==x){
					mapS[l][i] = true;
					// System.out.println("s x i "+ l+i);
				}
				if(tHead==x){
					// System.out.println("t x i "+ l+i);
					mapT[l][i] = true;
				}
			}
			l++;
   		}


		Map<Integer, Boolean> avoidMap = new HashMap<>();
		boolean isSuccess =true;
   		for (int i=0; i<26; i++){
   			boolean sFlag = false;
			for (int j=0; j<26; j++){
				if(avoidMap.containsKey(j)){

					// System.out.println("avoidCase is "+j);
					continue;
				}

				boolean pairFlag=true;
				for(int k=0 ;k<length;k++){
					// System.out.println("i j k "+ i+j+k+mapS[i][k] + mapT[j][k]);
					if(mapS[i][k] != mapT[j][k]){
						pairFlag =false;
					}
				}

					// System.out.println("pairFlag is "+pairFlag);
				if(pairFlag){
					sFlag =true;
					avoidMap.put(j,true);
					break;
				}
			}

			if(sFlag){
				isSuccess =true;
			}else{
				// System.out.println("Failed in "+i);
				isSuccess =false;
				break;
			}
		}
		System.out.println(isSuccess?"Yes":"No");



	}


}




Measured memory_bytes: 37180
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

import itertools

A, B, C, D = list(read().rstrip().decode('utf-8'))

for operators in itertools.product(['+', '-'], repeat=3):
    op1, op2, op3 = operators
    eq = A + op1 + B + op2 + C + op3 + D
    x = eval(eq)
    if x == 7:
        break

answer = eq + "=7"
print(answer)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ull  unsigned long long
#define pb push_back

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 3000000;
int mod = 1e9 + 7;
int a[N];
bitset < 4000000 > bs;
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt","w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    int l = 2;
    int r = 2;
    for (int i = n; i >= 1; i--){
        r = r / a[i] * a[i];
        if (l % a[i] != 0) l = (l / a[i] + 1) * a[i];
        r += a[i] - 1;
    }
    if (l > r) cout << -1; else cout << l << " " << r;
}


Measured memory_bytes: 1024
import sys
input = sys.stdin.readline
def main():
    Q = 10**9+7
    N, M = map( int, input().split())
    S = list( map( int, input().split()))
    T = list( map( int, input().split()))
    dp = [ [0]*(M+1) for _ in range(N+1)]
    memo = [ [0]*(M+1) for _ in range(N+1)]
    for i in range(N):
        for j in range(M):
            if S[i] == T[j]:
                dp[i+1][j+1] = (dp[i+1][j] + dp[i][j+1]+1)%Q
            else:
                dp[i+1][j+1] = (dp[i+1][j] + dp[i][j+1] - dp[i][j])%Q
    print(dp[N][M]+1)
if __name__ == '__main__':
    main()


Measured memory_bytes: 103644
#include <limits.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string.h>
#include <map>
#include <queue>
#include <functional>
#include <algorithm>
#include <numeric>

using namespace std;

typedef long	DWORD;
typedef unsigned long U_DWORD;
typedef long long QWORD;
typedef unsigned long long U_QWORD;
typedef short WORD;
typedef unsigned short U_WORD;
typedef bool	BOOL;

#define MAX_N		(100)
#define INF			(1000000000)

struct POINT{
	DWORD x;
	DWORD y;
};

struct EDGE{
	DWORD	 to;
	DWORD  cap;
	DWORD  rev;
};

DWORD N;
vector<POINT> vRed,vBlue;
vector<EDGE> G[1 + 1 + (MAX_N * 2)]; //隣接リストでグラフを表現
 BOOL used[1 + 1 + (MAX_N * 2)];

/* 
	0: source
	1: sink
	2~101: RED
	102~201:BLUE
*/
#define SRC			 (0)
#define SINK		 (1)
#define RED_OFS	 (2)
#define BLUE_OFS (102)


void addEdge(DWORD from, DWORD to, DWORD cap)
{
	EDGE stFrom = {to, cap, (DWORD)G[to].size()}; //sizeは、逆辺へのアクセスのために追加
	EDGE stTo = {from, 0, (DWORD)G[from].size()};
	G[from].push_back(stFrom);
	G[to].push_back(stTo);
}

void makeAllEdge()
{
	for (int r_idx = 0;  r_idx < N; r_idx++) {
		addEdge(SRC, RED_OFS + r_idx, 1);	// SRCからRED点までの辺
		addEdge(BLUE_OFS + r_idx, SINK, 1); //BLUEからSINKまでの辺

		for (int b_idx = 0; b_idx < N; b_idx++) {
			if ((vRed[r_idx].x < vBlue[b_idx].x) && (vRed[r_idx].y < vBlue[b_idx].y)) {
				addEdge(RED_OFS + r_idx, BLUE_OFS + b_idx, 1);  // REDとBLUEでペアが作れたら辺を張る
			}
		}
	}

}

DWORD dfs(DWORD v, DWORD t, DWORD f)
{
	if (v == t) return f;
	used[v] = true;
	for (int i = 0; i < G[v].size(); i++) {
		EDGE &e = G[v][i];

		if(!used[e.to] && e.cap > 0) {
			DWORD d = dfs(e.to, t, min(f, e.cap));
			if (d > 0) {
				e.cap  -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

DWORD maxFlow(DWORD s, DWORD t)
{
	DWORD flow = 0;

	while(1) {
		memset(used, 0, sizeof(used));
		DWORD f = dfs(s, t, INF);
		if (f == 0) return flow;
		flow += f;
	}

}

void Solve2DPlane()
{
	cin >> N;

	for (int i = 0; i < N; i++) {
		POINT newPoint;
		cin >> newPoint.x >> newPoint.y;
		vRed.push_back(newPoint);
	}
	for (int i = 0; i < N; i++) {
		POINT newPoint;
		cin >> newPoint.x >> newPoint.y;
		vBlue.push_back(newPoint);
	}	

	makeAllEdge();
	
	cout << maxFlow(SRC, SINK) << endl;

}

int main()
{
#ifdef FOR_IDE
	ifstream in("input.txt");
	cin.rdbuf(in.rdbuf());
#endif

	Solve2DPlane();
	
}


Measured memory_bytes: 512
#include<iostream>
#include<string>
#include <vector>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define vsort(v) sort(v.begin(), v.end())
#define ll long long
const ll MOD = 1e9 + 7;

int main() {
	int a, b;
	cin >> a >> b;
	int c = 0;
	for (int i = a; i <= b; i++) {
		if (i % 10 == (i / 10000) % 10 && (i / 10) % 10 == (i / 1000) % 10) c++;
	}
	cout << c << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <map>
using namespace std;
const long long MOD1 = 998244353;
const long long MOD2 = 1000000007;
const long long BASE = 1000000;
int main(){
	int N;
	cin >> N;
	string S;
	cin >> S;
	int tv = 0;
	int fv = N;
	while (fv - tv > 1){
		int mid = (tv + fv) / 2;
		vector<long long> hash1(N - mid + 1, 0);
		vector<long long> hash2(N - mid + 1, 0);
		for (int i = 0; i < N - mid + 1; i++){
			for (int j = 0; j < mid; j++){
				hash1[i] *= BASE;
				hash1[i] += S[i + j];
				hash1[i] %= MOD1;
				hash2[i] *= BASE;
				hash2[i] += S[i + j];
				hash2[i] %= MOD2;
			}
		}
		map<pair<int, int>, int> mp;
		bool ok = false;
		for (int i = 0; i < N - mid + 1; i++){
			if (mp.count(make_pair(hash1[i], hash2[i]))){
				if (i - mp[make_pair(hash1[i], hash2[i])] >= mid){
					ok = true;
				}
			} else {
				mp[make_pair(hash1[i], hash2[i])] = i;
			}
		}
		if (ok){
			tv = mid;
		} else {
			fv = mid;
		}
	}
	cout << tv << endl;
}

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

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

// 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 <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;

#define ll long long
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll Mypow(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}


ll INFL = 1LL << 60;//10^18 = 2^60
int INF = 1 << 30;//10^9
ll MOD  = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  if(a+b == c || a+c == b || b+c == a) cout << "Yes" << endl;
  else cout << "No" << endl;

}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;

int main(){
	int a,b;
	cin >> a >> b;
	if(a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) cout << "Possible";
	else cout << "Impossible";
}

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

#define ll long long
#define mod 1000000007
#define ffor(i,a,b) for(int i=a;i<b;i++)
#define bfor(i,a,b) for(int i=a-1;i>=b;i--)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mem(x,y) memset(x,y,sizeof(x))
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sz(x) (int)x.size()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI 3.14159265358979323846
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define endl '\n'

int main()
{
    

    ll n,k;
    cin>>n>>k;
    int vis[n+1]={0};
    int a[n+1];
    ffor(i,1,n+1) cin>>a[i];
    
    int x=1;
    vector<int> v;
    while(!vis[x])
    {
        vis[x]=1;
        v.pb(x);
        x=a[x];
    }
    if(k<sz(v)) cout<<v[k]<<endl;
    else
    {
        int i=0;
        while(v[i]!=x) i++;
        k-=i;
        vector<int> temp;
        while(i<sz(v))
        {
            temp.pb(v[i]);
            i++;
        }
        v=temp;
     //   for(auto i:v) cout<<i<<" ";
      //  cout<<endl;
        ll idx=k%sz(v);
      //  cout<<idx<<endl;
        cout<<v[idx];
    }

    return 0;
}



Measured memory_bytes: 6928
from bisect import bisect_left # 左から何番目に入るかを二分探索（O(logN)）で返す
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    L1 = L[i]
    for j in range(i+1, N):
        L2 = L[j]
        sumL = L1 + L2
        k = bisect_left(L, sumL)
        ans += max(0, k-j-1) # (k-1)-(j+1)+1

print(ans)

Measured memory_bytes: 3188
//Author : Prakhar Asaiya
#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(ll i = a; i < b; ++i)
#define REPN(i,a,b) for(ll i = a; i <= b; ++i)
#define REPV(i,a,b) for(ll i = a; i >= b; --i)
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define with_tests int t; cin>>t; while(t--){ solve(); }
#define without_tests solve();
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 100000000
#define ff first
#define ss second
const int M=1e9+7;

void solve()
{
	ll n;
	cin>>n;
	ll ans = 0;
	for(int i = 1; i < n; ++i)
	{
		ans += (n - 1)/i;
	}
	cout<<ans<<"\n";
}
 
int main()
{/*
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#*/
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  //with_tests;
  without_tests;
  return 0;
}

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

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

using ll = long long;
using ull = unsigned long long;

int main() {
  int n;
  int a[100] = {};
  cin >> n;
  rep(i, n) cin >> a[i];
  int ans = 0;
  rep(i, n) {
    int minj = i;
    for (int j = i; j < n; j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (a[i] != a[minj]) ans++;
    int tmp = a[i];
    a[i] = a[minj];
    a[minj] = tmp;
  }
  rep(i, n) {
    cout << a[i];
    if (i != n - 1) cout << ' ';
    else cout << endl;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3084
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A.sort()

    ma = A[-1]
    B = [0] * (ma + 1)

    ans = set()
    for a in A:
        if B[a] == 1:
            if a in ans:
                ans.remove(a)
            continue
        for aa in range(a, ma + 1, a):
            B[aa] = 1

        ans.add(a)

    print(len(ans))


if __name__ == '__main__':
    main()


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

int main(){
  int N;
  cin >> N;
  vector<int> e(N+1,0);
  for (int i=2; i<=N; i++){
    int cur = i;
    for (int j=2; j<=N; j++){
      while(cur%j==0){
        e[j]++;
        cur /= j;
      }
    }
  }
  vector<int> huga(101,0);
  for (auto k: e){
    if (k>=74) huga[75]++;
    if (k>=24) huga[25]++;
    if (k>=14) huga[15]++;
    if (k>=4) huga[5]++;
    if (k>=2) huga[3]++;
  }
  cout << huga[75]+huga[25]*(huga[3]-1)+huga[15]*(huga[5]-1)+huga[5]*(huga[5]-1)*(huga[3]-2)/2 << endl;
}


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

void Main() {
  int A, B;
  cin >> A >> B;
  int ans = 0;
  if (A > B) ans += A--;
  else ans += B--;
  if (A > B) ans += A--;
  else ans += B--;
  cout << ans << endl;
}

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		String a = s.substring(0, 1);
		String b = String.valueOf(s.length() - 2);
		String c = s.substring(s.length() - 1, s.length());
		
		System.out.println(a + b + c);
		
	}
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin)-1;i>=(end);i--)
#define IREP(i, n) IFOR(i,n,0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=("; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << ")" << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;


template<typename T> void readv(vector<T> &a) { REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a) { REP(i, a.size()) {cin >> a[i]; a[i]--;} }

ll mod = 1000000007;

int main()
{
	ll N;
	cin >> N;

	vec fac(N + 1, 1);
	vec A(N + 1);

	REP(i, N + 1) {
		A[i] = i;
	}

	FOR(i, 2, N + 1) {
		FOR(j, 2, N + 1) {
			if (A[i] % j == 0) {
				fac[j]++;
				A[i] /= j;
				j--;
			}
			if (A[i] == 1) break;
		}
	}

	ll ans = 1;
	FOR(i, 2, N + 1) {
		ans *= fac[i];
		ans %= mod;
	}

	ans %= mod;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

def solve():
    ans = 0
    for i in range(1, N + 1):
        if i % 5 != 0 and i % 3 != 0:
            ans += i
    return ans

if __name__ == "__main__":
    print(solve())

Measured memory_bytes: 9980
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define mod 1000000007
#define inp(arr,n) for(int i=0;i<n;i++) cin>>arr[i]
#define soa(arr,n) sort(arr,arr+n)
#define sov(arr) sort(arr.begin(),arr.end())
#define fr(i,a,b) for(int i=a;i<=b;i++)
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t=1;
    while(t--) {
        int n;
        cin>>n;
        ll arr[n];
        inp(arr,n);
        ll ans=0;
        fr(i,1,n-1){
            if(arr[i]<arr[i-1]){
                ans+=arr[i-1]-arr[i];
                arr[i]=arr[i-1];
            }
        }
        cout<<ans<<"\n";
    }
    return 0;
}


Measured memory_bytes: 5188
#include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nyan "(=^･ω･^=)"
#define mkp make_pair
#define lP pair<ll, ll>
#define iP pair<int,int>
typedef long long ll;
using namespace std;

int N, M, A[1000], B[1000], pa, pb, P;
ll res, cnt1, cnt2;

int f(int y, int x) {
	ll a = 1;
	for (int i = x; i > x - y; --i) {
		a *= i;
		a %= mod;
	}
	return a;
}

int main() {
	cin >> N >> M;
	for (int i = 0; i != N; ++i)
		cin >> A[i];
	for (int i = 0; i != M; ++i)
		cin >> B[i];
	sort(A, A + N);
	sort(B, B + M);
	for (int i = 0; i != N - 1; ++i) {
		if (A[i] == A[i + 1]) {
			cout << 0 << endl;
			return 0;
		}
	}
	for (int i = 0; i != M - 1; ++i) {
		if (B[i] == B[i + 1]) {
			cout << 0 << endl;
			return 0;
		}
	}
	for (int i = 0; i != N; ++i) {
		if (A[i] < (i + 1)*M) {
			cout << 0 << endl;
			return 0;
		}
	}
	for (int i = 0; i != M; ++i) {
		if (B[i] < (i + 1)*N) {
			cout << 0 << endl;
			return 0;
		}
	}
	if (A[N - 1] != N*M || B[M - 1] != N*M) {
		cout << 0 << endl;
		return 0;
	}
	res = 1;
	pa = pb = 1;
	P = N*M;
	while (pa != N || pb != M) {
		if (pa != N&&pb != M&&A[N - pa - 1] == B[M - pb - 1]) {
			res *= f(P - A[N - pa - 1] - 1, cnt1);
			cnt1 -= P - A[N - pa - 1] - 1;
			res %= mod;
			P = A[N - pa - 1];
			cnt1 += pa + pb;
			++pa;
			++pb;
		}
		else if (pb == M || A[N - pa - 1] > B[M - pb - 1]) {
			res *= f(P - A[N - pa - 1] - 1, cnt1);
			cnt1 -= P - A[N - pa - 1] - 1;
			res %= mod;
			res *= pb;
			res %= mod;
			P = A[N - pa - 1];
			++pa;
			cnt1 += pb - 1;
		}
		else {
			res *= f(P - B[M - pb - 1] - 1, cnt1);
			cnt1 -= P - B[M - pb - 1] - 1;
			res %= mod;
			res *= pa;
			res %= mod;
			P = B[M - pb - 1];
			++pb;
			cnt1 += pa - 1;
		}
	}
	res *= f(cnt1, cnt1);
	cout << res%mod << endl;
	return 0;
}

Measured memory_bytes: 256
require "set"
n = gets.chomp.to_i
a_arr = gets.chomp.split(" ").map(&:to_i)

hash = {}
set = Set.new
a_arr.each do |a|
  hash[a] ||= 0
  hash[a] += 1
  set << a
end

max = 10 ** 6 
hash.each do |k, v|
  i = v > 1 ? 1 : 2
  tmp = k * i
  while tmp <= max do
    set.delete(tmp)
    i += 1
    tmp = k * i
  end
end

puts set.size

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

int main(void){
    double a,b,C,S,L,h;

    scanf("%lf %lf %lf",&a,&b,&C);
    S = 0.5 * a * b * sin(2.0 * M_PI * C / 360.0);

    L = a + b + sqrt(a * a  + b * b - 2.0 * a * b * cos(2.0 * M_PI * C / 360.0));

    h = 2.0 * S / a;

   printf("%lf\n%lf\n%lf\n",S,L,h);
   return 0;
}



Measured memory_bytes: 2068
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << #x << ": " << x << endl;
#else
    #define debug(x)
#endif

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll N; cin >> N;
    vll p(N), a(N);
    rep(i, N) {
        cin >> p[i];
        p[i]--;
        a[p[i]] = i;
    }

    ll cnt = 1, tmp = 1;
    for(ll i = 1; i < N; i++) {
        if(a[i-1] < a[i]) tmp++;
        if(a[i-1] >= a[i] || i == N-1) {
            chmax(cnt, tmp);
            tmp = 1;
        }
    }
    cout << N - cnt << endl;
}


Measured memory_bytes: 3456
N = int(input())
As = [ int(x) for x in input().split() ]

ans = 0
while True:
    finished = False
    for i, A in enumerate(As):
        if A % 2 == 1:
            finished = True
            break
        As[i] /= 2
    if finished:
        break
    ans += 1

print(ans)


Measured memory_bytes: 3060
#define _USE_NATH_DEFINES
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
using namespace std;

int main() {
	string s;
	cin >> s;
	if (s.front() == s.back())
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    string x,y,z;
	cin >> x>> y>> z;
      cout << "A" <<y.substr(0, 1)<<"C"<< endl;
}

Measured memory_bytes: 256