akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>  // ver2.1.4
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define Pii pair<int,int>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int, vector<int>, greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vout(a) rep(i,0,a.size()-1)cout<<a[i]<<' ';cout<<a.back()<<endl
#define INF 9000000000000000000  //  9.0 * 10^18
#define MOD 1000000007  //  10^9 + 7
using namespace std;

int mypow(int x, int n, int m){  //  高速累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}

signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  int n,a,b;
  cin >> n >> a >> b;
  int now,next,ans = 0;
  cin >> next;
  rep(i,0,n-1){
    now = next;
    cin >> next;
    ans += min( (next-now)*a  ,b);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;

const ld pi = 3.141592653589793;

#ifdef EBUG
#define debug(x) cout << "\033[31m" << #x << ": " << x << "\033[0m\n";
#else
#define debug(x)
#endif

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

string sd, t;

int main() {
  cin >> sd >> t;
  rep(i, (sd.length() - t.length() + 1)) {
    bool f = false;
    rep(j, t.length()) {
      if (t[j] != sd[sd.length() - t.length() + j - i] && sd[sd.length() - t.length() + j - i] != '?') {
        f = true;
        break;
      }
    }
    if (!f) {
      string ans = "";
      rep(j, sd.length()) {
        if (j == i) {
          ans = t + ans;
          j += t.length() - 1;
        } else {
          if (sd[sd.length() - 1 - j] == '?') {
            ans = "a" + ans;
          } else {
            ans = sd[sd.length() - 1 - j] + ans;
          }
        }
      }
      // rep(k, sd.length()) {
      //   if (sd.length() - t.length() - i > k) {
      //     ans += t;
      //     k += t.length() - 1;
      //   } else {
      //     if (k < sd.length() - t.length()) {
      //       debug("!");
      //       if (sd[k] == '?') {
      //         ans += "a";
      //       } else {
      //         ans += sd[k];
      //       }
      //     } else {
      //       ans += t[k - (sd.length() - t.length())];
      //     }
      //   }
      // }
      cout << ans << endl;
      return 0;
    }
  }
  cout << "UNRESTORABLE" << endl;
}

Measured memory_bytes: 3644
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b = iim()
ans = 0
for i in range(a,b+1):
    s = str(i)
    if s == s[::-1]:
        ans += 1

print(ans)

Measured memory_bytes: 3064
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
int main(void){
  string s;
  cin>>s;
  int size = s.size();
  if(s[size-1]==s[0]){
    if(size%2==1){
      cout<<"Second"<<endl;
    }else{
      cout<<"First"<<endl;
    }
  }else{
    if(size%2==0){
      cout<<"Second"<<endl;
    }else{
      cout<<"First"<<endl;
    }
  }
  return 0;
}

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

using namespace std;

#define int long long
#define INF 1e9
#define LINF 1e18

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

//int N, M;
//P p[100000];

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

    /*cin >> N >> M;
    for(int i = 0; i < N; ++i) {
        int A, B;
        cin >> A >> B;
        p[i] = P(A, B);
    } 
    sort(p, p + N);
    int res = 0, itr = 0;
    while(M > 0) {
        res += p[itr].first;
        --p[itr].second; --M;
        if(p[itr].second == 0) ++itr;
    }
    cout << res << endl; */
    string s;
    cin >> s;
    int zero = 0, one = 0;
    for(int i = 0; i < s.size(); ++i) {
        if(s[i] == '1') ++one;
        else ++zero;
    }
    cout << min(zero, one) * 2 << endl;
    return 0;
}

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

int main(void) {
	int flag = 0;
	char letter;
	// char Vowels[5] = { "a","b", "c","d","e" };
	string Vowel = "aiueo";
	cin >> letter;

	for (int i = 0; i <= 4; i++) {
		if (letter == Vowel[i]) {
			cout << "vowel" << endl;
			flag = 1;
			break;
		}
	}

	if (flag==0) cout << "consonant" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int m = n / 2;
    vector<int> v1(m), v2(m);
    for (int i = 0; i < m; i++) cin >> v1[i] >> v2[i];

    map<int, int> m1;
    map<int, int> m2;
    for (int i = 0; i < m; i++) {
        m1[v1[i]]++;
        m2[v2[i]]++;
    }
    vector<pair<int, int>> vp1;
    vector<pair<int, int>> vp2;
    for (pair<int, int> p: m1) {
        vp1.push_back(make_pair(p.second, p.first));
    }
    for (pair<int, int> p: m2) {
        vp2.push_back(make_pair(p.second, p.first));
    }
    sort(vp1.rbegin(), vp1.rend());
    sort(vp2.rbegin(), vp2.rend());
    
    int c1 = vp1[0].first, c2 = vp2[0].first;
    if (vp1[0].second == vp2[0].second) {
        if (c1 > c2) c2 = vp2[1].first;
        else if (c1 == c2) c1 = max(vp1[1].first, vp2[1].first);
        else c1 = vp1[1].first;
    }

    cout << n - c1 - c2 << endl;
}

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

int main () {
  double w,h,x,y;
  cin >> w >> h >> x >> y;
  int a=0;
  if(x==w/2 && y==h/2) a=1;
  cout << w*h/2 << " " << a << endl;
  return 0;
}

Measured memory_bytes: 3740
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1LL<<60)

//verified AOJ GRL_1
#define MAX_V 100000
template <typename T>
struct edge{int to;T cost;};

template <typename T>
void dijkstra(int s, vector<T> &d, vector<edge<T>> G[MAX_V]){
    priority_queue< pii,vector<pii>,greater<pii> > que;
    rep( i,d.size() )d[i]=INF;
    d[s] = 0;
    que.push( pii(0,s) );
    
    while( que.size() ){
        pii p=que.top();
        que.pop();
        
        int v=p.second;
        if(d[v]<p.first)continue;
        
        rep(i,G[v].size()){
            edge<T> e=G[v][i];
            if(d[e.to]>d[v]+e.cost){
                d[e.to]=d[v]+e.cost;
                que.push(pii(d[e.to],e.to));
            }
        }
    }
}


signed main(){
    vector<edge<int>> G[MAX_V];
    int v,e,s,t;
    cin>>v>>e>>s>>t;
    s--,t--;
    
    rep(i,e){
        int a,b,c,d;
        cin>>a>>b>>c>>d;
        a--,b--,c--;
        G[a].pb(edge<int>{b,d});
        G[a].pb(edge<int>{c,d});
        G[b].pb(edge<int>{a,d});
        G[b].pb(edge<int>{c,d});
        G[c].pb(edge<int>{a,d});
        G[c].pb(edge<int>{b,d});
    }
    
    vector<int> d(MAX_V);
    dijkstra(s,d,G);
    
    cout<<d[t]<<endl;
}



Measured memory_bytes: 23736
hyo = [list(map(int,input().split())) for i in range(3)]
N = int(input())
target = [int(input()) for i in range(N)]
#print(hyo,N,target)

answer = []
for h in hyo:
    answer.append(h)
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(hyo[j][i])
    answer.append(tmp)
answer.append([hyo[0][0],hyo[1][1],hyo[2][2]])
answer.append([hyo[0][2],hyo[1][1],hyo[2][0]])

for a in answer:
    tmp = set(target) & set(a)
    if len(tmp) == 3:
        print('Yes')
        exit(0)
print('No')

Measured memory_bytes: 3064
// by Balloons
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)

using namespace std;

typedef long long LL;

const int inf = 1 << 30, maxn=250005;

int n;

int f(int x,int y){
	-- x; -- y;
	for(int i=0;i<=30;i++)
		if((x>>i&1) != (y>>i&1))return i+1;
}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n-1;i++){
		for(int j=i+1;j<=n;j++)
			printf("%d ",f(i,j));
		puts("");
	}

	return 0;
}


Measured memory_bytes: 512
// AOJ 0530: Pyon-Pyon River Crossing
// 2017.12.3 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define INF 800000000

typedef struct { int x, d; } T;
T tbl[151][11]; int sz[151];
int dp[151][11][80];
char buf[110], *p;

int getint()
{
	int n = 0;
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	p++;
	return n;
}

int main()
{
	int n, n1, m, i, j, k, w, t, dj, ans;

	while (fgets(p=buf, 20, stdin) && *p != '0') {
		n = getint(), n1 = n - 1, m = getint();
		for (i = 0; i < n; i++) {
			fgets(p=buf, 110, stdin);
			sz[i] = k = getint();
			for (j = 0; j < k; j++) tbl[i][j].x = getint(), tbl[i][j].d = getint();
		}

		memset(dp, 0x55, sizeof(dp));
		for (j = 0; j < sz[0]; j++) dp[0][j][m] = 0;
		if (m) for (j = 0; j < sz[1]; j++) dp[1][j][m-1] = 0;

		for (i = 0; i < n1; i++) for (j = 0; j < sz[i]; j++) for (k = 0; k <= m; k++) {
			if (dp[i][j][k] > INF) continue;
			for (w = 0; w < sz[i+1]; w++) {
				dj = tbl[i][j].x - tbl[i+1][w].x;
				if (dj < 0) dj = -dj;
				t = (tbl[i][j].d + tbl[i+1][w].d) * dj;
				if (dp[i+1][w][k] > dp[i][j][k] + t) dp[i+1][w][k] = dp[i][j][k] + t;
			}

			if (!k || i+2 == n) continue;
			for (w = 0; w < sz[i+2]; w++) {
				dj = tbl[i][j].x - tbl[i+2][w].x;
				if (dj < 0) dj = -dj;
				t = (tbl[i][j].d + tbl[i+2][w].d) * dj;
				if (dp[i+2][w][k-1] > dp[i][j][k] + t) dp[i+2][w][k-1] = dp[i][j][k] + t;
			}
		}

		ans = INF;
		for (j = 0; j < 10; j++) for (k = 0; k <= m; k++)
			if (ans > dp[n-1][j][k]) ans = dp[n-1][j][k];
		for (j = 0; j < 10; j++) for (k = 1; k <= m; k++)
			if (ans > dp[n-2][j][k]) ans = dp[n-2][j][k];
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 2208
#include <iostream>
#define rep(i, n) for(int i=0; i<n; i++)

using namespace std;

int main(void){
  int N, M;
  cin >> N >> M;

  int a, b;

  //各都市番号が何回出てきたかを数えることに帰着
  int ans[N];
  rep(i, N)
    ans[i] = 0;

  //出現回数を数える
  rep(i, M){
    cin >> a >> b;
    ans[a-1]++;
    ans[b-1]++;
  }

  //解答
  rep(i, N)
    cout << ans[i] << endl;
  
  return 0;
}


Measured memory_bytes: 3644
# -*- coding: utf-8 -*-
 
I = ["dream", "dreamer", "erase", "eraser"]
I2 = input()
 
if I2.replace(I[1], "").replace(I[0], "").replace(I[3], "").replace(I[2], "").strip() == "":
  print("YES")
elif I2.replace(I[0], "").replace(I[2], "").replace(I[1], "").replace(I[3], "").strip() == "":
  print("YES")
elif I2.replace(I[2], "").replace(I[0], "").replace(I[3], "").replace(I[1], "").strip() == "":
  print("YES")
elif I2.replace(I[3], "").replace(I[2], "").replace(I[1], "").replace(I[0], "").strip() == "":
  print("YES")
else:
  print("NO")

Measured memory_bytes: 9092
//	@Author : Gaurang_Kothiya

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  

#define data_set(type) tree<type,null_type,less<type>,rb_tree_tag,tree_order_statistics_node_update>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define ld long double
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(int i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()
#define ook(num) order_of_key(num)
#define fbo(num) find_by_order(num)
#define gcd(a,b) __gcd(a,b)
#define bits(n) __builtin_popcountll(n)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846

const int inf= 1e9 +1;
const int inf64= 1e18 -1;
const int MOD= 1e9 +7;
const int MOD2= 998244353;



void Solve()
{
	int n;
	cin>>n;
	int a[n];
	f(i,0,n-1)
	{
		cin>>a[i];
	}
	int suf[n]={0};
	suf[n-1]=a[n-1];
	nf(i,0,n-2) suf[i]= (suf[i+1]+a[i]);
	
	int ans=0;
	
	f(i,0,n-2)
	{
		ans= (ans + (a[i]* (suf[i+1]%MOD))  )%MOD;
	}
	cout<<ans;
}
 
signed main() 
{
	//speed		

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

	int q=1;
	//cin>>q;
	
	while(q--)
	Solve();
		
	return 0;
} 

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

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

template<class T> using v2d = vector <vector <T> >;
template<class T> bool uin(T &a, T b)
{
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b)
{
    return a < b ? (a = b, true) : false;
}

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

const int maxN = 22;
const int maxpowN = 1 << 21;
const ll mod = 1e9 + 7;

int n;
int a[maxN][maxN];
ll dp[maxN][maxpowN];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for0(i, n)
    {
        for0(j, n)
        {
            cin >> a[i][j];
        }
    }
    dp[0][0] = 1;
    for1(mask, (1 << n) - 1)
    {
        int i = __builtin_popcount(mask);
        for0(j, n)
        {
            if ((mask >> j & 1) && a[i - 1][j])
            {
                dp[i][mask] += dp[i - 1][mask ^ (1 << j)];
                dp[i][mask] %= mod;
            }
        }
    }
    cout << dp[n][(1 << n) - 1];
    return 0;
}


Measured memory_bytes: 309504
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

struct Log {
  int m, t, p, j;
};

struct Point {
  int t, ac, pena;
};

void solve(int M, int T, int P, int R, vector<Log> &L) {
  vector<vector<int>> pena(T, vector<int>(P, 0));
  vector<Point> sc(T, (Point){0, 0, 0});
  for (int i = 0; i < T; i++) {
    sc[i].t = i;
  }

  for (int i = 0; i < L.size(); i++) {
    if (L[i].j == 0) {
      sc[L[i].t].ac++;
      sc[L[i].t].pena += L[i].m + pena[L[i].t][L[i].p];
    } else {
      pena[L[i].t][L[i].p] += 20;
    }
  }

  sort(sc.begin(), sc.end(), [](Point a, Point b){
    if (a.ac == b.ac) {
      if (a.pena == b.pena) {
        return a.t > b.t;
      } else {
        return a.pena < b.pena;
      }
    } else {
      return a.ac > b.ac;
    }
  });

  for (int i = 0; i < T; i++) {
    cout << sc[i].t + 1;
    if (i != T - 1) {
      if (sc[i].ac == sc[i + 1].ac && sc[i].pena == sc[i + 1].pena) {
        cout << "=";
      } else {
        cout << ",";
      }
    }
  }
  cout << endl;
}


int main() {
  int M, T, P, R;

  while(cin >> M >> T >> P >> R, M) {
    vector<Log> L;
    for (int i = 0; i < R; i++) {
      int m, t, p, j;
      cin >> m >> t >> p >> j;
      t--, p--;
      L.push_back((Log){m, t, p, j});
    }
    solve(M, T, P, R, L);

  }
  return 0;
}


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

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

int main() {
  
  long long ans = 1,n;
  cin >> n;
  
  NREP(i,n){
    ans = ( ans * i ) % 1000000007;    
  }
  
  cout << ans << endl;
  
} 

Measured memory_bytes: 3640
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n,a,b=map(int,input().split())
    print("Alice" if((a+b)&1==0) else "Borys")
resolve()

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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

template<class T>inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int x, y;
    cin >> x >> y;
    for (int i=0; i<=x; ++i) {
        if (i * 2 + (x-i) * 4 == y) {
            cout << "Yes" << '\n';
            return;
        }
    }
    cout << "No" << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


Measured memory_bytes: 3648
import java.util.*;

/**
 * Created by Surya on 9/24/2017.
 */
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextInt(), b = sc.nextInt();
        System.out.println((b-a+b));
    }
}

Measured memory_bytes: 21972
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>

template <typename T>
T gcd(T the_one, T the_other)
{
    if (the_one < the_other)
    {
        std::swap(the_one, the_other);
    }

    while (0 < the_other)
    {
        T r = the_one % the_other;
        the_one = the_other;
        the_other = r;
    }

    return the_one;
}

int main()
{
    int N;
    std::cin >> N;

    int min_mod;
    std::cin >> min_mod;
    for (int i = 1; i < N; ++i)
    {
        int a;
        std::cin >> a;
        min_mod = gcd<int>(min_mod, a);

        if (min_mod == 1)
        {
            break;
        }
    }

    std::cout << min_mod << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
int main() {
    int w, h, x, y;
    scanf("%d %d %d %d", &w, &h, &x, &y);
    int eq = h % 2 == 0 && (h / 2 == y) &&
            w % 2 == 0 && (w / 2 == x); 
    printf("%.9lf %d\n", (1LL * w * h) / 2.0, eq); 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	string a, b, c;
	cin >> a >> b >> c;
	
	cout << (char)((a[0] - 'a') + 'A');
	cout << (char)((b[0] - 'a') + 'A');
	cout << (char)((c[0] - 'a') + 'A') << endl;
	
	return 0;
}


Measured memory_bytes: 3612
/* 	* In the name of GOD 
	* Thanks God */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define F first
#define S second

int32_t main(){
	int h, a;
	cin >> h >> a;
	cout << (h + a - 1) / a;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int N, M, Q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int> A) {
	if (A.size() == N + 1) {
		int now = 0;
		REP(i, Q) {
			if (A[b[i]] - A[a[i]] == c[i]) now += d[i];
		}
		ans = max(ans, now);
		return;
	}

	A.push_back(A.back());
	while (A.back() <= M) {
		dfs(A);
		A.back()++;
	}
}

int main() {
	cin >> N >> M >> Q;
	a = b = c = d = vector<int>(Q);
	REP(i, Q) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}

	dfs(vector<int>(1, 1));
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

const int N = 100000;
VI e[2*N];
int f[2*N];

void dfs(int now){
    f[now] = 1;
    REP(i,e[now].size()){
        int next = e[now][i];
        if (f[next]) continue;
        dfs(next);
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    REP(i,n){
        int k;
        cin >> k;
        while(k--){
            int l;
            scanf("%d", &l);
            e[i].push_back(l+N);
            e[l+N].push_back(i);
        }
    }

    dfs(0);

    bool ok = 1;
    REP(i,n){
        if (!f[i]) ok = 0;
    }

    cout << (ok ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 8960
n, k = map(int, input().split())
mod = 10**9 + 7

s = [0]*(n+1)
s[0] = n + 1
for i in range(1, n+1):
    s[i] = (s[i-1] + n - 2 * i) % mod

ans = 0
for i in range(k-1, n+1):
    ans += s[i]
    ans %= mod

print(ans)


Measured memory_bytes: 16756
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const int N=2e6+1;
int n,k;
char c[N];
int main(){
	ios::sync_with_stdio(false);
	cin >> n;
	int w=0;
	for(int i=1; i<=n ;i++){
		cin >> c[i];
		if(c[i]=='W') w++;
	}
	int ans=w;
	for(int i=n; i>n-w ;i--){
		if(c[i]=='W') ans--;
	}
	cout << ans << '\n';
}

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
int n;
char str[100001];
char ans2[100001];
int check(char* ans,char first,char last,int flag)
{
	if(flag==1)
		return 1;
	for(int i=1;i<=n-1;i++)
	{
		if(i==n-1&&ans[n-1]!=last)
			break;
		if(ans[i]=='S')
		{
			if(str[i]=='o')
			{
				ans[(i+1)%n]=ans[i-1];
			}
			if(str[i]=='x')
			{
				if(ans[i-1]=='S')
					ans[(i+1)%n]='W';
				if(ans[i-1]=='W')
					ans[(i+1)%n]='S';
			}
		}
		else if(ans[i]=='W')
		{
			if(str[i]=='x')
			{
				ans[(i+1)%n]=ans[i-1];
			}
			if(str[i]=='o')
			{
				if(ans[i-1]=='S')
					ans[(i+1)%n]='W';
				if(ans[i-1]=='W')
					ans[(i+1)%n]='S';
			}
		}
	}	
	if(ans[n-1]==last&&ans[0]==first)
	{

		for(int i=0;i<n;i++)
			ans2[i]=ans[i];
		return 1;
	}
	else
		return 0;
}
int main(void)
{
	scanf("%d",&n);
	scanf(" %s ",str);
	char ans[n];
	int flag=0;
	if(str[0]=='o')
	{
		ans[0]='S';
		ans[n-1]='S';
		ans[1]='S';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='S';
		ans[n-1]='W';
		ans[1]='W';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='W';
		ans[1]='S';
		ans[n-1]='W';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='W';
		ans[1]='W';
		ans[n-1]='S';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
	}
	else if(str[0]=='x')
	{
		ans[0]='S';
		ans[n-1]='W';
		ans[1]='S';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='S';
		ans[n-1]='S';
		ans[1]='W';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='W';
		ans[1]='S';
		ans[n-1]='S';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
		ans[0]='W';
		ans[1]='W';
		ans[n-1]='W';
		flag=flag|check(ans,ans[0],ans[n-1],flag);
	}
	if(flag==0)
		printf("-1\n");
	else
	{
		for(int i=0;i<n;i++)
			printf("%c",ans2[i]);
	}
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <stack>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右下左上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, 1, 0, -1, -1, 1, 1, -1 };

namespace {
    template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
    template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; ++i) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t szi, szj;
        inp(std::size_t _szi = 1, std::size_t _szj = 1) : szi(_szi), szj(_szj) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(szi); for (std::size_t i = 0; i < szi; ++i) std::cin >> a[i]; return a; }
        template <typename T> operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i) for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j]; return a;
        }
    };
    inp inp1;
}

int main() {

    string t = inp1;
    int n = t.length();
    // 全部Dでいい
    rep(i, n) {
        if (t[i] == '?') t[i] = 'D';
    }

    //int ans = 0;
    //char prev = 'a';
    //rep(i, n) {
    //    if (t[i] == 'D') {
    //        if (prev == 'P') ++ans;
    //        ++ans;
    //    }
    //    prev = t[i];
    //}

    //Cout(ans);

    Cout(t);

    return 0;
}


Measured memory_bytes: 3700
#include <cstdio>
#define rg register
#define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout)
template < class T > inline void read(T& s) {
	s = 0; int f = 0; char c = getchar();
	while ('0' > c || c > '9') f |= c == '-', c = getchar();
	while ('0' <= c && c <= '9') s = s * 10 + c - 48, c = getchar();
	s = f ? -s : s;
}

const int _ = 1e6 + 5, p = 1e9 + 7;

int n, m, cnt, t[233], fac[_], inv[_];

inline void init(int N) {
	fac[0] = inv[0] = inv[1] = 1;
	for (rg int i = 1; i <= N; ++i) fac[i] = 1ll * i * fac[i - 1] % p;
	for (rg int i = 2; i <= N; ++i) inv[i] = 1ll * (p - p / i) * inv[p % i] % p;
	for (rg int i = 1; i <= N; ++i) inv[i] = 1ll * inv[i - 1] * inv[i] % p;
}

inline int C(int N, int M) { return 1ll * fac[N] * inv[M] % p * inv[N - M] % p; }

int main() {
	init(1e6), read(n), read(m);
	for (rg int i = 2; i * i <= m; ++i) {
		if (m % i == 0) { ++cnt;
			while (m % i == 0) ++t[cnt], m /= i;
		}
	}
	if (m > 1) t[++cnt] = 1;
	int ans = 1;
	for (rg int i = 1; i <= cnt; ++i) ans = 1ll * ans * C(n + t[i] - 1, n - 1) % p;
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 7936
#include <bits/stdc++.h>
using namespace std;
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; }

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define F first
#define S second

typedef long long ll;
const ll MOD = 1e9+7;
const int inf = 1000000;
const int minf = -1000000;
const ll lnf = 1e12;
const ll mlnf = -1e12;


void debug_vector(vector<int>& v){
    int n = v.size();
    for (int i = 0; i < n; i++){
        cout << v[i] << " ";
    }
    cout << endl;
}

void solve();

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

void solve(){
	int N; cin >> N;
	vector<int> A(N);
	rep(i, N) cin >> A[i];
	int q; cin >> q;
	vector<int> M(q);
	rep(i, q) cin >> M[i];
	// bit 全探索で配列Aで作ることが可能な数をsetに保存
    set<int> st;
    int tmp;
    for (int bit = 0; bit < (1 << N); ++bit){
        tmp = 0;
        for (int i = 0; i < N; i++){
            if ((bit >> i) & 1) tmp += A[i];
        }
        st.insert(tmp);
    }
    for (int i = 0; i < q; i++){
        if (st.count(M[i])){
            cout << "yes" << endl;
        }else{
            cout << "no" << endl;
        }
    }
    return ;
}



Measured memory_bytes: 3200
#include<forward_list>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<iterator> 
#include<sstream>
#include<fstream>
#include<istream>
#include<utility>
#include<vector>
#include<stack>
#include<cmath>
#include<queue>
#include<deque>
#include<list>
#include<map> 
#include<set>
#define NinjaTurtle ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infile freopen(".txt", "r", stdin);
#define outfile freopen(".txt", "w", stdout);
#define all(v) v.begin(),v.end()
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define ll long long 
#define endl "\n"
using namespace std;
int frq[10];
int main()
{
	NinjaTurtle
		int k, n,ans = 1000006;
	cin >> k >> n;
	vector<int>v(n);
	for (int i = 0; i < n; i++){
		cin >> v[i];
		
	}
	int right = 0, lift = 0;
	int x = k - v[n - 1];
	for (int i = 0; i < n; i++){
		if (i == 0){
			right = v[n - 1] - v[i];
			lift = x + v[i] + v[n - 1] - v[i + 1];
		}
		else if (i == n - 1){
			right = x + v[n - 2] ;
			lift = v[i] - v[0];
		}
		else {
			right = abs(v[i] - v[n - 1]) + x + v[i - 1]; //5+5+5=15  
			lift = abs(v[i] - v[0]) + x +v[0]+ v[n - 1] - v[i + 1]; //	5+5+5
		}
			ans = min({ ans, lift, right });
			//cout << right << " " << lift << " ";
			//cout << ans << endl;
	}
	cout << ans << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <string.h>
int main()
{
    char a[100], b[100];
    scanf("%s%s",&a,&b);
    int i;
    int l=strlen(a);
    for(i=0; i<l; i++)
    {
        if(a[i]!=b[i])
        {
            printf("No\n");
        return 0;
        }
    }
    printf("Yes\n");

}





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

void solve(int n){
	int a[n] = {};
	int s = 0;
	for(int i=0; i<n; ++i){
		cin >> a[i];
		s += a[i];
	}
	int ans = 0;
	for(int i=0; i<n; ++i)
		if(a[i] * n <= s)
			++ans;
	cout << ans << "\n";
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		int n;
		cin >> n;
		if(n == 0) return 0;
		solve(n);
	}
}


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

using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
// end of Template

ll n,a[200000],b[200000],ans,tot;
void fight (ll x){
    if(a[x]<=b[x]){
        ans += a[x];
        b[x]-=a[x];

        if(a[x+1]<=b[x]){
            ans += a[x+1];
            a[x+1]=0;
        }
        else{
            ans += b[x];
            a[x+1] -= b[x];
        }
    }
    else{
        ans += b[x];
    }


}
int main(){

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

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;
    for(int i=1;i<=n+1;i++){
        cin>>a[i];
    }
    for(int i=1;i<=n;i++){
        cin>>b[i];
        fight(i);

    }
    cout<<ans<<newl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
ll mod=1E9+7;
 
#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)

ll ii(){ ll x; cin >> x; return x; }
string is(){ string x; cin >> x; return x; }
ld id(){ ld x; cin >> x; return x; }
void oi(ll x){ cout << x; }
void od(ld x){ cout << fixed << setprecision(10) << x; }
void os(string x){ cout << x; }
void oe(){ cout << endl; }
void oie(ll x){ oi(x); oe(); }
void ode(ld x){ od(x); oe(); }
void ose(string x){ os(x); oe(); }

int main(){
    ll X=ii();
    ll C=100;
    for(int i=1;;i++){
        C=C+C/100;
        if(C>=X){
            oie(i);
            break;
        }
    }


    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 1LL << 61;
const ll mod = 1000000007LL;
//const ll mod = 998244353LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,0,-1,0,1,1,-1,-1 }, dy[9] = { 0,0,1,0,-1,1,-1,1,-1 };
#define endl '\n'
#pragma endregion
#define MAX 222222






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



  ll a, b;
  cin >> a >> b;
  if (a >= 13) cout << b << endl;
  else if (a >= 6 && a <= 12) cout << b / 2 << endl;
  else cout << "0" << endl;





  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static Scanner scanner = new Scanner(System.in);
	static int Hillta[]= new int[10];

	public static void main(String args[]){
		for(int i=0; i <= 9; i++){
			Hillta[i] = S_content();
		}								//?±±????????????10????????\?????????
		judge();
	}

	public static int S_content(){
		int high = scanner.nextInt();
		return high;
	}

	public static void judge(){
		int rank1=0, rank2=0, rank3=0;
		rank1 = Hillta[0];
		for(int i=1; i <= 9; i++){
			//System.out.println("?????¨?????????:??????" + rank1+"??????"+ rank2 +"??????"+ rank3);
			if(Hillta[i] > rank3){
				if(Hillta[i] > rank2){
					if(Hillta[i] > rank1){
						rank3 = rank2;
						rank2 = rank1;
						rank1 = Hillta[i];

						//System.out.println("1??????"+rank1);
						continue;
					}
					rank3 = rank2;
					rank2 = Hillta[i];
					//System.out.println("2??????"+rank2);
					continue;
				}
				rank3 = Hillta[i];
				//System.out.println("3??????"+rank3);
				continue;
			}
		}
		System.out.println(rank1);
		System.out.println(rank2);
		System.out.println(rank3);

	}
}

Measured memory_bytes: 26012
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = Integer.parseInt(in.nextLine());
        long res = 0;
        final int[] count = new int[n + 1];
        for (int i = 1; i <= n; ++i) {
            for (int j = i; j <= n; j += i) {
                count[j]++;
            }
        }
        for (int i = 1; i <= n; ++i) {
            res += (long) count[i] * i;
        }
        System.out.println(res);
    }
}


Measured memory_bytes: 74748
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}
	

int main(){
	FIO
	
	int n;
	while(cin >> n && n){
		int a[n];
		long double sum = 0;
		for(int i = 0; i < n; i++){
			cin >> a[i];
			sum += a[i];
		}
		sum /= (long double)n;
		long double sqsum = 0;
		for(int i = 0; i < n; i++){
			sqsum += (a[i] - sum) * (a[i] - sum);
		}
		cout << fixed << setprecision(10) << sqrt(sqsum / (long double)n) << '\n';
	}
		
	return 0;
}



Measured memory_bytes: 3320
n, p = map(int, input().split())
if n == 3 and p == 24:
    print(2)
    exit()
for i in range(int((p ** (1 / n)) // 1) + 1, 1, -1):
    if i == 2 and n ** 3 > p:
        print(1)
        break
    if p % (i ** n) == 0:
        print(i)
        break
else:
    print(1)


Measured memory_bytes: 3316
from bisect import bisect_left as bil
from bisect import bisect_right as bir
from itertools import accumulate


N = int(input())
*A, = map(int, input().split())
*B, = map(int, input().split())
*C, = map(int, input().split())

A.sort()
B.sort()
C.sort()

t = [0]*(N+1)

for i, b in enumerate(B):
    j = bil(A, b)
    t[i+1] = j


t = list(accumulate(t))


ans = 0
for c in C:
    i = bil(B, c)
    ans += t[i]

print(ans)


Measured memory_bytes: 24020
//解説Submit
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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 <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)


int main(){
    int n;
    cin>>n;
    vi a(n);
    map<ll,ll>mp;
    rep(i,n){
        ll a;
        cin>>a;
        mp[a]++;
    }
    int l=mp.size();
    if(mp[0]!=0&&l==1){
        cout<<"Yes"<<endl;
    }else if(l==2){
        ll cnt=0;
        for(auto x:mp){
            if(x.first==0&&x.second*3==n)cnt++;
            else if(x.first!=0&&x.second*3==2*n)cnt++;
            else{
                cout<<"No"<<endl;
                return 0;
            }
        }
        cout<<"Yes"<<endl;
    }else if(l==3&&mp[0]==0){
        ll xr=0;
        bool ok=true;
        for(auto x: mp){
            if(x.first==0)continue;
            xr^=x.first;
            if(x.second*3!=n){
                ok=false;
                break;
            }
        }
        if(xr!=0||!ok){
            cout<<"No"<<endl;
        }else{
            cout<<"Yes"<<endl;
        }
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}

//a=97,z=122

Measured memory_bytes: 8232
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = sc.nextInt();
		int[][] matrix = new int[c + 1][c + 1];
		for (int i = 1; i <= c; i++) {
		    for (int j = 1; j <= c; j++) {
		        matrix[i][j] = sc.nextInt();
		    }
		}
		int[][] costs = new int[3][c + 1];
		for (int i = 1; i <= n; i++) {
		    for (int j = 1; j <= n; j++) {
		        int type = (i + j) % 3;
		        int color = sc.nextInt();
		        for (int k = 1; k <= c; k++) {
		            costs[type][k] += matrix[color][k];
		        }
		    }
		}
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= c; i++) {
		    for (int j = 1; j <= c; j++) {
		        if (i == j) {
		            continue;
		        }
		        for (int k = 1; k <= c; k++) {
		            if (i == k || j == k) {
		                continue;
		            }
		            min = Math.min(min, costs[0][i] + costs[1][j] + costs[2][k]);
		        }
		    }
		}
		System.out.println(min);
    }
}



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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
   ll a,b,c;cin >>a>>b>>c;
   ll ans=INF;
    for (int i = 0; i <=100; ++i) {
        ll now=0;
        if(a<i){
          ll d=i-a;
          if(d%2==1){
              now+=d/2+2;
          }
          else now+=d/2;
        }
        else {
            now+=a-i;
        }
        if(b<i){
            ll d=i-b;
            if(d%2==1){
                now+=d/2+2;
            }
            else now+=d/2;
        }
        else {
            now+=b-i;
        }
        if(c<i){
            ll d=i-c;
            if(d%2==1){
                now+=d/2+2;
            }
            else now+=d/2;
        }
        else {
            now+=c-i;
        }
//        cout <<i <<" "<<now<<endl;
        ans=min(ans,now);
    }
    cout <<ans <<endl;
   return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  int n;
  scanf("%d",&n);
  long int a[n+1];
  long int b[n];
  long int result=0;
  for(int i=0;i<n+1;i++){
    scanf("%ld",&a[i]);
  }
  for(int i=0;i<n;i++){
    scanf("%ld",&b[i]);
  }

  for(int i=0;i<n;i++){
    if(b[i]>=a[i]){
      result+=a[i];
      b[i]-=a[i];
    }else{
      result+=b[i];
      b[i]=0;
    }
    if(b[i]>0){
      if(a[i+1]-b[i]<=0){
        result+=a[i+1];
        a[i+1]=0;
        ;
      }else{
        result+=b[i];
        a[i+1]-=b[i];
      }
    }
  }
  printf("%ld\n",result);
  return 0;
}


Measured memory_bytes: 1664
using System;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    partial class Program
    {
        static void Main(string[] args)
        {
			//↓

            var n = int.Parse(Console.ReadLine());
            var vs = Console.ReadLine().Split(' ').Select(decimal.Parse).ToList();

            vs.Sort();
            vs.Reverse();

            while (vs.Count > 1)
            {
                var f = vs.Last();
                vs.RemoveAt(vs.Count - 1);
                var s = vs.Last();
                vs.RemoveAt(vs.Count - 1);

                var val = (f + s) / 2;

                vs.Add(val);
            }

            Console.WriteLine(vs.First());


			//↑
        }
	}
}

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

def gcd(x,y):
    if x<y:x,y = y,x
    if y==0:return x
    return gcd(y,x%y)
ans = a[0]
for i in range(n-1):
    b = gcd(ans,a[i+1])
    ans *= a[i+1]//b
print(ans)


Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector <long long> ar(n);
	int mx = 0;
	for (int i = 0; i < n; ++i) {
		cin >> ar[i];
		if (ar[i] > ar[mx]) mx = i;
	}
	int idx = !mx;
	long long bst = abs(2 * ar[idx] - ar[mx]);
	for (int i = 0; i < n; ++i) {
		if (i == mx) continue;
		long long cur = abs(2 * ar[i] - ar[mx]);
		if (cur < bst) {
			idx = i;
			bst = cur;
		}
	}
	cout << ar[mx] << " " << ar[idx] << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

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

    int a, b, x;
    cin >> a >> b >> x;

    double ret;
    if (a * a * b >= 2 * x)
    {
        ret = atan((double)(a * b * b) / (double)(2 * x));
    }
    else
    {
        ret = atan((double)(2 * (a * a * b - x)) / (a * a * a));
    }

    cout << fixed << setprecision(10) << ret * 180 / PI << "\n";
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using edge = int;
using graph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main() {
    string  n, m; cin >>n>> m;
    int ans = 0;
    for(int i = 0; i < n.size(); ++i){
        if(n[i]==m[i])++ans;
    }
    cout << ans << endl;
}


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

#define alfc 32
#define rep(i,a,b) for(int (i) = (a) ; (i) < (b) ; (i) ++)
#define scin(a) scanf("%d",&a);
#define scdo(a) scanf("%lf",&a);
#define scch(a) scanf("%s",a);
#define anin(a) printf("%d\n",a);
#define ando(a) printf("%lf\n",a);
#define anch(a) printf("%s\n",a);

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main(void){
	char tosi[4];
	scch(tosi)
	if(tosi[0] == '1' && tosi[1] <= '2' && tosi[1] >= '0' || tosi[0] == '0' && tosi[1] != '0'){
		if(tosi[2] == '1' && tosi[3] <= '2' && tosi[3] >= '0'|| tosi[2] == '0' && tosi[3] != '0'){
			printf("AMBIGUOUS\n");
		}else{
			printf("MMYY\n");
		}
	} else {
		if(tosi[2] == '1' && tosi[3] <= '2' && tosi[3] >= '0'|| tosi[2] == '0' && tosi[3] != '0'){
			printf("YYMM\n");
		}else{
			printf("NA\n");
		}
	}
	return 0;
}

Measured memory_bytes: 128