akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		String S = sc.next();
		if(S.length() > K){
			S = S.substring(0,K) + "...";
		}
		System.out.println(S);
	}
}

Measured memory_bytes: 27096
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


const ll MOD = 1e9 + 7;
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
const int MAXN = 1300;
int n, k;

int go[MAXN];

ll fc[MAXN];
ll bfc[MAXN];
ll bpw2[MAXN];
ll dp[610][610];
ll dp2[610][610];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	fc[0] = 1;
	for (int i = 1; i < MAXN; ++i)
		fc[i] = (fc[i - 1] * i) % MOD;
	for (int i = 0; i < MAXN; ++i)
		bfc[i] = pw(fc[i], MOD - 2);
	ll B2 = pw(2, MOD - 2);
	bpw2[0] = 1;
	for (int i = 1; i < MAXN; ++i)
		bpw2[i] = (bpw2[i - 1] * B2) % MOD;
	cin >> n >> k;
	for (int i = 0; i < 2 * n; ++i)
		go[i] = -1;
	for (int i = 0; i < k; ++i) {
		int a, b;
		cin >> a >> b;
		--a, --b;
		go[a] = b;
		go[b] = a;
	}
	n *= 2;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; j += 2) {
			int cnt = j - i + 1;
			int fl = 0;
			for (int x = i; x <= j; ++x)
				if (go[x] != -1) {
					--cnt;
					if (go[x] < i || go[x] > j) {
						fl = 1;
						break;
					}
				}
			if (!fl) {
				dp[i][j] = fc[cnt] * bfc[cnt / 2] % MOD * bpw2[cnt / 2] % MOD;
			}
		}
	}
	ll ans = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; j += 2) {
			int cnt = n - (j - i + 1);
			int fl = 0;
			for (int x = 0; x < i; ++x) {
				if (go[x] != -1) {
					--cnt;
					if (i <= go[x] && go[x] <= j) {
						fl = 1;
						break;
					}
				}
			}
			for (int x = j + 1; x < n; ++x) {
				if (go[x] != -1) {
					--cnt;
					if (i <= go[x] && go[x] <= j) {
						fl = 1;
						break;
					}
				}
			}
			if (fl)
				continue;
			ll gg = fc[cnt] * bfc[cnt / 2] % MOD * bpw2[cnt / 2] % MOD;
			ll now = dp[i][j];
			for (int x = i + 1; x < j; x += 2) {
				now = (now - dp2[i][x] * dp[x + 1][j]) % MOD;
			}
			if (now < 0)
				now += MOD;
			dp2[i][j] = now;
			ans = (ans + gg * now) % MOD;
		}
	}
	cout << ans << "\n";
	return 0;
}




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

int main() {
  int N;
  cin >> N;
  int c = 0;
  int d = 1;
  for (int i = 0; i < 8; i++) {
    c += (N % (10 * d)) / d;
    d *= 10;
  }
  cout << ((0 == (N % c))? "Yes":"No") << endl;
}



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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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






int main()
{
    FAST();

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

    int i,l,ans=1;
    string s;
    cin >> l >> s;
    for(i=1;i<l;i++)
    {
        if(s[i] != s[i-1])++ans;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  int n;
  cin >> n;
  string a;
  cin >> a;
  char now = a[0];
  int count = 1;
  for(int i=1;i<n;i++){
    if(now==a[i]) continue;
    now = a[i];
    count++;
  }
  cout << count << endl;
}



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

int main() {
    int n;
    double avr = 0;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) std::cin >> a[i];
    for (auto el : a) avr += el;
    avr = avr / (double)n;
    std::set<std::pair<double, int>> s;
    for (int i = 0; i < n; i++) s.emplace(std::abs(avr - a[i]), i);
    std::cout << s.begin()->second << std::endl;

    return 0;
}

Measured memory_bytes: 256
import math
a,b,x = map(int,input().split())
y = x/(a*a)
if y < b/2:
  ya = y*a
  h = 2*ya/b
  print(math.atan2(b,h)*180/math.pi)
else:
  print(math.atan2(2*(b-y),a)*180/math.pi)

Measured memory_bytes: 3060
S = gets.to_s.chomp!

arr = S.split('')
uniq_arr = arr.uniq
first = uniq_arr[0]
second = uniq_arr[1]
if uniq_arr.size == 2 && arr.count(first) == 2 && arr.count(second) == 2
  puts 'Yes'
else
  puts 'No'
end


Measured memory_bytes: 1788
#include <iostream>
using namespace std;
 
int main() {
	int k,x,y;
	cin>>k;
	x=0;
	y=0;
	for(int i=1;i<=k;i++){
		if(i%2==0){
			x++;
		}
		else{
			y++;
		}
	}
	cout<<x*y<<endl;
}

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

using lint = long long;

struct edge {
  int to, cost;
  edge() {}
  edge(int a, int b) :to(a), cost(b) {}
};

const lint inf = 1001001001001001001;
vector<vector<edge>> G;
vector<lint> d;

bool bellman_ford(int n, int s = 0) {
  d = vector<lint>(n, inf);
  d[s] = 0;

  for (int i = 0; i < n; ++i) {
    for (int v = 0; v < n; ++v) {
      for (int j = 0; j < G[v].size(); ++j) {
        edge e = G[v][j];
        if (d[e.to] > d[v] + e.cost) {
          d[e.to] = d[v] + e.cost;
          if (i == n - 1 && e.to == n - 1) return true;
        }
      }
    }
  }

  return false;
}

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

  G.resize(n);

  for (int i = 0; i < m; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    a--; b--;

    G[a].push_back(edge(b, -c));
  }

  if (bellman_ford(n)) puts("inf");
  else cout << -d.back() << endl;
}


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

using namespace std;

int main() {
	string s;
	cin >> s;
	string t = "";

	for (char x : s) {
		if (x == '0') {
			t += '0';
		}
		else if (x == '1') {
			t += '1';
		}
		else if (x == 'B') {
			if (t != "") {
				t.erase(t.size() - 1, t.size());
			}
		}
	}

	cout << t << endl;

	return 0;
}

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

typedef long long ll;

int main()
{
  ll N;
  std::string S;
  std::cin >> N >> S;

  ll x = 0LL;
  ll ans = 0LL;
  for (auto c : S) {
    if (c == 'I') x++;
    else x--;
    ans = std::max(ans, x);
  }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000



int main(){
	
	int N;
	cin>>N;
	int t = N%10;
	if(t==3)cout<<"bon"<<endl;
	else if(t==0||t==6||t==1||t==8)cout<<"pon"<<endl;
	else cout<<"hon"<<endl;
	
	return 0;
}



Measured memory_bytes: 3620
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H & b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H & b) const { return x == b.x && y == b.y; }
	bool operator!=(const H & b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T & a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T & a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int p, q, r;
signed main() {
	cin >> p >> q >> r;
	cout << p + q + r - max(p, max(q, r)) << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int value_num = sc.nextInt();
		int[] values = new int[value_num];
		for (int i = 0; i < value_num; i++) {
			values[i] = sc.nextInt();
		}

		int max_profit = Integer.MIN_VALUE;
		int lowest_value = values[0];
		for (int i = 1; i < values.length; i++) {
			max_profit = Math.max(max_profit, values[i] - lowest_value);
			lowest_value = Math.min(lowest_value, values[i]);
		}
		System.out.println(max_profit);
	}
}



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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	string n; cin>>n;
	if(n.size()==1) {
		cout << n << endl;
		return 0;
	}
	int ret=9*(n.size()-1) + (n[0]-'0'-1);
	set<char> st;
	for (int i=1; i<n.size(); i++)
		st.insert(n[i]);
	if(st.size()==1&&st.find('9')!=st.end())
		ret++;
	cout << ret << endl;
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
n, q = map(int, input().split())
s = input()
t = [0] * -~n
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i:i+2] == "AC" else 0)
for _ in range(q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Measured memory_bytes: 7748
#include <bits/stdc++.h>
#define INT long long int
using namespace std;
queue<INT> q;
INT n, d[100010], N, ans;
int main() {
  cin>>n;
  memset(d, 0x3f, sizeof(d));
  d[1]=1, q.push(1);
  while( !q.empty() )
  {
      INT now = q.front(); q.pop();
      if( d[(now+1)%n] > d[now]+1 ) q.push((now+1)%n), d[(now+1)%n] = d[now]+1;
      if( d[(now*10)%n] > d[now] ) q.push((now*10)%n), d[(now*10)%n] = d[now];
  }
  cout<<d[0]<<endl;
}



Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define X first
#define Y second
#define PB push_back
#define SORT(a) sort(a.begin(), a.end())
#define CLR(a) memset(a, 0, sizeof(a))
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FOE(i,a,b) for (int i=(a);i<=(b);i++)
//#define FIT(i,a) for (__typeof__((a).begin()) i = (a).begin(); i != (a).end(); i++)
#define FOREACH(i,a) for (auto i = (a).begin(); i != (a).end(); i++)
#define TRA(i,a,b) for (int i = (a); i != -1; i = (b)[i])
#define INF (1 << 30)
#define EPS (1e-9)
#define REP(i,n) FOR(i,0,n)
#define LL long long
#define MOD 1000000007
#define N 200000
int n, m;
int a[N];
vector<int> v[N];
int find(int x){
        if (!v[x].size()) return 0;
        vector<int> h;
        h.reserve(v[x].size());
        for (auto y : v[x])
                h.push_back(1 + find(y));
        sort(h.begin(), h.end(), greater<int>());
        int ret = 0;
        FOR(i,0,h.size())
                ret = max(ret, h[i] + i);
        return ret;
}
int main(){
        scanf("%d", &n);
        FOE(i,2,n) scanf("%d", a + i);
        FOE(i,2,n) v[a[i]].push_back(i);
        printf("%d\n", find(1));
        return 0;
}


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

int main()
{
  long long int L, R;
  cin >> L >> R;
  if ((R - L + 1) >= 2019)
    cout << 0 << endl;
  else
  {
    long long int min_rem = 2019;
    for (long long int i = L; i <= R - 1; i++)
    {
      for (long long int j = i + 1; j <= R; j++)
      {
        long long int product = i * j;
        long long int rem = product % 2019;
        min_rem = min(min_rem, rem);
      }
    }
    cout << min_rem << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
}

int main()
{   init();
    int n;
    cin>>n;
    int v=n;
    if(n>100)v=100;
    vector<int>vec(n+1);
    for(int i=1;i<v;i++){
        int N=i*i;
        for(int j=1;j<v;j++){
            N=(j*j+i*j+i*i);
            if(N>n)continue;
            for(int x=1;x<v;x++){
                N=j*j+i*j+i*i+x*x+x*j+x*i;
                if(N<=n)vec[N]++;
                else continue;
            }
        }
    }
    for(int i=1;i<=n;i++)cout<<vec[i]<<endl;
    return 0;
}


Measured memory_bytes: 3516
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>

using namespace std;

int main() {

    int N,M;
    cin >> N >> M;
    int a[3] = {-1,-1,-1};
    int out = 0;
    for(int i=0;i<M;i++){
        int s,c;
        cin >> s >> c;
        if(s == 0) break;
        else if(a[s-1+(3-N)] == -1 || a[s-1+(3-N)] == c) a[s-1+(3-N)] = c;
        else{
            out = -1;
            break;
        }
    }
    if((N == 3 && a[0] == 0) || (N == 2 && a[1] == 0)) out = -1;
    if(out != -1){
        if(N == 3){
            if(a[0] == -1) a[0] = 1;
            if(a[1] == -1) a[1] = 0;
            if(a[2] == -1) a[2] = 0;
        }
        if(N == 2){
            if(a[0] == -1) a[0] = 0;
            if(a[1] == -1) a[1] = 1;
            if(a[2] == -1) a[2] = 0;
        }
        if(N == 1){
            if(a[0] == -1) a[0] = 0;
            if(a[1] == -1) a[1] = 0;
            if(a[2] == -1) a[2] = 0;
        }
        out = a[0]*100 + a[1]*10 + a[2];
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
ACs = 0
WAs = 0
TLEs = 0
REs = 0
for i in range(n):
  result = input()
  if result == "AC":
    ACs += 1
  elif result == "WA":
    WAs += 1
  elif result == "TLE":
    TLEs += 1
  else:
    REs += 1
print("AC x " + str(ACs))
print("WA x " + str(WAs))
print("TLE x " + str(TLEs))
print("RE x " + str(REs))


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

#define int long long

#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define ALL(v) (v).begin(), (v).end()

#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;

using pi = pair<int, int>;
using vi = vector<int>;
using vs = vector<string>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vvi = vector<vi>;
using vvb = vector<vb>;

const int INF = 1e16;
const int MOD = 1e9+7;

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


signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    double x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    double dx = x1-x2, dy = y1-y2;
    cout << sqrt(dx*dx+dy*dy) << endl;
}


Measured memory_bytes: 3312
// 2014/08/30 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

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

	for(int i=0; i<Q; i++){
		int c, a, n;
		cin >> c >> a >> n;

		int t = 0;

		int can = min(min(c, a), n);
		t += can;
		c -= can;
		a -= can;

		int cca = min(c/2, a);
		t += cca;
		c -= cca*2;

		int ccc = c/3;
		t += ccc;

		cout << t << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define ll int
#define ull unsigned long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vvll vector<vll>
#define all(v) v.begin(),v.end()
#define itr(r,v) for(auto r=v.begin();r!=v.end();r++)
#define FOR(i,n) for(ll i=0;i<n;i++)
#define ffor(i,a,b) for(ll i=a;i<=b;i++)
#define rfor(i,a,b) for(ll i=a;i>=b;i--)
#define space cout<<"\n\n";
#define endl "\n"
#define pqmx priority_queue<ll>
#define pqmn priority_queue<ll,vll,greater<ll>>
#define fps(x,y) fixed<<setprecision(y)<<x
#define merg(a,b,c) set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.begin()))
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define ctime auto start = high_resolution_clock::now()
#define etime auto stop = high_resolution_clock::now()
#define ptime auto z1z = duration_cast<microseconds>(stop-start); cout<<"Time elapsed : "<<z1z.count()<<" microseconds\n"
#define dbg1(x)             cout <<#x<<": "<<x<<'\n';
#define dbg2(x, y)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<'\n';
#define dbg3(x, y, z)       cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<'\n';
#define dbg4(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define dbg5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<'\n';

using namespace std;
using namespace std::chrono;

const ll MOD = 1e9 + 7;
const ll N = 1e6 + 2;
const ll maxN = 1e5 + 6;

ll power(ll x, ll y, ll M = MOD) // default argument
{ll v = 1; x = x % M; while (y > 0) {if (y & 1)v = (v * x) % M; y = y >> 1; x = (x * x) % M;} return v;}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	FIO
	ll n; cin >> n;
	ll ans = 0;
	ll ar[n];
	map<ll, ll> hash;
	ll is_1 = 0;
	FOR(i, n) {
		cin >> ar[i];
		hash[ar[i]]++;
		if (ar[i] == 1) is_1 = 1;
	}
	if (is_1 && hash[1] > 1) {
		cout << "0"; return 0;
	}
	else if (is_1 == 1 && hash[1] == 1) {
		cout << "1"; return 0;
	}
	for (ll i = 0; i < n; i++) {
		ll flag = 1;
		if (hash[ar[i]] == 1) {
			for (ll j = 2; j * j <= ar[i]; j++) {
				if (ar[i] % j == 0) {
					if (hash[j] != 0) {
						flag = 0; break;
					}
					if (hash[(ar[i] / j)] != 0 && j != (ar[i] / j)) {
						flag = 0; break;
					}
				}
			}
		}
		else {
			flag = 0;
		}
		if (flag == 1) {
			ans++;
			// dbg1(ar[i]);
		}
	}
	cout << ans;
	return 0;
}


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

int main(){
	int N;
	cin>>N;
 cout<<setprecision(15)<<2*N*M_PI;
	
}


Measured memory_bytes: 3788
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            (long N, long W) = Slice2<long>();
            var cdt = Enumerable.Repeat(0, 4).Select(_ => new List<long>()).ToArray();

            var WV0 = Slice2<long>();
            cdt[0].Add(WV0.b);
            for (var i = 1; i < N; ++i)
            {
                (long w, long v) = Slice2<long>();
                cdt[w - WV0.a].Add(v);
            }
            for (var i = 0; i < 4; ++i)
            {
                cdt[i].Sort();
                cdt[i].Reverse();
                cdt[i].Insert(0, 0);
            }
            var ans = 0L;
            for (var c1 = 0; c1 < cdt[0].Count; ++c1)
                for (var c2 = 0; c2 < cdt[1].Count; ++c2)
                    for (var c3 = 0; c3 < cdt[2].Count; ++c3)
                        for (var c4 = 0; c4 < cdt[3].Count; ++c4)
                        { 
                            var b = WV0.a;
                            var w = b * c1 + (b + 1) * c2 + (b + 2) * c3 + (b + 3) * c4;
                            if (w <= W)
                            {
                                ans = Max(ans,
                                    cdt[0].Take(c1 + 1).Sum() +
                                    cdt[1].Take(c2 + 1).Sum() +
                                    cdt[2].Take(c3 + 1).Sum() +
                                    cdt[3].Take(c4 + 1).Sum());
                            }
                        }
            WriteLine(ans);
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 46548
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((int)(x).size())

using namespace std;
typedef long long ll;


void solve(long long N, std::vector<long long> d){
  sort(ALL(d));

  printf("%lld\n", d[N/2] - d[N/2 - 1]);
}

int main(){
  long long N;
  scanf("%lld",&N);
  std::vector<long long> d(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&d[i]);
  }
  solve(N, std::move(d));
  return 0;
}


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

using namespace std;

//#define int long long
#define ll long long
//#define int unsigned long long

const int mod = 1e9 + 7;





signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //------<<<<>>>>-----//
  // freopen ("C:\\Users\\Andrey\\CLionProjects\\untitled1\\input.txt","r",stdin);
    //freopen ("C:\\Users\\Andrey\\CLionProjects\\untitled1\\output.txt","w",stdout);
    int n;
    cin>> n;
    for(int i = 1;i * i <= n;i++){
        if(n % i == 0){
            if(i < 10 && n/i < 10){
                cout << "Yes";
                return 0;
            }
        }
    }
    cout << "No";
}

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

#define crap ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#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 rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define CN cout<<"No\n"
#define CY cout<<"Yes\n"

using namespace std;
using ll = long long;
void factors(ll n)
{
    vector<ll>v;
    while(n%2==0)
    {
        v.pb(2);
        n/=2;
    }
    for(ll i=3;i*i<=n;i++)
    {
        while(n%i==0)
        {
            v.pb(i);
            //if(n/i!=i) v.pb(n/i);
            n/=i;
        }
    }
    if(n>1) v.pb(n);
     sort(v.begin(), v.end());
    for(auto e:v) cout<<e<<" ";
        cout<<"\n";
}
void solve()
{
    ll n; cin>>n;
    vector<char>v(n);
    rep(i,n) cin>>v[i];
    ll w=0,r=0;
    rep(i,n)
    {
        (v[i]=='R') ? r++ : w++;
    }
    ll t=0;
    rep(i,w)
    {
        if(v[n-i-1]=='W') t++;
    }
    cout<<w-t;

}
int main()
{
    crap;
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r", stdin) ;
        freopen("output.txt","w", stdout) ;
        freopen("error.txt","w", stderr) ;
    #endif
    int t;t=1;
   //cin>>t;
    while(t--)
        {solve();}
    return 0;
}

Measured memory_bytes: 3652
#include "bits/stdc++.h"

using namespace std;

void Main() {
    string S;
    cin >> S;
    int Q;
    cin >> Q;
    vector<int> instType(Q, 0);
    vector<int> addType(Q, 0);
    vector<string> addChar(Q, "");
    for (int i = 0; i < Q; ++i) {
        int t, f;
        string s;
        cin >> t;
        instType[i] = t;
        if (t == 2) {
            cin >> f >> s;
            addType[i] = f;
            addChar[i] = s;
        }
    }

    list<string> ret;
    for (int i = 0; i < S.size(); ++i) {
        ret.push_back(string({ S[i] }));
    }
    bool forward = true;
    for (int i = 0; i < Q; ++i) {
        if (instType[i] == 1) {
            forward = !forward;
        }
        else {
            if (forward && addType[i] == 1) {
                ret.push_front(addChar[i]);
            }
            else if (forward && addType[i] == 2) {
                ret.push_back(addChar[i]);
            }
            else if (!forward && addType[i] == 1) {
                ret.push_back(addChar[i]);
            }
            else {
                ret.push_front(addChar[i]);
            }
        }
    }
    string ans = "";
    if (forward) {
        for (list<string>::const_iterator it = ret.begin(); it != ret.end(); ++it) {
            ans += (*it);
        }
    }
    else {
        for (list<string>::const_reverse_iterator rit = ret.rbegin(); rit != ret.rend(); ++rit) {
            ans += (*rit);
        }
    }
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 27652
#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    string a,b,c;
    int n;
    while(~scanf("%d",&n))
    {
        cin>>a>>b;
        c="";
        for(int i=0,j=0,o=0;i<n*2;i++)
        {
            if(i%2==0)
                c+=a[j++];
            else
                c+=b[o++];
        }
        cout<<c<<endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;

typedef string::const_iterator Iterator;

struct evaluator
{
  vector<int> all;
  vector<int> sets[5];

  vector<int> factor(Iterator& it, const Iterator& last) const
  {
    if (*it == '(') {
      ++it;
      const vector<int> r = expr(it, last);
      ++it;
      return r;
    } else {
      const int i = *it-'A';
      ++it;
      return sets[i];
    }
  }

  vector<int> term(Iterator& it, const Iterator& last) const
  {
    if (*it == 'c') {
      ++it;
      const vector<int> s = factor(it, last);
      vector<int>::const_iterator kt = s.begin();
      vector<int> r;
      for (vector<int>::const_iterator jt = all.begin(); jt != all.end(); ++jt) {
        if (kt != s.end() && *jt == *kt) {
          ++kt;
        } else {
          r.push_back(*jt);
        }
      }
      return r;
    } else {
      return factor(it, last);
    }
  }

  vector<int> expr(Iterator& it, const Iterator& last) const
  {
    vector<int> r = term(it, last);
    while (it != last && (*it == 'u' || *it == 'i' || *it == 'd' || *it == 's')) {
      const char op = *it;
      ++it;
      const vector<int> l = term(it, last);
      vector<int> o;
      switch (op) {
        case 'u':
          set_union(r.begin(), r.end(), l.begin(), l.end(), back_inserter(o));
          break;
        case 'i':
          set_intersection(r.begin(), r.end(), l.begin(), l.end(), back_inserter(o));
          break;
        case 'd':
          set_difference(r.begin(), r.end(), l.begin(), l.end(), back_inserter(o));
          break;
        case 's':
          set_symmetric_difference(r.begin(), r.end(), l.begin(), l.end(), back_inserter(o));
          break;
      }
      swap(r, o);
    }
    return r;
  }
};

int main()
{
  while (!cin.eof()) {
    string name;
    int n;
    evaluator e;
    while (cin >> name >> n && name != "R") {
      vector<int>& s = e.sets[name[0]-'A'];
      for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        e.all.push_back(x);
        s.push_back(x);
      }
      sort(s.begin(), s.end());
    }
    sort(e.all.begin(), e.all.end());
    e.all.erase(unique(e.all.begin(), e.all.end()), e.all.end());

    string s;
    cin >> s;
    Iterator it = s.begin(), last = s.end();
    const vector<int> r = e.expr(it, last);
    if (r.empty()) {
      cout << "NULL" << endl;
    } else {
      for (vector<int>::const_iterator it = r.begin(); it != r.end(); ++it) {
        if (it != r.begin()) {
          cout << ' ';
        }
        cout << *it;
      }
      cout << endl;
    }

    cin.ignore();
    cin.peek();
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;
 
int main()
{
	int N,Y,x,y,z;
	
	cin>>N>>Y;
	
	for(x=0;x<=Y/10000;x++)
		for(y=0;y<=Y/5000;y++)
		{
			z=N-x-y;
			if(z>=0&&x*10000+y*5000+z*1000==Y)
			{
				cout<<x<<" "<<y<<" "<<z;
				return 0;
			}
		}
	
	cout<<"-1 -1 -1";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    long long c;
    cin>>n>>c;
    long long x[100002]={0};
    long long v[100002]={0};
    x[0]=0;
    v[0]=0;
    long long a[100002]={0};
    for(int i=1;i<=n;i++){
        cin>>x[i]>>v[i];
    }
    x[n+1]=c;
    v[n+1]=0;
    for(int i=1;i<=n;i++){
        a[i]=a[i-1]+v[i]-(x[i]-x[i-1]);
    }
    for(int i=1;i<=n;i++){
        a[i]=max(a[i-1],a[i]);
    }
    long long b[100002]={0};
    for(int i=n;i>=1;i--){
        b[i]=b[i+1]+v[i]-(x[i+1]-x[i]);
    }
    for(int i=n;i>=1;i--){
        b[i]=max(b[i+1],b[i]);
    }
    long long ans=0;
    for(int i=1;i<=n;i++){
        ans=max(ans,a[i]);
        ans=max(ans,a[i]-x[i]+b[i+1]);
        ans=max(ans,b[i]);
        ans=max(ans,b[i]-(c-x[i])+a[i-1]);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3328
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<string.h>

using namespace std;

int main() {
	double W, H, x, y;
	cin >> W >> H >> x >> y;
	double a;
	//a = W * H;
	//a = a / 2;
	int b = 0;
	if (x == W/2 &&y == H/2) {
		b = 1;
	}
	/*cout << fixed<<setprecision(10)<<a <<" "<<b<< endl;*/
	printf("%f", W * H / 2);
	cout << " " << b << endl;
	return 0;
}

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

count = 0
sub_H_list = [H]
while True:
    if len(sub_H_list) == 0:
        break
    sub_H = sub_H_list.pop()
    min_hight = min(sub_H)
    if min_hight == 0:
        # 分割
        border = sub_H.index(0)
        if border == 0 and len(sub_H) == 1:
            pass
        elif border == 0:
            sub_H_list.append(sub_H[1:])
        elif border == len(sub_H)-1:
            sub_H_list.append(sub_H[:-1])
        else:
            sub_H_list.append(sub_H[0:border])
            sub_H_list.append(sub_H[border+1:])

    else:
        # 育成
        sub_H_list.append(list(map(lambda x: x-min_hight, sub_H)))
        count += min_hight

print(count)


Measured memory_bytes: 3064
//https://codeforces.com/blog/entry/61015
#include<queue>
#include<map>
#include <string>
#include<bits/stdc++.h>
#define pi 3.141592654
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);
//#define x real()
//#define y imag()
using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef complex<double> point;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<30> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//#define var(x) ((x)<<1)
//#define nvar(x) ((x)^1)
const int N=100000,M=100000;


int n,ans=1e9;
pair<int,int>a[55];
 main()
{

//cout<<Pow((ll)1000000,(ll)110);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
//    char input[15];
//    scanf("%s", &input);  array of char
//  gets(c+1);  array of char
//printf("%s, ",name[k[i]].c_str());  printf of string
//priority_queue<ll,vector<ll>,greater<ll>>y;
input;
cin>>n;
forr(i,1,n)
    cin>>a[i].F>>a[i].S;

sort(a+1,a+1+n);

if(n==1)
{
    cout<<"1";
    return 0;
}
forr(i,1,n-1)
{
    forr(j,i+1,n)
    {
        int p=a[j].F-a[i].F;
        int q=a[j].S-a[i].S;
        map<pair<int,int>,int>m;
        int k=0;
        for(int e=1;e<=n;e++)
        {
            if(m.count({a[e].F,a[e].S})==0)k++;
            m[{a[e].F+p,a[e].S+q}]=1;
        }
        ans=min(ans,k);
    }
}

cout<<ans;





return 0;
}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}

template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

template<typename T,typename Y>
ostream& operator<<(ostream& os,const pair<T,Y>& p){
  return os<<"{"<<p.fs<<","<<p.sc<<"}";
}
template<typename T> ostream& operator<<(ostream& os,const V<T>& v){
  os<<"{";
  for(auto e:v)os<<e<<",";
  return os<<"}";
}
template<typename ...Args>
void debug(Args&... args){
  for(auto const& x:{args...}){
    cerr<<x<<' ';
  }
  cerr<<ENDL;
}

string s,t;
ll n;
set<ll> bits;



PL fliptoright(int fr,int to){
  if(to<fr)to+=n;

  ll l=*(--bits.ub(to)),r=*bits.lb(fr);
  
  return mp(max(0ll,fr-l),max(0ll,r-to));
}

PL fliptoleft(int fr,int to){
  return fliptoright(to,fr);
}

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

  cin>>s>>t;
  n=siz(s);
  ll ans=INF;


  rep(i,0,n){
    if(t[i]=='1'){
      bits.insert(i-n);
      bits.insert(i);
      bits.insert(i+n);
      bits.insert(i+2*n);
    }
  }
  bits.insert(LINF);
  bits.insert(-LINF);



  rep(i,0,n){//j -> j+i,j-i
    ll tmp=i;
    V<ll> rs(n+1,0);
    rep(j,0,n){
      if(s[j]!=t[(j+i)%n]){
        PL p=fliptoright(j,(j+i)%n);
        if(p.sc>=INF)tmp=INF;
        else chmax(rs[p.fs],p.sc);
        ++tmp;
      }
    }

    repr(j,0,n-1)chmax(rs[j],rs[j+1]);
    rep(j,0,n){
      chmin(ans,tmp+2*(rs[j+1]+j));
    }

    rs.assign(n+1,0);
    tmp=i;
    rep(j,0,n){
      if(s[j]!=t[(j-i+n)%n]){
        PL p=fliptoleft(j,(j-i+n)%n);
        if(p.sc>=INF)tmp=INF;
        else chmax(rs[p.fs],p.sc);
        ++tmp;
      }
    }
    repr(j,0,n-1)chmax(rs[j],rs[j+1]);
    rep(j,0,n){
      chmin(ans,tmp+2*(rs[j+1]+j));
    }
  }

  if(ans<INF)cout<<ans<<ENDL;
  else cout<<-1<<ENDL;
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?


Measured memory_bytes: 3880
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N = get_int
D = get_ints

if N % 2 == 1
  puts 0
else
  dx = D.sort
  after = dx[N/2]
  before = dx[N/2 - 1]
  puts [*(before+1)..after].length
end


Measured memory_bytes: 23028
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
#define MOD 998244353
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1LL;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}
 
ll poww(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;
}

const ll N=2e5+5;

ll sp[N];

void sieve(){
  for(int i=2;i<N;i++)sp[i]=i;

    for(int i=2;i*i<N;i++){
      if(sp[i]==i){
      for(int j=i*i;j<N;j+=i){
        sp[j]=i;
      }
    }
}

}
/*
//ll fac[N],inv[N];

ll p=1e9+7;

void fill(){
  fac[0]=inv[0]=1;

  for(int i=1;i<N;i++){
    fac[i]=fac[i-1]*i%p;
  }
}

*/

vl cr(ll x){
  vl d;
  while(x){
    d.pb(x%10);
    x/=10;
  }
  return d;
}

void mul(vl& a , ll n){
ll carry=0;
  for(auto& x:a){
carry+=x*n;
x=carry%10;
carry/=10;
  }
  while(carry){
    a.pb(carry%10);
    carry/=10;
  }
}

int main()
{ 

  IOS;

  ll x;cin>>x;

  ll d=x*x*x+x*x+x;
  cout<<d<<endl;



return 0;
 
}



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

double a, b, x;

double c(double a, double b, double theta) {
  theta = theta * M_PI / 180;
  if (b * sin(M_PI / 2 - theta) > a * sin(theta)) {
    return a * sin(theta) * a / cos(theta) / 2 * a + a / cos(theta) * (b * sin(M_PI / 2 - theta) - a * sin(theta)) * a;
  } else {
    return b * b * sin(M_PI / 2 - theta) / cos(M_PI / 2 - theta) / 2 * a;
  }
}

void Main() {
  cin >> a >> b >> x;

  double lb = 0;
  double ub = 90;
  while (ub - lb > 0.0000000001) {
    double mid = (ub + lb) / 2;
    double res = c(a, b, mid);
    if (res == x) {
      lb = mid;
      break;
    } else if (res > x) {
      lb = mid;
    } else {
      ub = mid;
    }
  }

  cout << lb << 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: 512
N = gets.to_i
As = gets.split.map(&:to_i)
Bs = gets.split.map(&:to_i)
Cs = gets.split.map(&:to_i)

sum = 0
food_prev = -1

N.times do |i|
  food = As[i]
  score = Bs[food - 1]

  sum += score

  if (food_prev + 1) == food
    sum += Cs[food - 2]
  end

  food_prev = food
end

puts sum


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

int main()
{
    int N, i, M;
    int P, X;
    int sum = 0;
    cin >> N;

    vector<int> t(N);
    //時間Tの読込
    for (i = 0; i < N; i++) {
        cin >> t.at(i);
        sum = sum + t.at(i);
    }
    cin >> M;
    for (i = 0; i < M; i++) {
        cin >> P >> X;
        cout << sum - t.at(P-1) + X << endl;
    }
}

Measured memory_bytes: 384
<?php

$input = fgets(STDIN);
$array = explode(' ', $input);

$n = (int)$array[0];
$a = (int)$array[1];
$b = (int)$array[2];

$fee = $n * $a;

if ($fee > $b) {
    $fee = $b;
}

echo $fee;

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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
typedef double DOUBLE;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

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

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const ll LL_INF = 1e17 + 10;
const int INF = 1e9 + 10;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

void solve(){
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b && b == c) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


Measured memory_bytes: 256
/* 
 * Author: aps
 * Time: 2019-07-14 18:12:05
**/
#include<bits/stdc++.h>
 
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
 
using namespace std;
 
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef pair<int,int> pii;
 
const ll inf = 1e18;
const ll mod = 1e9+7;
 
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x;}
inline ll sub(ll x, ll y) { x -= y; if (x < 0) x += mod; return x;}
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod;}
inline ll power(ll a, ll b) {
    ll x = 1;
    while (b) {
        if (b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}
inline ll inv(ll a) { return power(a, mod - 2);}

const int N = 1e5+5;

struct DSU{
    int connected,par[N],sz[N];
    DSU(){}
    DSU(int n){ 
        for(int i=0;i<n;i++) {
            par[i] = i;
            sz[i] = 1;
        }
        connected = n;
    }
    int root(int x) {
        while(x != par[x]) {
            par[x] = par[par[x]];
            x = par[x];
        }
        return x;
    }
    void merge(int u,int v){
        int ru = root(u), rv = root(v);
        if(ru == rv) return;
        --connected;
        if(sz[ru] > sz[rv]) swap(ru,rv);
        sz[rv] += sz[ru];
        sz[ru] = 0;
        par[ru] = par[rv];
    }
};

int n,x[N],y[N];
vi ver[N], hor[N];

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

    cin >> n;
    DSU dsu(n);
    
    for(int i=0;i<n;i++){
        cin >> x[i] >> y[i];
        ver[x[i]].pb(i);
        hor[y[i]].pb(i);
    }

    for(int i=1;i<N;i++){
        for(int j=1;j<(int)ver[i].size();j++) {
            //cout << "merge" << ver[i][j] << " " << ver[i][j-1] << endl;
            dsu.merge(ver[i][j],ver[i][j-1]);
        }
        for(int j=1;j<(int)hor[i].size();j++) {
            //cout << "merge" << hor[i][j] << " " << hor[i][j-1] << endl;
            dsu.merge(hor[i][j],hor[i][j-1]);
        }
    }

    ll ans = 0;
    for(int i=0;i<n;i++){
        //cout << i << " " << dsu.root(i) << " " << dsu.par[i] << endl;
        if(dsu.root(i) == i){
            set<int> allX,allY;
            for(int j=0;j<n;j++){
                if(dsu.root(j) == i) {
                    allX.insert(x[j]);
                    allY.insert(y[j]);
                }
            }
            //cout << i << " " <<  allX.size() << " " << allY.size() << endl;
            ans += 1LL * (ll)allX.size() * (ll)allY.size();
        }
    }

    cout << ans - n << endl;

    return 0;
}


Measured memory_bytes: 14336
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

///////////////////////////

int main() {
	string s, t;

	cin >> s>>t;

	ll n = s.size();

	ll ans = 0;

	rep(i, n) {
		ll v = 1;
		rep(j, n) {
			if (s[j] != t[(i + j) % n]) { v = 0; }
		}
		if (v == 1) { ans = 1; }
	}

	if (ans == 1) { cout << "Yes"; }
	else { cout << "No"; }
	
	
	system("PAUSE");
}

Measured memory_bytes: 504
import sys
from collections import deque
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    P = [0] + list(map(int, input().split()))
    same = deque()
    for i in range(1, N + 1):
        if i == P[i]: same.append(i)
    if not same:
        print(0)
        return

    ans = 0
    x = same.popleft()
    if not same:
        print(1)
        return
    while same:
        if same[0] - x == 1:
            same.popleft()
            ans += 1
            if same:
                x = same.popleft()
                if not same:
                    ans += 1
                    break
        else:
            ans += 1
            x = same.popleft()
            if not same:
                ans += 1
                break
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 85484
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

const int MAX = 1000010;

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

	int N, T;
	pii F[3010];
	int dp[3010] = { 0 };

	cin >> N >> T;
	rep(i, 0, N)
	{
		cin >> F[i].first >> F[i].second;
	}

	sort(F, F + N);

	int ans = 0;
	rep(i, 0, N - 1)
	{
		rrep(j, 0, T)
		{
			if (j - F[i].first >= 0)
			{
				chmax(dp[j], dp[j - F[i].first] + F[i].second);
			}
			chmax(ans, dp[j] + F[i + 1].second);
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 384