akhauriyash/Code-Regression huggingface dataset:
n = int(input())
s = [input() for _ in range(n)]
ans = 0
for j in range(n):
    for k in range(j + 1, n):
        if s[j][k] != s[k][j]:
            break
    else:
        continue
    break
else:
    ans += n
for i in range(1, n):
    for j in range(n):
        for k in range(j + 1, n):
            if s[j + i - n][k] != s[k + i - n][j]:
                break
        else:
            continue
        break
    else:
        ans += n
print(ans)


Measured memory_bytes: 42860
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

long long int const INF = 5000000000000000000LL;

int main(){
	
	long long int N, K;
	cin >> N >> K;
	
	long long int x[100], y[100], a[100], b[100];
	
	for(int i = 0; i < N; i++){
		cin >> a[i] >> b[i];
		x[i] = a[i];
		y[i] = b[i];
	}
	
	sort(x, x + N);
	sort(y, y + N);
	
	long long int ans = INF;
	
	for(int i = 0; i < N; i++){
		for(int j = i + 1; j < N; j++){
			for(int k = 0; k < N; k++){
				for(int l = k + 1; l < N; l++){
					long long int sx = x[i];
					long long int gx = x[j];
					long long int sy = y[k];
					long long int gy = y[l];
					int count = 0;
					for(int m = 0; m < N; m++){
						if(a[m] >= sx && a[m] <= gx && b[m] >= sy && b[m] <= gy){
							count++;
						}
					}
					if(count >= K){
						ans = min(ans, (gx - sx) * (gy - sy));
					}
				}
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(),v.end()
#define mem(arr) memset(arr, 0, sizeof(arr))
#define ff first
#define ss second
#define int long long int
const int MOD = 1e9 + 7;
const int INF = 1e18;
const int N = 1e6 + 20;
vector<int> g[N];
vector<int> vis(N);
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc = 1;
    while(tc--){
        int sum = 6;
        int a, b;
        cin >> a >> b;
        cout << sum - a - b << '\n';
    }
}

Measured memory_bytes: 31488
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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 (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N,K;cin >> N >> K;
    vector<pll> xy(N);
    rep(i,N)cin >> xy[i].F >> xy[i].S;
    sort(all(xy));
    LL ans = 1LL << 62;
    for(int i = 0;i < N;++i){
        for(int j = 0;j < N;++j){
            for(int k = 0;k < N;++k){
                for(int l = 0;l < N;++l){
                    LL ct = 0;
                    LL L,R,U,D;
                    if(xy[i].F <= xy[j].F){
                        L = xy[i].F;
                        R = xy[j].F;
                    }
                    else{
                        L = xy[j].F;
                        R = xy[i].F;                            
                    }
                    if(xy[k].S <= xy[l].S){
                        D = xy[k].S;
                        U = xy[l].S;
                    }
                    else{
                        D = xy[l].S;
                        U = xy[k].S;
                    }
                    for(int m = 0;m < N;++m){
                        pll tmp = xy[m];
                        if(tmp.F >= L && tmp.F <= R && tmp.S <= U && tmp.S >= D)ct++;
                    }
                    if(ct >= K)ans = min(ans,1LL*(R - L)*(U - D));
                }
            }
        }
    }
    cout << ans << endl;
}


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

int main()
{
    string S;
    cin >> S;

    if (S == "Sunny") {
        cout << "Cloudy" << endl;
    } else if (S == "Cloudy") {
        cout << "Rainy" << endl;
    } else {
        cout << "Sunny" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc045/tasks/abc045_a

#include <iostream>
using namespace std;

int main()
{
  /* Magic word */
  cin.tie(0);
  ios::sync_with_stdio(false);
  /* ---------- */

  int a, b, h, s;

  cin >> a >> b >> h;

  s = (a + b) * h / 2;

  cout << s << "\n";

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1000000007;

void solve(int n, int w)
{
    int num[1000];
    rep(i, 1000) num[i] = 0;
    int most = -1;
    rep(i, n)
    {
        int v;
        cin >> v;
        num[v / w]++;
        chmax(most, v / w);
    }
    int mh = -1;
    rep(i, 1000)
    {
        chmax(mh, num[i]);
    }
    double ans = 0.01;

    rep(i, most)
    {
        //cerr << "*" << i << " " << num[i] << " " << ans << endl;

        double fac = (double)(most - i) / double(most);
        ans += (double)num[i] / (double)mh * fac;
    }

    cout << fixed << setprecision(18) << ans << endl;
}

int main()
{

    int n, w;
    while (cin >> n >> w, n)
    {
        solve(n, w);
    }
    return 0;
}


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

typedef long long int ll;

int cost[15][15];

int main() {
    int n,m;
    cin >> n >> m;
    for(int i = 0; i < 10; i++)
        for(int j = 0; j < 10; j++)
            scanf("%d", &cost[i][j]);

    for(int k = 0; k < 10; k++)
        for(int i = 0; i < 10; i++)
            for(int j = 0; j < 10; j++)
                cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);

    int res = 0;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++){
            int x; scanf("%d", &x);
            if(x == -1) continue;
            res += cost[x][1];
        }

    printf("%d\n", res);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vvd= vector<vd>;
using vc= vector<char>;
using vb= vector<bool>;
#define rep(i,x,n) for(int i=x; i<n; i++)
#define all(x) x.begin(), x.end()


int main(){
  double t,x;
  cin >> t >> x;

  printf("%f", t/x);
}


Measured memory_bytes: 256
N = int(input())
S = list(input())
Q = []
for i in range(1,N) :
    A = S[0:i]
    B = S[i:N+1]
    A = list(set(A))
    q = 0
    for j in range(len(A)) :
        if A[j] in B :
            q += 1
        Q.append(q)
print(max(Q))



Measured memory_bytes: 3060
h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

black = 0
for i in range(h):
    for j in range(w):
        if c[i][j] == '#':
            black += 1

ans = 0
for i in range(2 ** h):
    for j in range(2 ** w):
        tmp = 0
        for l in range(h):
            for m in range(w):
                if ((i >> l) & 1) or ((j >> m) & 1):
                    if c[l][m] == '#':
                        tmp += 1

        if black - tmp == k:
            ans += 1

print(ans)

Measured memory_bytes: 9212
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int main() {
  int k,x;
  cin>>k>>x;
  for(int i=x-k+1;i<x+k;i++){
    cout<<i<<' ';
  }
  cout<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K;
  cin >> N;
  cin >> K;
  
  int X = 1;
  for (int i = 0; i < N; i++) {
    if (X < K) {
      X *= 2;
    } else {
      X += K;
    }
  }
  
  cout << X;
}

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

using namespace std;

typedef long long ll;

struct Node {
    ll sum;
    int bits;
    
    Node(ll sum = 0, int bits = 0) : sum(sum), bits(bits) {
    }
    
    bool operator<(const Node& other) const {
        return bits < other.bits || (bits == other.bits && sum < other.sum);
    }   
};

void process(vector<ll>& a, int start, int end, vector<Node>& result) {
    int size = end - start + 1;
    int bound = (1 << size) - 1;
    for (int i = 0; i <= bound; i++) {
        ll sum = 0;
        int bits = 0;
        for (int k = 0; k < size; k++) {
            if ((i & (1 << k)) > 0) {
                sum += a[start + k];
                bits++;
            }
        } 
        result.push_back(Node(sum, bits));
    }
}

int main() {
    int n, k; 
    ll l, r;
    cin >> n >> k >> l >> r;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    
    vector<Node> result1, result2;
    int m = (n - 1)/2;
    process(a, 0, m, result1);
    process(a, m + 1, n - 1, result2);
    
    sort(result2.begin(), result2.end());
    
//    for (Node& node : result1) {
//        cout << node.bits << " " << node.sum << endl;
//    }
//    
//    cout << "second" << endl;
//    for (Node& node : result2) {
//        cout << node.bits << " " << node.sum << endl;
//    }
    
    ll count = 0;
    for (Node& node : result1) {
        if (node.bits <= k) {
            count += upper_bound(result2.begin(), result2.end(), Node(r - node.sum, k - node.bits)) -
                    lower_bound(result2.begin(), result2.end(), Node(l - node.sum, k - node.bits));
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 43760
#include <bits/stdc++.h>
#define USE_MATH_DEFINES
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

struct Node {
    int key;
    Node *prev, *next;
};

Node *nil;

void init() {
    nil = (Node *)malloc(sizeof(Node));
    nil->next = nil;
    nil->prev = nil;
}

void printList() {
    Node *cur = nil->next;
    int isf = 1;
    while (true) {
        if (cur == nil)
            break;
        if (isf == 0)
            printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
        isf = 0;
    }
    printf("\n");
}

void insert(int key) {
    Node *x = (Node *)malloc(sizeof(Node));
    x->key = key;
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

Node *listSearch(int key) {
    Node *cur = nil->next;
    while (cur != nil && cur->key != key) {
        cur = cur->next;
    }
    return cur;
}

void deleteNode(Node *t) {
    if (t == nil)
        return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

void deleteFirst() {
    deleteNode(nil->next);
}

void deleteLast() {
    deleteNode(nil->prev);
}

void deleteKey(int key) {
    deleteNode(listSearch(key));
}

int main() {
    int key, n;
    char com[20];
    scanf("%d", &n);
    init();
    for (int i = 0; i < n; i++) {
        scanf("%s%d", com, &key);
        if (com[0] == 'i') {
            insert(key);
        } else if (com[0] == 'd') {
            if (strlen(com) > 6) {
                if (com[6] == 'F')
                    deleteFirst();
                else if (com[6] == 'L')
                    deleteLast();
            } else {
                deleteKey(key);
            }
        }
    }
    
    printList();
}


Measured memory_bytes: 34388
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <set>

using namespace std;
using ll = long long;
const int MOD=1000000007;

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

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }



int main(int argc, char**argv){
    ll a, b, x;
    cin >> a >> b >> x;

    if (a % x == 0){
        cout << b/x - a/x + 1 << endl;
    }else{
        cout << b/x - a/x << endl;
    }

    return 0;
}




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

int main() {
	int A;
	cin >> A ;
	int B;
	cin >> B;
	
	if ( A+B >= A-B && A+B >= A*B){
		cout << A+B << endl;
	} else if (A-B >= A+B && A-B >= A*B){
		cout << A-B << endl;
	} else if (A*B >= A+B && A*B >= A-B){
		cout << A*B << endl;
	}
	
	// your code goes here
	return 0;
}




Measured memory_bytes: 256
# -*- coding:utf-8 -*-

import sys

ind = input()

ind = ind.split()
N,Y = int(ind[0]),int(ind[1])

Y /= 1000
for x in range(N+1,-1,-1):
    for y in range(0,N-x+1):
        z = N - x - y
        s = x*10 + y*5 + z
        if s == Y:
            print(x,y,z)
            sys.exit()
print(-1,-1,-1)


Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

//4Head

#define all(x) x.begin(), x.end()
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(nullptr));

ll const mod = 1e9 + 7;

namespace {
	ll mul(ll a, ll b) {
		ll val = a * b - (ll)((ld)a * b / mod) * mod;
		if (val < 0) val += mod;
		if (val >= mod) val -= mod;
		return val;
	}

	ll poww(ll a, ll b) {
		ll val = 1;
		a %= mod;
		while (b > 0) {
			if (b % 2) val = mul(a, val);
			a = mul(a, a);
			b >>= 1;
		}
		return val % mod;
	}

	ll inv(ll a) {
		return poww(a, mod - 2);
	}
}

int const maxn = 1e5 + 5;

ll dp[22][1 << 21];
int is[22][22];

int cnt_bits[1 << 21];
signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n; cin >> n;
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < n; j++) {
			cin >> is[i][j];
		}
	}

	for (int mask = 0; mask < (1 << n); mask++) {
		for (int i = 0; i < n; i++) {
			if ((1 << i) & mask) cnt_bits[mask]++;
		}
	}

	dp[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		int id = i - 1;
		for (int mask = 0; mask < (1 << n); mask++) {
			int cnt = cnt_bits[mask];
			if (cnt == i) {
				for (int j = 0; j < n; j++) {
					if (mask & (1 << j)) {
						if (is[id][j]) {
							dp[i][mask] += dp[i - 1][mask ^ (1 << j)];
							if (dp[i][mask] > mod) dp[i][mask] -= mod;
						}
					}
				}
			}
		}
	}

	cout << dp[n][(1 << n) - 1] << endl;
	return 0;
}

/*
5
2 6 15 5 10

4
2 6 15 5

*/

Measured memory_bytes: 319744
<?php
fscanf(STDIN, "%d %d", $n,$k);
$lineInput1 = trim(fgets(STDIN));
$H = explode(" ", $lineInput1);
while ($line = fgets(STDIN)) {
        $lineInput2 = trim($line);
        $tmp = explode(" ", $lineInput2);
        $A[$tmp[0]][] = $tmp[1];
        $A[$tmp[1]][] = $tmp[0];
}

$ans = 0;
foreach($A as $idx => $targets){
    $flg = true;
    foreach($targets as $t=>$target){
        if($H[$idx - 1] <= $H[$target - 1]){
            $flg = false;
            break;
        }
        
    }
    if($flg){
        $ans++;
    }
}
if($n > count($A)){
    $ans+= $n - count($A);
}
echo($ans);

?>

Measured memory_bytes: 66208
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

int n, m, i, a;
map<int, int> v;
int main()
{
	cin >> n;
	for (i = 0; i < n; i++) {
		scanf ("%d", &a);
		v[a]++;
	}
	cin >> m;
	for (i = 0; i < m; i++) {
		scanf ("%d", &a);
		if (v[a] == 0) {
			cout << "NO";
			return 0;
		}
		v[a]--;
	}
	cout << "YES";
    return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
#include <atcoder/all>

using namespace atcoder;
using namespace std;

using mint = modint1000000007;

int main(){
    int N, M;
    scanf("%d %d", &N, &M);
    dsu d(N);
    for(int i=0;i<M;i++){
        int a, b;
        scanf("%d %d", &a, &b);
        a--;
        b--;
        d.merge(a, b);
    }
    unordered_set<int> s;
    for(int i=0;i<N;i++){
        s.insert(d.leader(i));
    }
    cout << s.size() - 1 << endl;
    return 0;
}


Measured memory_bytes: 7120
#include <bits/stdc++.h>
#define inp_out_work ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define testCase    int T; cin>>T; while(T--)
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,s,e) for(int i=s;i<=e;i++)
#define endl '\n'
#define debug(P) cout<<#P<<" = "<<P<<endl;
#define pb push_back
#define FILE freopen("in.txt","r",stdin); freopen("out.txt","w",stdout);


using namespace std;

typedef long long ll;

int main(){
    inp_out_work
    int N, W;
    cin>>N>>W;

    int v[N], w[N];

    fr(i,N)cin>>w[i]>>v[i];

    int V  = accumulate(v, v+N, 0);

    ll dp[V+1], cpy[V+1];

    fill(dp, dp+V+1, INT_MAX);
    dp[0] = 0;

    for(int i = 0; i < N; i++){
        for(int val = 0; val <= V; val++){
            cpy[val] = dp[val];
        }
        for(int val = v[i]; val <= V; val++){
            dp[val] = min(dp[val], cpy[val-v[i]] + w[i]);
        }
    }

    int ans = 0;

    fr(i,V+1)if(dp[i] <= W)ans = i;

    cout<< ans;

}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
#define mp make_pair
#define pb push_back
#define BE begin()
#define EN end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef string str;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int N;
int A[100010];
int dp[100010];
bool C(int x,int q){
  return dp[x]<q;
}
int upper(int l,int r,int q){//条件を満たす中で最小のものを返す
  int lb=l-1,ub=r+1;
  while(ub-lb>1){
    int mid=(lb+ub)/2;
    if(C(mid,q)) ub=mid;
    else lb=mid;
  }
  return ub;
}
void solve(){
  fill(dp,-1);
  rep1(i,N){
    int index=upper(1,N,A[i-1]);
    dp[index]=A[i-1];
  }
  rep1(i,N+1){
    if(dp[i]==-1){
      prin(i-1);
      break;
    }
  }
}
int main(){
  cin>>N;
  rep(i,N) cin>>A[i];
  solve();
  return 0;
}


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

int is_prime(int n) {
	int i;
	int num = (int)sqrt(n) + 1;

	for (i = 2;i != num;++i) {
		if (n%i == 0) {
			return 0;
		}
	}
	return 1;
}

int main() {
	int n;

	while (1) {
		scanf("%d",&n);
		if (n == 0) {
			break;
		}
		for (;n != 4;--n) {
			if (is_prime(n) && is_prime(n-2)) {
				printf("%d %d\n",n-2,n);
				break;
			}
		}
	}
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    long long ans=0;
    for(int i=0; i<n; i++) cin >> a[i];
    for(int i=1; i<n; i++){
        if(a[i]<a[i-1]) {
            ans+=(a[i-1]-a[i]);
            a[i]=a[i-1];
        }
    }
    cout << ans;
}

Measured memory_bytes: 3976
dx = [-3, -2, -1, 0, 0, 0, 0, 0, 0, 1, 2, 3]
dy = [0, 0, 0, -1, -2, -3, 1, 2, 3, 0, 0, 0]


def bomb(y, x):
    field[y][x] = 0
    for k in xrange(len(dx)):
        ny = y + dy[k]
        nx = x + dx[k]
        if nx < 0 or ny < 0 or nx >= 8 or ny >= 8:
            continue
        if field[ny][nx] == 1:
            bomb(ny, nx)


T = input()
for t in xrange(1, T + 1):
    field = []
    raw_input()
    for i in xrange(8):
        field.append(map(int, raw_input()))
    x, y = input() - 1, input() - 1
    bomb(y, x)
    print "Data %d:" % t
    for i in xrange(8):
        print ''.join(map(str, field[i]))

Measured memory_bytes: 4296
import sys
s = input()
l = 0
r = len(s) - 1
cnt = 0
while l < r:
    if s[l] != s[r]:
        cnt += 1
        if s[l] == 'x':
            l += 1
        elif s[r] == 'x':
            r -= 1
        else:
            print(-1)
            sys.exit(0)
    else:
        l += 1
        r -= 1
print(cnt)

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

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};
  ll dp[22][1<<22]={};
  ll num[22][22]={};
int main(){
  int n;cin>>n;

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>num[i][j];
    }
  }
  dp[0][0]=1;
  for(int i=0;i<n;i++){
    for(int j=0;j<(1<<n);j++){
      if(dp[i][j]){
	for(int k=0;k<n;k++){
	  if(!((1<<k) & j) && num[i][k]){
	    dp[i+1][j | (1<<k)]+=(dp[i][j]);
	    dp[i+1][j | (1<<k)]%=MOD;
	  }
	}
      }
    }
  }
  cout<<dp[n][(1<<n)-1]<<endl;
  return 0;
}


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

ll gcd(ll a, ll b){
  if(b > a) return gcd(b, a);
  if(b == 0) return a;
  return gcd(b, a % b);
}

ll lcm(ll a, ll b){
  return (a / gcd(a, b)) * b;
}

int main(){
  ll N; cin >> N;
  ll ans; cin >> ans;
  for(ll i = 1; i < N; i++){
    ll tmp; cin >> tmp;
    ans = lcm(ans, tmp);
  }
  cout << ans;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
  char p[101][11];
  int i,j,n,m,x[101]={},t=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){scanf("%s",p[t]);for(j=0;j<t;j++)if(!strcmp(p[t],p[j])){x[j]++;j=t;}if(j==t){x[t]++;t++;}}
  scanf("%d",&m);
  for(i=0;i<m;i++){scanf("%s",p[100]);for(j=0;j<t;j++)if(!strcmp(p[100],p[j])){x[j]--;}}
  j=0;for(i=0;i<t;i++)j=x[i]<j?j:x[i];
  printf("%d",j);
}


Measured memory_bytes: 1724
import sys
def valid():
    s = input()
    if s=='Vacant':
        sys.exit()
    return 1 if s=='Male' else 0

n = int(input())
print(0, flush=True)
s_l = valid()
lidx = 0
ridx = n

while True:
    midx = (lidx+ridx)//2
    print(midx, flush=True)
    s_m = valid()
    if ((midx-lidx)%2==1) ^ (s_l==s_m):
        lidx = midx
        s_l = s_m
    else:
        ridx = midx

Measured memory_bytes: 9124
import java.io.PrintWriter

fun main(args: Array<String>) {
    PrintWriter(System.out).use { out ->
        solve(out)
        out.flush()
    }
}

fun solve(out: PrintWriter) {
    val n = readInteger()
    val aList = readIntegerList()
    val countMap = elementCountMap(aList)

    var tmp = 0
    for (c in countMap.values) {
        if (c > 1) {
            tmp += (c - 1)
        }
    }

    if (tmp % 2 == 0) {
        println(aList.size - tmp)
    } else {
        println(aList.size - tmp - 1)
    }
}

/**
 * O(n)
 */
fun elementCountMap(list: List<Int>): Map<Int, Int> {
    val countMap = mutableMapOf<Int, Int>()
    for (e in list) {
        countMap[e] = (countMap[e] ?: 0) + 1
    }
    return countMap
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
fun readDoubleList() = readStringList().map(String::toDouble)


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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(a==b && b==c){
    cout << 1;
  }else if(a==b || b==c || c==a){
    cout << 2;
  }else{
    cout << 3;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	int x;

	public void solve(){
		Scanner sc = new Scanner(System.in);
		x = sc.nextInt();
		System.out.println(x*x*x);
		
	}
	
	public static void main(String[] args){
		Main obj = new Main();
		obj.solve();
	}
}

Measured memory_bytes: 17160
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return b;
    }
    return gcd(b, a % b);
}

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

    dd sum = 1;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++)
    {
        dd ai;
        cin >> ai;
        sum *= ai;
        A[i] = ai;
    }

    dd son = sum;
    dd mother = 0;
    for (ll i = 0; i < N; i++)
    {
        mother += (dd)sum / A[i];
    }
    cout << fixed << setprecision(10) << (dd)(son) / (dd)(mother) << endl;
}

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

int digitSum(int k){
    int sum=0;
    
    while(k>0){
      sum+= (k%10);
      k /=10;
    }
    return sum;
}
  
  
int main() {
  int N;
  cin >> N;
  
  if (N%digitSum(N)==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
}

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

using namespace std;

int main(void){
	int n,d,res=0;
	cin >> n >> d;
	vector<int> katana;
	int max_swing = -1;
	for(int i=0;i<n;i++){
		int a,b;
		cin >> a >> b;
		if(a > max_swing){
			max_swing = a;
		}
		katana.push_back(b);
	}
	sort(katana.begin(),katana.end(),greater<int>());
	int k=0;
	while(k < n && katana[k] > max_swing && d > 0){
		d -= katana[k];
		k++;
		res++;
	}
	if(d > 0)res += d/max_swing + 1*(d%max_swing != 0);
	cout << res << endl;
	return 0;
}



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

typedef long long ll;
const int N = 1e5 + 10;

void solve() {
    int x, y;
    cin >> x >> y;
    if(y % 2) {
        puts("No");
        return ;
    }
    y /= 2;
    int l = y - x, r = x - l;
    if(l < 0 || r < 0) puts("No");
    else puts("Yes");
}

int main()
{
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout);

    int T = 1;
    //scanf("%d", &T);
    while(T--) {
        solve();
    }
}

Measured memory_bytes: 3624
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

  public static void swap(ArrayList<Integer> list, int a, int b){
    int c = list.get(a);
    list.set(a, list.get(b));
    list.set(b, c);
  }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> list = new ArrayList<>();
    try {
      int w = sc.nextInt();
      int n = sc.nextInt();
      for(int i=1;i<=w;i++){
        list.add(i);
      }
      for(int i=0;i<n;i++){
        String[] s = sc.next().split(",");
        int a = Integer.parseInt(s[0]);
        int b = Integer.parseInt(s[1]);
        swap(list, a-1, b-1);
      }
      for(Integer num : list){
        System.out.println(num);
      }
    } catch (Exception e) {
    }
    sc.close();
  }
}


Measured memory_bytes: 26048
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int main(void){
    int a,b,c,x,y,mn = INT_MAX;
    cin >> a >> b >> c >> x >> y;
    for(int i = 0;i <= 100000;i++){
        mn = min(mn,i*2*c+max(0,x-i)*a+max(0,y-i)*b); 
    }
    cout << mn << endl;
    return 0;
}


Measured memory_bytes: 256
/*input
6
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}
vector<int> v[maxn];
int main()
{
	IOS;
	int n;
	cin>>n;
	int t;
	{
		int l=0,r=2000;
		while(l!=r-1){
			int mid=(l+r)/2;
			if(mid*(mid-1)/2<=n) l=mid;
			else r=mid;
		}
		if(l*(l-1)/2!=n){
			cout<<"No\n";
			return 0;
		}
		t=l;
	}
	cout<<"Yes\n";
	cout<<t<<'\n';
	int pt=1;
	REP(i,t) for(int j=i+1;j<t;j++){
		v[i].pb(pt);
		v[j].pb(pt);
		pt++;
	}
	REP(i,t){
		cout<<SZ(v[i]);
		for(int j:v[i]) cout<<' '<<j;
		cout<<'\n';
	}

	return 0;
}


Measured memory_bytes: 9344
#include <iostream>
#include <stdio.h>

typedef long long ll;

using namespace std;

int main() {
  ll X, Y;
  cin >> X >> Y;
  ll cnt = 1;
  while (X <= Y) {
    X *= 2;
    ++cnt;
  }
  printf("%lld\n", cnt - 1);
}

Measured memory_bytes: 3248
#include <iostream>
#include <cstring>

using namespace std;
int main(){
    int h,w;
    string s[100];
    cin>>h>>w;
    for(int i=0;i<h;i++) cin>>s[i];
    for(int i=0;i<2*h;i++){
        cout<<s[i/2]<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, A; cin >> n >> A;
    n %= 500;
    cout << (A >= n ? "Yes":"No") << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
const int inf=0x3f3f3f3f;
int a[maxn];
int b[maxn];
int maxv=-inf;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		b[a[i]]++;
		b[a[i]+1]++;
		b[a[i]-1]++;
	}
	for(int i=0;i<=maxn;i++)
		if(b[i]>maxv)
			maxv=b[i];
	cout<<maxv<<endl;
	return 0;
}




Measured memory_bytes: 1024
#!/usr/bin/env ruby
n, m, x = gets.chomp.split.map(&:to_i)
@c = []
@a = []
n.times do
  input = gets.chomp.split.map(&:to_i)
  @c << input[0]
  @a << input[1..-1]
end

@ans = Float::INFINITY

def dfs(arr, n, m, x)
  return check(arr, n, m, x) if arr.length == n

  [0, 1].each do |i|
    new_arr = arr.dup

    dfs(new_arr.push(i), n, m, x)
  end
end

def check(arr, n, m, x)
  result_arr = Array.new(m, 0)
  result_cost = 0
  0.upto(n - 1) do |i|
    next if arr[i] == 0

    result_cost += @c[i]
    j = 0
    while j < m
      result_arr[j] += @a[i][j]
      j += 1
    end
  end
  return if result_arr.find { |score| score < x }

  @ans = [@ans, result_cost].min
end

dfs([], n, m, x)

puts @ans == Float::INFINITY ? -1 : @ans


Measured memory_bytes: 14840
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007

int main() {
	ll n;
	cin>>n;
	ll c = 0;
	ll flag = 0;
	ll mn = 1000000000000000000LL;
	ll sum = 0;
	rep(i,0,n){
		ll a;
		cin>>a;
		if(a<0)c++;
		if(a==0)flag = 1;
		mn = min(mn,abs(a));
		sum += abs(a);
	}
	if(flag==1){
		cout << sum << endl;
	}
	else if(c%2==0){
		cout << sum << endl;
	}
	else{
		cout << sum-mn*2 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define srt(x) sort((x).begin(), (x).end());
#define rsrt(x) sort((x).rbegin(), (x).rend());
#define deb(x) cout<<#x<<" = "<<(x)<<" (L"<<LINE<<")"<<endl;
#define vdeb(x) {cout<<#x<<" = { "; rep(i, x.size()) cout<<x[i]<<' '; cout <<'}'<<" (L"<<LINE<<")"<<endl;}
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vivi = vector<vi>;
using vll = vector<long long>;
using vllvll = vector<vll>;
using vs = vector<string>;
using um = unordered_map<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;

class UnionFind
{   
public:
    static const int N_MAX = 1000000;
    int par[N_MAX];
    int n;
    
    UnionFind(int n)
        : n{n}
    {
        for (int i = 0; i < n; ++i) {
            par[i] = i;
        }
    }
    
    int root(int x)
    {
        if (par[x] == x) {
            return x;
        }
        return par[x] = root(par[x]);
    }
    
    bool same(int x, int y)
    {
        return root(x) == root(y);
    }
    
    void unite(int x, int y)
    {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) {
            return;
        }
        par[ry] = root(x);
        return;
    }
    
    int groups()
    {
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            if (root(i) == i)
            ++cnt;
        }
        return cnt;
    }
};


int main()
{
    ll n, q;
    cin >> n >> q;
    vll com(q), x(q), y(q);
    rep(i, 0, q) {
        cin >> com[i] >> x[i] >> y[i];
    }
    UnionFind uf(n);
    rep(i, 0, q) {
        //uf.print();
        if (com[i] == 0) {
            uf.unite(x[i], y[i]);
        }
        else {
            //ll ans = uf.same(x[i], y[i])?1:0;
            cout << uf.same(x[i], y[i])<< endl;
        }
    }

}


Measured memory_bytes: 5112
function Main(input) {
  var t = input.split("¥n")[0];
  var h = Math.floor(t / 3600);
  var m = Math.floor(t % 3600 / 60);
  var s = Math.floor(t % 60);
  console.log([h, m, s].join(":"));
}

function debug() {
  var input = document.getElementById('id1').value;
  Main(input);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 15100
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

using namespace std;

#define MAX 100000
#define INF 2140000000
#define MOD 1000000007

long long gcd(long long a, long long b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
} 

long long lcm(long long a, long long b)	{  
	return (a*b)/gcd(a, b);  
}


int main() {
	long long a, b, c, d;
	cin >> a >> b >> c >> d;

	long long divc = b / c - (a - 1) / c;
	long long divd = b / d - (a - 1) / d;
	long long divcd = b / lcm(c, d) - (a - 1) / lcm(c,d);

	cout << b - (a - 1) - (divc + divd - divcd) << endl;

	return 0;
}

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

int main() {
    ll x;
    cin >> x;
    ll ans = 0;
    ll yokin = 100;
    for (ll i = 1;; i++) {
        yokin = yokin * 1.01;
        if (yokin >= x) {
            ans = i;
            break;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3636
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
[n,m]=i2()
x=i2()
x.sort()
y=[]
for i in range(m-1):
  y.append(x[i+1]-x[i])
y.sort()
s=max(m-n,0)
print(sum(y[:s]))

Measured memory_bytes: 56872
A,B,C,D,E,F = map(int,input().split())
W=set()
for a in range(0,F+1,100*A):
    for b in range(0,F+1-a,100*B):
        W.add(a+b)
S=set()
for c in range(0,F+1,C):
    for d in range(0,F+1,D):
        S.add(c+d)
rate = -1
for w in W:
    for s in S:
        if 0 < w+s <= F and s <= w*E//100:
            if s/(w+s) > rate:
                rate = s/(w+s)
                ans = w+s, s
print(ans[0],ans[1])


Measured memory_bytes: 3828
#include<bits/stdc++.h>
using namespace std;
int ans;
main() {
	int k,s;
	scanf("%d%d",&k,&s);
	for(int i=0; i<=k; i++) {
		for(int j=0; j<=k; j++) {
			if(s-i-j>=0 and s-i-j<=k) {
				ans++;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define ll long long
#define fi first
#define se second
int main()
{
	SPEED
	int t;
	cin >> t;
	int t2 = t%10;

	if (t2==3)
	{
		cout << "bon";
	}
	else if (t2==0 || t2==1 || t2==6 || t2==8)
	{
		cout << "pon";
	}
	else
	{
		cout << "hon";
	}
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
int main()
{
    int n;
    char a[110], b[110], c[110];
    cin >> n >> a >> b >> c;
    int con[110][110] = {};
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        con[i][a[i] - 'a'] = 1;
        con[i][b[i] - 'a'] = 1;
        con[i][c[i] - 'a'] = 1;
        for (int j = 0; j < 26; j++)
        {
            ans += con[i][j];
        }
        ans--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int a, b, k;
	cin >> a >> b >> k;
	if(b-a+1 <= k){
		for(int i=a; i<=b; i++) cout << i << endl;
		return 0;
	}
	if(a == b){
		cout << a << endl;
		return 0;
	}
	for(int j = a; j<a+k; j++){
		cout << j << endl;
	}
	for(int t = max(a+k, b-k+1); t<=b; t++){
		cout << t << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#define INF 1000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int H, W; cin >> H >> W;
    string s;
    mat S(H, vec(W, 0));
    REP(i, H){
        cin >> s;
        REP(j, W){
            if(s[j] == '#') S[i][j] = 1;
        }
    }

    mat n_suc(H, vec(W - 1, 0));
    REP(j, W - 1){
        int p = S[0][j] ^ S[0][j + 1], ib = 0;
        REP(i, H){
            if((S[i][j] ^ S[i][j + 1]) != p){
                p = S[i][j] ^ S[i][j + 1];
                FOR(k, ib, i){
                    n_suc[k][j] = k - ib + 1;
                }
                ib = i;
            }
            if(i == H - 1){
                FOR(k, ib, H){
                    n_suc[k][j] = k - ib + 1;
                }
            }
        }
    }

    mat n_right(H, vec(W - 1, 0)), n_left(H, vec(W - 1, 0));
    REP(i, H){
        stack<Pii> st;
        Pii p;
        REP(j, W - 1){

            while(!st.empty()){
                p = st.top();
                if(p.second < n_suc[i][j]){
                    n_left[i][j] = j - p.first - 1;
                    break;
                }else{
                    st.pop();
                }
            }
            if(st.empty()) n_left[i][j] = j;
            st.push(Pii(j, n_suc[i][j]));
        }
    }
    REP(i, H){
        stack<Pii> st;
        Pii p;
        IREP(j, W - 1){

            while(!st.empty()){
                p = st.top();
                if(p.second < n_suc[i][j]){
                    n_right[i][j] = p.first - j - 1;
                    break;
                }else{
                    st.pop();
                }
            }
            if(st.empty()) n_right[i][j] = W - 2 - j;
            st.push(Pii(j, n_suc[i][j]));
        }
    }

    int ans = max(H, W);
    REP(i, H){
        REP(j, W - 1){
            ans = max(ans, n_suc[i][j] * (n_left[i][j] + n_right[i][j] + 2));
        }
    }

    cout << ans;
    
    return 0;
}


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

Measured memory_bytes: 127488
// organize and work - Abhinav IIITA
#include <bits/stdc++.h>
using namespace std;
#define int long long 
void q1(){
	int a,b;
	cin>>a>>b;
	if(a<10 && b<10)
	cout<<a*b;
	else
	cout<<"-1";
}
void q2(){
	int n;cin>>n;
	int fg=0;
	for(int i=1;i<=9;++i)
	if(n%i==0){
		int ano=n/i;
		if(ano<=9 && ano>=1)
		fg=1;
	}
	fg==1 ? cout<<"Yes\n" : cout<<"No\n";
}
void q3(){
	int n;
	cin>>n;
	int xp=sqrt(n);
	int f;
	while(n%xp!=0)
	xp--;
	f=n/xp;
	int s=f+xp-2;
	cout<<s;
}
void q4(){
	double a,b,c,d,e,v;
	cin>>a>>b>>v;
	c=a*a*b;c/=2;
	if(v>c){
		d=a*a*a;d/=2;
		e=a*a*b-v;
		d/=e;
		double ans=atan(d);
		ans=(ans*180);
		ans/=3.14159265;
		ans=90.00000000000-ans;
		cout<<fixed<<setprecision(10)<<ans<<endl;
	}else{
		double x=v/a;x/=b;x/=b;x*=2;
		double ans=atan(x);
		ans=(ans*180);
		ans/=3.14159265;
		ans=90.00000000000-ans;
		cout<<fixed<<setprecision(10)<<ans<<endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	while(t--)
	q4();
	return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>

#define mp make_pair
#define pb push_back


typedef long long ll;
typedef long double ld;

using namespace std;
const int MAXN = 120000;
const int LOG = 20;

int was[MAXN];
vector<int> eds[MAXN];
int n;
set<tuple<int, int, int> > ss;
int dp[MAXN][LOG];

vector<int> get() {
	vector<int> ans;
	if (ss.empty()) {
		ans.push_back(0);
		return ans;
	}
	if (ss.size() >= 2) {
		auto it = ss.end();
		--it;
		auto it2 = prev(it);
		if (get<0>(*it) == get<0>(*it2)) {
			ans.push_back(get<0>(*it) + 1);
			return ans;
		}
	}
	int k, x, y;
	tie(k, x, y) = *ss.rbegin();
	ss.erase(make_tuple(k, x, y));
	++y;
	if (dp[x][y] != -1)
		ss.insert(make_tuple(dp[x][y], x, y));
	ans = get();
	if (ans.back() < k) {
		ans.push_back(k);
		return ans;
	}
	else {
		ans.clear();
		ans.push_back(k + 1);
		return ans;
	}
}

void dfs1(int v) {
	was[v] = 1;
	vector<int> vv;
	for (int u: eds[v]) {
		if (was[u])
			continue;
		vv.push_back(u);
		dfs1(u);
	}
	if (vv.empty()) {
		dp[v][0] = 0;
		for (int i = 1; i < LOG; ++i)
			dp[v][i] = -1;
		return;
	}
	ss.clear();
	for (int i: vv)
		ss.insert(make_tuple(dp[i][0], i, 0));
	vector<int> tmp = get();
	reverse(tmp.begin(), tmp.end());
	for (int i = 0; i < tmp.size(); ++i)
		dp[v][i] = tmp[i];
	for (int i = tmp.size(); i < LOG; ++i)
		dp[v][i] = -1;
}

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n - 1; ++i) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a, --b;
		eds[a].push_back(b);
		eds[b].push_back(a);
	}
	dfs1(0);
	cout << dp[0][0] << "\n";
	return 0;
}




Measured memory_bytes: 23552
// 見せてやるぜ、奇跡ってやつをよぉ……
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    string s; cin >> s;
    REP(i, s.size()) cout << (char)('A' + (s[i] - 'A' + n) % 26);
    cout << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
class ModComb {
    long long *fact, *facti;
    const int mod;
public:
    explicit ModComb(int n, int m) : mod(m) {
        fact = new long long[n+1];
        facti = new long long[n+1];
        fact[0] = 1; facti[0] = 1;
        for (int i = 1; i <= n; i++) fact[i] = (fact[i-1] * i) % m;
        // calc 1/n!
        long long &inv = facti[n], pw = fact[n];
        inv = 1;
        for (int e = mod-2; e > 0; e /= 2) {
            if (e&1) inv = inv * pw % mod;
            pw = pw * pw % mod;
        }
        for (int i = n-1; i > 0; i--) facti[i] = (facti[i+1] * (i+1)) % m;
    }

    ~ModComb() {
        if (fact) delete[] fact;
        if (facti) delete[] facti;
    }

    long long get(int n, int k) const {
        if (n < 0 || k < 0 || k > n) return 0;
        return fact[n] * facti[k] % mod * facti[n-k] % mod;
    }
};

int main() {
    int n, m; cin >> n >> m;
    const int M = 998244353;
    ModComb mc(3*m+n+3, M);

    long long ans = mc.get(n+3*m-1, n-1);
    for (int j = 0; j < m; j++) ans -= mc.get(n+j-2, n-2) * n % M;
    for (int k = m + 2; k <= n; k += 2)
        ans -= mc.get(n, k) * mc.get((3*m-k)/2+n-1, n-1) % M;
    cout << (ans % M + M) % M << endl;
}


Measured memory_bytes: 39296