akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL; // VL a(n);
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VL> VLL; // VII a(n,VI(m)) n * m
typedef pair<ll, ll> PL;
typedef map<ll, ll> MP; // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)

int main() {
  ll n,k,m,x=0,y=0,z = 0,h=0,w=0,ans=0,sum = 1, Max = -1, Min = 3e9+1;
  string s;
  bool ok=true;
  cin >> n;
  VL a(100000,0);
  rep(i,n){
    cin >> m;
    a[m]++;
  }
  for(int i=1; i<100000-1; i++){
    chmax(Max,a[i-1]+a[i]+a[i+1]);
  }
  pri(Max);
  return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int d;
	cin >> d;
	if (d == 25)
		cout << "Christmas" << endl;
	if (d == 24)
		cout << "Christmas Eve" << endl;
	if (d == 23)
		cout << "Christmas Eve Eve" << endl;
	if (d == 22)
		cout << "Christmas Eve Eve Eve" << endl;
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

ll N;
ll A[100];

int main(){
    cin >> N;
    for(int i=0;i<N;i++) cin >> A[i];
    ll K,M;
    K = 0;
    M = 1000;
    for(int i=0;i<N-1;i++){
        if(A[i+1] > A[i]){
            K += M / A[i];
            M = M % A[i];
        }
        if(A[i+1] < A[i]){
            M += K * A[i];
            K = 0;
        }
    }
    M += K * A[N-1];
    cout << M << endl;
    return 0;
}

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

template <typename T> class Node {
public:
  Node *prev, *next;
  T key;

  Node(T key, Node *prev, Node *next) {
    this->key = key;
    this->prev = prev;
    this->next = next;
  }
};

template <typename T> class LinkedList {
  Node<T> *dummy;

public:
  LinkedList() {
    this->dummy = new Node<T>(T{}, nullptr, nullptr);
    this->dummy->next = dummy;
    this->dummy->prev = dummy;
  }

  Node<T> *first() { return this->dummy->next; }
  Node<T> *last() { return this->dummy->prev; }
  Node<T> *end() { return this->dummy; }

  void insertAfter(T key, Node<T> *n) {
    auto m = new Node<T>(key, n, n->next);
    n->next->prev = m;
    n->next = m;
  }

  void insert(T key) { this->insertAfter(key, this->dummy); }

  Node<T> *searchNode(T key) {
    auto curr = this->first();
    while (curr != this->end()) {
      if (curr->key == key) {
        return curr;
      }
      curr = curr->next;
    }
    return nullptr;
  }

  void deleteNode(Node<T> *n) {
    Node<T> *prev = n->prev, *next = n->next;
    prev->next = next;
    next->prev = prev;
    delete n;
  }

  void deleteValue(T key) {
    auto n = searchNode(key);
    if (n)
      deleteNode(n);
  }

  void deleteFirst() { deleteNode(this->first()); }

  void deleteLast() { deleteNode(this->end()->prev); }

  int count() {
    int count = 0;
    for (auto n = this->first(); n != this->end(); n = n->next)
      count++;
    return count;
  }

  void print() {
    auto curr = this->first();
    while (curr != this->end()) {
      if (curr != this->first())
        std::cout << " ";
      std::cout << curr->key;
      curr = curr->next;
    }
    std::cout << std::endl;
  }
};

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

  LinkedList<int> list;

  std::string cmd;
  int key;
  while (n--) {
    std::cin >> cmd;
    if (cmd == "insert") {
      std::cin >> key;
      list.insert(key);
    }
    if (cmd == "delete") {
      std::cin >> key;
      list.deleteValue(key);
    }
    if (cmd == "deleteFirst")
      list.deleteFirst();
    if (cmd == "deleteLast")
      list.deleteLast();
  }
  list.print();
}



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

#define REP(i,k,n) for(int i=k; i<n; i++)
#define all int i=0; i<n; i++
#define pb push_back
typedef long long int ll;

int main(){
	string k;
	cin>>k;
	int n = k.length();
	int arr[k.length()];
	REP(i,0,n)arr[i] = 0;
	int sum = 0, oc=0, ec=0;
	REP(i,0,n){
		if(k[i]=='R'){
			if(i%2==1)oc++;
			else ec++;
			sum++;
		}
		else{
			if(i%2==0){
				arr[i]+=ec;
				arr[i-1]+=oc;
			}
			else{ 
				arr[i]+=oc;
				arr[i-1]+=ec;
			}
			sum=0;
			oc=0;
			ec=0;
		}
	}
	sum=0, oc=0, ec=0;
	for(int i=n-1; i>=0; i--){
		if(k[i]=='L'){
			if(i%2==1)oc++;
			else ec++;
			sum++;
		}
		else{
			if(i%2==0){
				arr[i]+=ec;
				arr[i+1]+=oc;
			}
			else{
				arr[i]+=oc;
				arr[i+1]+=ec;
			}
			sum=0;
			oc=0;
			ec=0;
		}
	}
	REP(i,0,n)cout<<arr[i]<<" ";
}


Measured memory_bytes: 1024
n = int(input())
al = list(map(int, input().split()))
flag = True
for i in range(n):
    a = al[i]
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            pass
        else:
            flag = False
            break
        
if flag:
    print('APPROVED')
else:
    print('DENIED')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define debug printf("%d %s\n",__LINE__,__FUNCTION__)
typedef long long ll;
typedef std::pair<int,int> pii;
#define pb push_back
#define mk make_pair
#define fi first
#define se second

int _w;FILE* _f;

using namespace std;

const int N=202;

int ans,n,a[N];

int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            for(int k=j+1;k<=n;k++){
                if(a[i]+a[j]>a[k]&&(a[i]^a[j])&&(a[j]^a[k])){
                    ++ans;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 3828
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		String s = input.next();
		boolean valid = true;
		if (s.length()%2==1) valid = false;
		else {
			for (int i = 0; i < s.length()-1; i+=2) {
				if (s.charAt(i)!='h'||s.charAt(i+1)!='i') {
					valid = false;
					break;
				}
			}
		}
		System.out.println(valid? "Yes": "No");
	}
}

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

int main() {
    string ns; cin >> ns;
    int n = stoi(ns);
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        string s = to_string(i);
        if (s.size() % 2 == 1) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<map>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;

string s;
int x, y;
int mx[8100][16200];
int my[8100][16200];

int **tx;
int **ty;

int main()
{
	cin >> s;
	cin >> x >> y;
	int ope = 0;
	int len = s.length();
	vector<int>dx;
	vector<int>dy;
	//int hajime = 0;
	int cnt = 0;

	int tcnt = 0, tope = 0;
	for (int i = 0; i < len; i++) {
		if (s[i] == 'T') {
			if (cnt != 0) {
				if (ope == 0)dx.push_back(cnt);
				else dy.push_back(cnt);
			}
			ope = 1 - ope;
			cnt = 0;
		}
		else {
			cnt++;
			tope = 1;
		}
	}
	if (s[len - 1] == 'F') {
		if (ope == 0)dx.push_back(cnt);
		else dy.push_back(cnt);
	}

	/*
	for (int i = 0; i < dx.size(); i++) {
		cout << dx[i] << endl;
	}
	cout << endl;
	for (int i = 0; i < dy.size(); i++) {
		cout << dy[i] << endl;
	}
	cout << endl;

	*/
	/*
	int k = max(dx.size(), dy.size()) + 1;
	int **tx = new int*[k];
	int **ty = new int*[k];
	for (int i = 0; i < k; i++) {
		tx[i] = new int[2 * s];
	}
	*/
	mx[0][8000] = 1;
	mx[0][8000] = 1;
	my[0][8000] = 1;
	my[0][8000] = 1;
	if (s[0] == 'F') {
		mx[1][8000 + dx[0]] = 1;
		
		for (int i = 1; i < dx.size(); i++) {
			for (int j = 8000-len; j <= 8000+len; j++) {
				if (mx[i][j] != 0) {
					
					mx[i + 1][j + dx[i]] = 1;
					mx[i + 1][j - dx[i]] = 1;
				}
			}
		}

		for (int i = 0; i < dy.size(); i++) {
			for (int j = 8000-len; j <= 8000+len; j++) {
				if (my[i][j] != 0) {
					my[i + 1][j + dy[i]] = 1;
					my[i + 1][j - dy[i]] = 1;
				}
			}
		}


	}
	else {
		if (tcnt % 2 == 0) {
			
			for (int i = 0; i < dx.size(); i++) {
				for (int j = 8000 - len; j <= 8000 + len; j++) {
					if (mx[i][j] != 0) {
						mx[i + 1][j + dx[i]] = 1;
						mx[i + 1][j - dx[i]] = 1;
					}
				}
			}

			for (int i = 0; i < dy.size(); i++) {
				for (int j = 8000 - len; j <= 8000 + len; j++) {
					if (my[i][j] != 0) {
						my[i + 1][j + dy[i]] = 1;
						my[i + 1][j - dy[i]] = 1;
					}
				}
			}
		}
		else {
			for (int i = 0; i < dy.size(); i++) {
				for (int j = 8000 - len; j <= 8000 + len; j++) {
					if (mx[i][j] != 0) {
						mx[i + 1][j + dy[i]] = 1;
						mx[i + 1][j - dy[i]] = 1;
					}
				}
			}

			for (int i = 0; i < dx.size(); i++) {
				for (int j = 8000 - len; j <= 8000 + len; j++) {
					if (my[i][j] != 0) {
						my[i + 1][j + dx[i]] = 1;
						my[i + 1][j - dx[i]] = 1;
					}
				}
			}
			if (mx[dy.size()][8000 + x] == 1 && my[dx.size()][8000 + y] == 1)cout << "Yes" << endl;
			else cout << "No" << endl;
			return 0;
		}

	}



	if (mx[dx.size()][8000 + x] == 1 && my[dy.size()][8000 + y] == 1)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 254336
#include <iostream>
#include <vector>
#include <string>
#include <climits>
#include <algorithm>
using namespace std;

int main()
{	
	string s;
	cin >> s;
	int n = s.size();
	int maxsum = 0,sum=0;
	for(int i=0;i<n;i++){
		maxsum = max(maxsum,sum+s[i]-49+(n-i-1)*9);
		sum += s[i]-48;
	}
	maxsum = max(maxsum,sum);
	cout << maxsum;
    return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
 
template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}
 
int main()
{
    string s;
    cin >> s;
 
    ll Q;
    cin >> Q;
 
    bool reverse = false;
    ll changed = 0;
    string ans = s;
    
    rep(i,Q)
    {
        int tmp;
        cin >> tmp;
        if( tmp == 1 )
        {
            reverse = !reverse;
            changed++;
        }
        else
        {
            int key;
            string c;
            cin >> key >> c;
            if( (reverse&&key==2) || (!reverse&&key==1) )
            {
                ans.insert(0,c);
            }
            else
            {
                ans += c;
            }
        }
    }
    if( (changed+2)%2 == 0 ) cout << ans << endl;
    else
    {
        std::reverse( ans.begin(), ans.end());
        cout << ans << endl;
    }
}


Measured memory_bytes: 1084
import java.lang.Math;
import java.util.Scanner;


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

        double erea = 0;
        double length = 0;
        double r = sc.nextDouble();

        erea = 2 * Math.PI * r;
        length = Math.PI * r * r;

        System.out.printf("%.10f %.10f", length, erea);
    }
}


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

int dp [50] ;
int fib(int x){
    if(x == 1 || x == 0){
        return 1 ;
    }
    if(dp[x]>0){
        return dp[x] ;
    }
    dp[x] = fib(x-1) + fib(x-2) ;
    return fib(x-1) + fib(x-2) ;
}
int main() {
    int n ;
    cin >> n ;
    int ans = fib(n) ;
    cout << ans << endl ; 
} 


Measured memory_bytes: 3104
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;


int main(){

  ll n;
  cin >> n;

  std::vector<ll> x(n);
  std::vector<ll> y(n);
  rep(i,n){
    cin >> x.at(i);
    y.at(i)=x.at(i);
  }
  sort(all(x));
  ll left=x.at((n/2)-1),right=x.at(n/2);


  rep(i,n){
    ll b;
    if(y.at(i)>=right){
      b=left;
      cout << b << endl;
    }
    else{
      b=right;
      cout << b << endl;
    }
  }

  }


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

using namespace std;

typedef long long ll;
typedef long double ld;

const int M = 100100;

int n;
ll t, e;
ll x[M], d[M];

void read() {
  cin >> n >> e >> t;
  x[0] = 0;
  for (int i = 1; i <= n; ++i)
    cin >> x[i];
}


void kill() {
  d[0] = 0;
  int l = 0;
  ll mn = 1e18;
  for (int i = 1; i <= n; ++i) {
    d[i] = d[i - 1] + t;
    /*
    for (int j = 0; j < i; ++j)
      d[i] = min(d[i], d[j] + max(t, 2 * (x[i] - x[j + 1])));
    continue;
    */
    while (l < i && 2 * (x[i] - x[l + 1]) >= t) {
      mn = min(mn, d[l] - 2 * x[l + 1]);
      ++l;
    }
    //cerr << "i = " << i << ", l = " << l << endl;
    d[i] = min(d[i], d[l] + t);
    d[i] = min(d[i], mn + 2 * x[i]);
  }

  ll ans = d[n] + e;
  
  cout << ans << endl;
}

int main() {
  cout.precision(20);
  cout << fixed;
  ios_base::sync_with_stdio(false);
  read();
  kill();
}


Measured memory_bytes: 1792
n = int(input())
a = [int(input()) for _ in range(n)]
cnt = 1
now = 0
while True:
    if a[now] == 2:
        print(cnt)
        exit()
    elif cnt > n:
        print(-1)
        exit()
    else:
        now = a[now] - 1
        cnt += 1


Measured memory_bytes: 7084
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int n,ans=INF;
int w[110];
int f[110];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>w[i],f[i]=f[i-1]+w[i];
	for(int i=1;i<=n;i++){
		int t1=f[i],t2=f[n]-f[i];
		ans=min(ans,abs(t1-t2));
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i=j; i<=k; i++)
#define FFOR(i, j, k) for(int i=j; i<k; i++)
#define DFOR(i, j, k) for(int i=j; i>=k; i--)
#define bug(x) cerr<<#x<<" = "<<x<<'\n'
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
template <typename T> inline void read(T &x){
    char c;
    bool nega=0;
    while((!isdigit(c=getchar()))&&(c!='-'));
    if(c=='-'){
        nega=1;
        c=getchar();
    }
    x=c-48;
    while(isdigit(c=getchar())) x=x*10+c-48;
    if(nega) x=-x;
}
template <typename T> inline void writep(T x){
    if(x>9) writep(x/10);
    putchar(x%10+48);
}
template <typename T> inline void write(T x){
    if(x<0){
        putchar('-');
        x=-x;
    }
    writep(x);
}
template <typename T> inline void writeln(T x){
    write(x);
    putchar('\n');
}
template <typename T> inline T min(T x, T y, T z){
    return min(min(x, y), z);
}
template <typename T> inline T max(T x, T y, T z){
    return max(max(x, y), z);
}
#define taskname "C"
ll h, w;
ll get(ll h, ll w){
    ll s1, s2, s3, s=h*w;
    s3=w-s2;
    ll ans=1LL<<50;
    FFOR(i, 1, h){
        s1=i*w;
        s2=(h-i)*(w/2);
        s3=s-s1-s2;
        ans=min(ans, max(s1, s2, s3)-min(s1, s2, s3));
        if(i<h-1){
            s2=((h-i)/2)*w;
            s3=s-s1-s2;
            ans=min(ans, max(s1, s2, s3)-min(s1, s2, s3));
        }
    }
    return ans;
}
int main(){
    #ifdef Megumin
        if(fopen(taskname".inp", "r"))
            freopen(taskname".inp", "r", stdin);
    #endif // Megumin
    read(h);
    read(w);
    writeln(min(get(h, w), get(w, h)));
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<ctype.h>
#include<string>
using namespace std;
int main(){
	int N, a = 0;
	cin >> N;
	for(int i = N; ;i++){
		if(to_string(i)[0] == to_string(i)[1] && to_string(i)[1] == to_string(i)[2]){
			a = i;
			break;
		}
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.to_i
s = gets.split.map(&:to_i)
q = gets.to_i
t = gets.split.map(&:to_i)

c = 0
for i in 0..q-1
  for j in 0..n-1
    if t[i] == s[j]
      c += 1
      break
    end
  end
end

p c

# puts (s & t).size

Measured memory_bytes: 6388
// C - Not so Diverse
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define allr(x) (x).rbegin(),(x).rend()
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N,K; cin>>N>>K;
	vi C(N+1);
	rp(i, 0, N){ int a; cin>>a; C[a]++; }
	sort(allr(C));
	int count = 0;
	rp(i, K, N+1){ if(C[i]==0) break; count += C[i]; }
	cout<< count <<endl;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define FOR(i, begin, end) for(int i = (begin); i < (end); i++)
#define REP(i, n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define CHMIN(a, b) a = min((a),(b))
#define CHMAX(a, b) a = max((a),(b))
#define ZP(a, len) cout << setfill('0') << setw(len) << right << a << endl;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};

signed main() {
    char c;
    cin >> c;
    map<char, char> m = {
            {'A', 'T'},
            {'T', 'A'},
            {'C', 'G'},
            {'G', 'C'}
    };
    cout << m[c] << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            string line = null;
            while((line = Console.ReadLine()) != null)
            {
                var date = line.Split(' ').Select(int.Parse).ToArray();
                if (date[0] == 0) break;
                Console.WriteLine(
                    new DateTime(2004, date[0], date[1]).DayOfWeek);
            }
        }
    }
}

Measured memory_bytes: 6152
#include <iostream>
#include <string>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

#define FOR(var,start,end) for(int var=start; var<end; var++)
#define REP(var,cnt) FOR(var,0,cnt)

int main(void) {
	
	char X, Y;
	cin >> X >> Y;
	if ( X < Y ) { cout << "<"; }
	else if ( X > Y ) { cout << ">"; } 
	else { cout << "="; }
	cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
static const int MOD = 1000000000+7;

int main() {
  int k,a,b;
  cin >> k >> a >> b;
  string ans="NG";
  for (int i=a; i<=b; i++)
  {
    if (i%k==0)
    {
      ans = "OK";
    }
  }

  cout << ans << endl;

}

Measured memory_bytes: 3596
// organize and work - Abhinav IIITA
#include <bits/stdc++.h>
using namespace std;
#define int long long 
void q1(){
	int a;
	cin>>a;
	string s;
	cin>>s;
	if(a>=3200)
	cout<<s;
	else 
	cout<<"red";
}
void q2(){
	int n;cin>>n;
	long double tp=0;
	for(int i=0;i<n;++i){
		long double xp;
		cin>>xp;
		xp=1/xp;
		tp+=xp;
	}
	tp=1/tp;
	cout<<fixed<<setprecision(10)<<tp;
}
void q3(){
	int pp;
	cin >>pp;
	double arr[pp];
	for(int i=0;i<pp;++i)
	cin>>arr[i];
	sort(arr,arr+pp);
	for(int i=1;i<pp;++i){
		arr[i]+=arr[i-1];
		arr[i]/=2;
	}
	cout<<arr[pp-1];
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;//cin>>t;
	t=1;
	while(t--)//
	q3();
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <algorithm>
#include <set>
#include <string>
#include <utility>
#include <cmath>
#include <cstring>
#include <limits>
#include <iomanip>

typedef long long ll;
typedef unsigned long long ull;
#define sq(x) (x) * (x)
#define cube(x) (x) * (x) * (x)
#define reps(i, j, k) for(auto i = j; i < k; ++i)
#define rep(i, j) reps(i, 0, j)
#define decs(i, j, k) for(auto i = j; i >= k; --i)
#define dec(i, j) decs(i, j, 0)
#define iter(i, j) for(auto i = j.begin(); i != j.end(); ++i)
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int, int>
#define F first
#define S second
#define mp make_pair
#define um unordered_map
#define all(x) (x).begin(), (x).end()  
#define fast_io ios::sync_with_stdio(0); cin.tie(0);
#define file_io freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define IMAX std::numeric_limits<int>::max()
#define IMIN std::numeric_limits<int>::min()
using namespace std;
template <class T> T count_multiples_of(T x, T upper_bound, T lower_bound)
{
    T ans = upper_bound / x - lower_bound / x;
    if(lower_bound % x == 0) return ans + 1;
    else return ans;
}
ll C(ll n, ll k) 
{ 
    ll C[n + 1][k + 1]; 
    ll i, j; 
    for(i = 0; i <= n; i++) 
    { 
        for(j = 0; j <= min(i, k); j++) 
        { 
            if (j == 0 || j == i) 
                C[i][j] = 1; 
            else
                C[i][j] = C[i - 1][j - 1] + 
                          C[i - 1][j]; 
        } 
    } 
    return C[n][k]; 
}
template <class T> void display_1D_vector(vector<T> v)
{
    ll n = v.size();
    rep(i, n) cout << v[i] << " ";
    cout << endl;
}

template <class T> void display_2D_vector(vector< vector<T> > v)
{
    ll n = v.size(), m = v[0].size();
    rep(i, n)
    {   
        rep(j, m) cout << v[i][j] << " ";
        cout << endl;
    }
}
int fast_exp(int a, int b)
{
    int res = 1;
    while(b)
    {
        if(b & 1)
            res *= a;
        a *= a;
        b >>= 1;
    }
    return res;
}

int main()
{
    fast_io
    //file_io
    ll h; cin >> h; 
    int n; cin >> n;
    int a;
    ll sum = 0;
    rep(i, n)
    {
    	cin >> a;
    	sum += a;
    }
    if(sum >= h) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int mod = 998244353;
int sum(int a, int b) {
    int s = a + b;
    if (s >= mod) s -= mod;
    return s;
}
int sub(int a, int b) {
    int s = a - b;
    if (s < 0) s += mod;
    return s;
}
const int maxN = 1e6 + 10;
int divs[maxN];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//    freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        for (int j = i; j <= n; j += i) divs[j]++;
    }
    ll ans = 0;
    for (int i = 1; i <= n - 1; i++) ans += divs[i];
    cout << ans;
    return 0;
}

Measured memory_bytes: 7504
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
typedef pair<pll, pll> P;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int main() {
	int n;
	cin >> n;
	
	int ans = 0;
	REP(i, 8) if ((1<<i) <= n) ans = 1<<i;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//区間dp
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define INARR(h,w,x,y) (0 <= y && y < h && 0 <= x && x < w)
#define EQ(a,b) (abs(a - b) < 1e-10)
using namespace std;
constexpr int dx[4] = {0,1,0,-1};
constexpr int dy[4] = {1,0,-1,0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<long> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<bool> VB;
typedef vector<VB>  VVB;
typedef vector<pr> VP;
struct Order {
	bool operator() (pr const& a,pr const& b) const {
		return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
	}
};

VVI dp;
VI w;
int n;

int dfs(int l,int r) {
	if (dp[l][r] != loINF) return dp[l][r];
	int width = (r - l) + 1;
	if (width == 2) {
		if (abs(w[l] - w[r]) <= 1) return 2; else return 0;
	}
	if (width == 4) {
		int ans = dfs(l,l+1)+dfs(l+2,r);
		int ans2 = dfs(l+1,l+2);
		if (ans2 == 2 && abs(w[l]-w[r]) <= 1) ans2 += 2;
		return dp[l][r] = max(ans,ans2);
	}

	int ans = 0;
	int ans2 = dfs(l+1,r-1);
	if (ans2 == width-2 && abs(w[l]-w[r]) <= 1) ans2 += 2;
	else {
		for (int i = (l+1);i <= (r-2);i+=2) {
			ans = max(ans,dfs(l,i)+dfs(i+1,r));
			if (ans == width) break;
		}
	}
	return dp[l][r] = max(ans,ans2);
}

int main(void) {
	while (1) {
		cin >> n;
		if (n == 0) break;
		w.resize(n);
		dp = VVI(n,VI(n,loINF));
		REP(i,n) { cin >> w[i];}
		if (n % 2) cout << max(dfs(1,n-1),dfs(0,n-2)) << endl;
		else cout<< dfs(0,n-1) << endl;
		//dump2d_arr(dp);
	}
}




Measured memory_bytes: 4408
#include <iostream>

using namespace std;

int main()
{
    long long P,N,diff,diff_max= 0,start,next,path=0,first;

    cin>>P>>N;
    cin >> first;
    start = first;
    for(int i = 2; i<= N; i++)
    {
        cin>>next;

        diff=next-first;
        path+=diff;

        if( diff > diff_max)
            diff_max = diff;
        first = next;
    }
    diff = P - next + start;
    path+=diff;
    if(diff > diff_max)
        diff_max = diff;
    cout<<path - diff_max;
}


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

#define mp make_pair
#define pb push_back

#define int int64_t
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

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

	string s;
	cin>>s;
	int n = s.size();
	if(s[n-1]=='s')
	s=s+"es";
	else 
	s=s+"s";
	cout<<s;	

	return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int l,m,n,s,a;
	while(cin>>l,l){
		s=0,a=1;
		rep(i,12){
			cin>>m>>n; s+=m-n;
			if(s<l)a++;
		}
		if(a<=12)cout<<a<<endl;
		else cout<<"NA"<<endl;
	}
	return 0;
}

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

using namespace std;

int main(void) {
    vector<int> t(4);
    for (auto &_t: t) {
        cin >> _t;
    }
    if (t[1] < t[2] || t[3] < t[0]) {
        cout << 0 << endl;
    } else {
        sort(t.begin(), t.end());
        cout << (t[2] - t[1]) << endl;
    }
}

Measured memory_bytes: 256
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
ans=0
for i in range(n):
    l,r=mp()
    ans+=r-l+1
print(ans)

Measured memory_bytes: 5068
n = int(input())
s = input()
sum = 0
r = 0
g = 0
b = 0

for i in range(n):
    if s[i] == "R":
        r += 1
    elif s[i] == "G":
        g += 1
    else:
        b += 1
sum += r*g*b

for i in range(n):
    wi = (n-i+1)//2
    for w in range(1,wi):
        if s[i] == s[i+w] or s[i+w] == s[i+2*w] or s[i] == s[i+2*w]:
            continue
        else:
            sum -= 1

print(sum)


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

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int INF = int (1e9) + int (1e5);
const ll INFL = ll(2e18) + ll(1e10);
const ui MOD = 1E9 + 7;
const double EPS = 1e-9;
#define FOR(i,n) for (int i=0;i<(n);++i)
#define ROF(i,x) for(int i = (x) ; i >= 0 ; --i)
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ODD(x) (((x)&1)==0?(0):(1))
#define sign(x) ((x > 0) - (x < 0))
std::mt19937_64  generator(std::chrono::system_clock::now().time_since_epoch().count());

inline ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a, ll b) { return a ? gcd(b%a, a): b; }
ll lcm(ll a, ll b) { return a / gcd(a,b) * b; }


void READ(bool _local){
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef _DEBUG
    if (_local)
        freopen ("in.txt", "r", stdin);
#endif
}

int main() {
    READ(0);
    ll n;cin>>n;
    int x=sqrt(n);
    while(n%x!=0){
        --x;
    }
    cout << n/x + x-2;

}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

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

int p[100010], c[510], e[510], dp[100010];
signed main(void)
{
  int m, n;
  cin >> m >> n;
  REP(i, m) cin >> p[i];
  REP(i, n) cin >> c[i] >> e[i];

  REP(i, m+1) dp[i] = INF;
  dp[0] = 0;
  REP(i, n) {
    for(int j=m; j>=c[i]; --j) {
      if(dp[j-c[i]] != INF) dp[j] = min(dp[j], dp[j-c[i]] + e[i]);
    }
    REP(j, c[i]) {
      dp[j] = min(dp[j], e[i]);
    }
    // REP(j, m+1) cout << dp[j] << " "; cout << endl;
  }

  sort(p, p+m, greater<int>());
  FOR(i, 1, m) p[i] += p[i-1];
  int ret = 0;
  REP(i, m) {
    // cout << p[i] << " " << dp[i+1] << endl;
    ret = max(ret, p[i]-dp[i+1]);
  }
  cout << ret << endl;

  return 0;
}

Measured memory_bytes: 3240
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll mod = 998244353;
ll dp[102][100005];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll n,w;
    cin>>n>>w;
    pair<ll,ll> p[n];
    for(int i=0;i<n;i++){
        cin>>p[i].second>>p[i].first;
    }
    sort(p,p+n);
    for(int i=0;i<n;i++){
        for(int j=0;j<100005;j++)
            dp[i][j] = 0;
    }
    for(int i=0;i<100005;i++)
        if(p[0].first!=i)
            continue;
        else
            dp[0][i] = p[0].second;
    ll ans = 0;
    if(p[0].second<=w)
        ans = p[0].first;
    for(ll i=1;i<n;i++){
        for(ll j=0;j<=100005;j++){
            if(p[i].first>j){
                dp[i][j] = dp[i-1][j];
                continue;
            }
            dp[i][j] = dp[i-1][j];
            if(dp[i-1][j-p[i].first] || !(j-p[i].first)){
                if(!dp[i][j])
                    dp[i][j] = p[i].second+dp[i-1][j-p[i].first];
                else
                    if(dp[i-1][j])
                        dp[i][j] = min(dp[i-1][j],dp[i-1][j-p[i].first]+p[i].second);
            }
            else
                continue;
            //cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
            if(dp[i][j] && dp[i][j]<=w)
                ans = max(j,ans);
        }
    }
    cout<<ans<<endl;
}


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

#define FOR(i, a, n) for(int i = a; i < n; ++i)
#define logarr(arr) for(auto i : arr) { cout << i << " "; } cout << "\n";
#define ll long long
#define sc(a) scanf("%d", &a);
#define scl(a) scanf("%lld", &a);


void solve() {

    vector<ll> ar(1e5+1, 0);
    ll n; scl(n);
    vector<ll> v(n);
    ll sum = 0;

    FOR(i, 0, n) { 
        sc(v[i]); 
        sum += v[i];
        ar[v[i]]++;
    }

    int q; sc(q);

    FOR(i, 0, q) {
        int b, c;
        sc(b); sc(c);
        if (ar[b]) {
            sum += (c - b) * ar[b];
            ar[c] += ar[b];   
            ar[b] = 0;
        }
        cout << sum << "\n";
    }

}


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

	int t = 1;
	// sc(t); 
	while(t--) {
		solve();
	}

	return 0;

}

Measured memory_bytes: 4792
#include <iostream>

using namespace std;

int main()
{
    int t,i,f[1000]={0},b[100000];
    string a;
    cin>>t;
    for(i=0;i<t;i++){
    cin>>a;
    b[i]=a[0];
    f[b[i]]++;
    }
    cout<<"AC x "<<f['A']<<endl;
    cout<<"WA x "<<f['W']<<endl;
    cout<<"TLE x "<<f['T']<<endl;
    cout<<"RE x "<<f['R']<<endl;
}


Measured memory_bytes: 3628
n=int(input())
a=0;b=0;c=0
ans=0
for i in range(n):
  s=list(input())
  if s[0]=='B':
    if s[-1]=='A':
      a+=1
    else:
      b+=1
  elif s[-1]=='A':
    c+=1
  for j in range(len(s)-1):
    if s[j]=='A' and s[j+1]=='B':
      ans+=1
if a>0:
  if b>0 and c>0:
    mn=min(b-1,c-1)
    ans+=a+1+mn
  elif b>0 and c==0:
    ans+=a
  elif c>0 and b==0:
    ans+=a
  else:
    ans+=a-1
else:
  ans+=min(b,c)
print(ans)

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

int main() {
  int a;
  cin >> a;
  int ans = a*a*a+a*a+a;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3552
import java.io.*;
import java.util.*;
import java.lang.Math;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Long a = sc.nextLong();
        Long b = sc.nextLong();
        Long x = sc.nextLong();
        Long ans = b/x - a/x;
        if(a%x==0)++ans;
        System.out.println(ans);
    }
}


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

int main() {
    long long n, rn, a=1;
    cin >> n;
    rn = sqrt(n);
    for (long long i=1; i<=rn; i++) {
        if (n % i == 0)
            a = i;
    }
    cout << floor(log10(n/a))+1 << endl;
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <numeric>
#include <vector>
#include <math.h>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <set>
#define mod 1000000007
using namespace std; 

int main(){
    string a; cin >> a;
	if(a[0]==a[1] && a[1]==a[2]) cout <<"No"<< "\n";
	else cout << "Yes" << "\n";
}


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

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("O3", "Ofast", "unroll-loops", "fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


#define int long long
#define endl '\n'

using namespace std;


int f(int a, int b, int x){
    return (a * x) / b - a * (x / b);
}

signed main(){
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    int a, b, n;
    cin >> a >> b >> n;
    cout << f(a, b, min(b - 1, n)) << endl;

    return 0;
}


Measured memory_bytes: 3604
#include<iostream>
#include<vector>

int main() {

	int N, T, A;
	std::cin >> N >> T >> A;

	std::vector<int> H(N);

	
	for (int i = 0; i < N; i++) std::cin >> H[i];

	int res = 1<<30;
	int ans = 0;

	for (int i = 0; i < N; i++) {
		if (abs(A*1000 - (T*1000 - H[i] * 6)) <= res) {
			res = abs(A*1000 - (T*1000 - H[i] * 6));
			ans = i;
		}
	}

	std::cout << ans + 1 << std::endl;

}

Measured memory_bytes: 256
// C - Slimes
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N; string S; cin>>N>>S;
	S += "-";
	int ans = 0;
	rp(i, 0, N) if(S[i] != S[i+1]) ans++;
	cout<< ans <<endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    string s; cin >> s;
    int n = s.size();
    bool ok = false;
    if (n >= 4) {
        if (s.substr(0,4) == "YAKI") ok = true;
    }
    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <string>
#include <algorithm>

int main()
{
    std::string s;
    std::cin >> s;

    const size_t first = s.find_first_of('A');
    const size_t last = s.find_last_of('Z');
    std::cout << last - first + 1 << std::endl;

    return 0;
}


Measured memory_bytes: 3704
from math import pi, tan, atan, degrees
 
a, b, x = [int(i) for i in input().split()]
 
theta = (pi * 0.5) - atan(2 * x / (a * b**2))
 
if b * tan(pi * 0.5 - theta) <= a:
    print(degrees(theta))

else:
    theta = atan(((2 * b) / a) - (2 * x / a**3))
    print(degrees(theta))

Measured memory_bytes: 9496
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define int long long
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  const int N = 200005;


int32_t main()
{


    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    IOS



    int n;
    cin >> n;

    vector<int> v(n);

    int ans = 0;

    for(int i = 0; i <  n; i++)
    {
      int x;
      cin >> x;

      while(x%2==0)
      {
        x/=2;
        ans++;
      }
    }

    cout << ans;







    return 0; 
}


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

signed main() {
    int n;
    int x, y;
    long long ans, dp[4002][3] = {};
    string s;
    char cat[] = "RGB";

    cin >> n >> s;
    for ( int i = 0; i < n; i++ ) {
        for ( int j = 0; j < 3; j++ ) {
            if ( cat[j] == s[i] ) {
                dp[i+1][j]++;
            }
            dp[i+1][j] += dp[i][j];
        }
    }

    ans = 0;
    for ( int i = 0; i < n; i++ ) {
        for (int j = 0; j < 3; j++ ) {
            if ( cat[j] == s[i] ) {
                ans += (dp[n][ (j+1)%3 ] - dp[i+1][ (j+1)%3 ]) * dp[i][ (j+2)%3 ];
                ans += (dp[n][ (j+2)%3 ] - dp[i+1][ (j+2)%3 ]) * dp[i][ (j+1)%3 ];
            }
        }

        x = y = i;
        while ( x >= 0 && y <= n-1 ) {
            if ( s[x] != s[y] && s[x] != s[i] && s[y] != s[i] ) {
                ans -= 1;
            }

            x--;
            y++;
        }
    }

    cout << ans << endl;

    return (0);
}

Measured memory_bytes: 3728
package main

import (
	"fmt"
	"sort"
)

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func main() {
	var n int
	fmt.Scanln(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}
	sort.Ints(a)
	ans := 0
	for i := 0; i < n-1; i += 2 {
		sum := a[i] + a[i+1]
		ans += abs(sum)
	}

	if n%2 == 1 {
		ans += a[n-1]
	}
	fmt.Println(ans)
}


Measured memory_bytes: 5504
#include <stdio.h>
//WA
int main() {
  int n, m;
  long int k, l = 0, ans = 0;
  scanf("%d%ld", &n, &k);
  long int a[n], b[n];
  int count[40];
  for (size_t i = 0; i < n; i++) {
    scanf("%ld", a+i);
    b[i] = a[i];
  }
  for (size_t i = 0; i < 40; i++) {
    count[i] = 0;
    for (size_t j = 0; j < n; j++) {
      count[i] += a[j] % 2;
      a[j] = a[j]/2;
    }
  }
  for (m = 40; m > 0; m--) {
    if ((k & (1ull<<(m-1))) != 0) {
      break;
    }
  }
  while (m > 0) {
    if (count[m-1] < (n+1)/2 && l + (1ull<<(m-1)) <= k) {
      l += (1ull<<(m-1));
    }
    m--;
  }
  for (size_t i = 0; i < n; i++) {
    ans += b[i] ^ l;
  }
  printf("%ld\n", ans);
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    string str_i = to_string(i);
    if (str_i.size() % 2 == 1) {
      ++cnt;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
using namespace std;
using namespace __gnu_pbds;

typedef tree<pair<long long int,long long int>,null_type,less<pair<long long int,long long int> >,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

void go()
{
    string s;
    cin>>s;
    if(s[0] == 'R' && s[1] == 'R' && s[2] == 'R')
        cout<<3;
    else if((s[0] =='R' && s[1]=='R') || (s[1]=='R' && s[2]=='R'))
        cout<<2;
    else if(s[0]!='R' && s[1]!='R' && s[2]!='R')
        cout<<0;
    else
        cout<< 1;
}
int main()
{
    FIO;
//    int t;
//    cin>>t;
//    while(t--)
        go();
    return 0;
}


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

using namespace std;

int main(){
	char name[3];
    for(int i = 0; i < 3; ++i){
    	cin >> name[i];
    }
    
    if(name[1] == 'B'){
    	cout << "ARC" << endl;
    }else{
    	cout << "ABC" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3640
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <queue>
# define MOD 1000000000+7
# define INF 1000000000
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
using namespace std;
unsigned long long int a = 0, b = 0, c = 0, d = 0, e = 0, ans = 0, x = 0, y = 0, z = 0, N = 0, m = 0, maxy = 0, mini = 9999, counter = 0, endp = 0, checker = 0;

std::vector <long long int> vec{}, vecsec{}, vecth{};
long long int iremono[100010], koware[100001];
long long  int iremono2[100001], check[100001], xpo[10000001], ypo[10000001], hei[1000001];
std::vector<std::string>kinds{}, kaku{};
char maze[1000][1000];
int sx, sy;
int gx, gy;
struct karu{
	string name;
	ll score;
	ll number;
};
pair<long long int, long long int> ann[103];
struct karu karuta[103];
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
bool okada = false, okada2 = false;
std::string input[103],one,two,three;
char re;
unsigned long long int sa, sb, enda, endb, ab;
int H, W;//はんい
bool qw = false, er = false, ty = false, ui = false;
std::string code;
int main() {
	cin >> code;
	rep(i,3) {
		if (code[i] == code[i+1]) {
			cout << "Bad" << endl;
			return 0;
		}
	}
		cout << "Good" << endl;
	
}


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

#define INF 1000000000000

int gcd(int a, int b)
{
    if (a < b) {
        a ^= b;
        b ^= a;
        a ^= b;
    }

    return b ? gcd(b, a % b) : a;
}

int main(){

 int k; cin>>k;
 ll ans=0;
  for(int a=1;a<=k;a++){
   for(int b=1;b<=k;b++){
     for(int c=1;c<=k;c++){
       int tmp=0;
       tmp=gcd(a,b);
       tmp=gcd(tmp,c);
       ans+=tmp;
     }
   }
 }
 cout<<ans<<endl;
 return 0;
}


Measured memory_bytes: 3636
#include<stdio.h>
#include<string.h>
int main()
{
  int i=0,count=0;
  char str[10]={};
  
  scanf("%s",str);
  strcpy(str,str);
 
  for(i=0;i<3;i++)
  {
    if(str[i]=='1'){
      count++;
    }
  }
  printf("%d\n",count);
  
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
#define reprd(i,a,b) for (int i=(a);i>=(b);--i)
#define repr(i,n) reprd(i,n,0)
typedef long long ll;

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

using namespace std;

const ll BIG = 1000000007LL;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

template<typename T>
void inputArray(T* p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

template<typename T>
void inputVector(vector<T> * p, int a){
    rep(i, a){
        T input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision = 0) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

const int Max = 110;
string S;

int main(int argc, const char * argv[]) {
    cin >> S;
    string ans = "No";
    if (S.length()%2 == 1) {
        ans = "No";
    } else {
        ans = "Yes";
        for (int i=0; i<S.length(); i+=2) {
            if (S[i] != 'h' || S[i+1] != 'i') {
                ans = "No";
                break;
            }
        }

    }

    output(ans);

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a, b;
  	bool flag = false;
  	cin>>a>>b;
  	if(a < 2 * b) flag = true;
  	if(flag) cout<<'0'<<endl;
  	else cout<<a - 2 * b<<endl;
  	return 0;
}

Measured memory_bytes: 256