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

int main(void) {
    string s;
    cin >> s;
    int ans = 753;
    int n, diff;
    for (int i = 0; i <= s.length() - 3; ++i) {
        n = stoi(s.substr(i, 3));
        diff = abs(n - 753);
        ans = min(ans, diff);
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << endl;
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
	ll l; cin >> l; l--;
	vector<pair<P,ll>> ans;
	vpl acc;
	ll now = 1;
	while(l > 0){
		ans.emplace_back(P(now,now+1),0);
		ans.emplace_back(P(now,now+1),(l+1)/2);
		if(l%2 == 0) acc.emplace_back(now,l);
		l = (l+1)/2 - 1;
		now++;
	}
	for(auto i : acc) ans.emplace_back(P(i.first,now),i.second);
	print2(now,ans.size());
	for(auto i : ans){
		print3(i.first.first,i.first.second,i.second);
	}
}


Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: i128,
    }

    let mut sum_10: i128 = 1;
    let mut sum_8: i128 = 1;
    let mut sum_9: i128 = 1;
    for _ in 0..n {
        sum_10 *= 10;
        sum_10 %= 1000000007;
        sum_8 *= 8;
        sum_8 %= 1000000007;
        sum_9 *= 9;
        sum_9 %= 1000000007;
    }

    let mut ans: i128 = sum_10 - sum_9 - sum_9 + sum_8;
    ans %= 1000000007;
    ans = (ans + 1000000007) % 1000000007;
    println!("{}", ans);
}


Measured memory_bytes: 2192
#include<bits/stdc++.h>
#define IL inline
#define _ 400005
#define ll long long
using namespace std ;

IL int gi(){
	int data = 0 , m = 1; char ch = 0;
	while(ch!='-' && (ch<'0'||ch>'9')) ch = getchar();
	if(ch == '-'){m = 0 ; ch = getchar() ; }
	while(ch >= '0' && ch <= '9'){data = (data<<1) + (data<<3) + (ch^48) ; ch = getchar(); }
	return (m) ? data : -data ; 
}

#define inf 1000000005
#define mod 1000000007

int n,X,Y,m ;
int inv[_] , Ans ;
vector<int>vec[_] ;
int al[_],a ; 
int col[_],wgt[_],dv[_],mn[_],pre[_],suf[_],sz[_],id[_],tot,SZ ; 

IL bool cmp(int a , int b) {return mn[a] < mn[b] ; }

int main() {
	n = gi() ;
	X = gi() ;
	Y = gi() ;
	for(int i = 1; i <= n; i ++) col[i] = gi() , wgt[i] = gi() ;
	for(int i = 1; i <= n; i ++) dv[++m] = col[i] ;
	sort(dv + 1 , dv + m + 1) ;
	m = unique(dv + 1 , dv + m + 1) - dv - 1 ;
	for(int i = 1; i <= n; i ++)
		col[i] = lower_bound(dv + 1 , dv + m + 1 , col[i]) - dv ;
	for(int i = 1; i <= m; i ++) mn[i] = inf ; 
	for(int i = 1; i <= n; i ++) {
		vec[col[i]].push_back(wgt[i]) ;
		mn[col[i]] = min(mn[col[i]] , wgt[i]) ;
	}
	pre[0] = inf ; 
	for(int i = 1; i <= n; i ++) pre[i] = min(pre[i - 1] , mn[i]) ;
	suf[m+1] = inf ;
	for(int i = m; i >= 1; i --) suf[i] = min(suf[i + 1] , mn[i]) ;
	for(int i = 1; i <= m; i ++) {
		int jmp = min(pre[i - 1] , suf[i + 1]) ;
		a = 0 ; 
		for(int j = 0,l = vec[i].size(); j < l; j ++) al[++a] = vec[i][j] ;
		sort(al + 1 , al + a + 1) ;
		sz[i] = 1 ;
		for(int j = 2; j <= a; j ++) {
			if((al[1] + al[j] <= X) || (al[j] + jmp <= Y)) ++ sz[i] ;
			else break ; 
		}
	}
	for(int j = 1; j <= m; j ++) id[j] = j ;
	sort(id + 1 , id + m + 1 , cmp) ;
	tot = 1 ;
	for(int j = 2; j <= m; j ++) if(mn[id[j]] + mn[id[1]] <= Y) ++ tot ;
	SZ = 0 ;
	for(int j = 1; j <= tot; j ++) SZ = SZ + sz[id[j]] ;
	Ans = 1 ;
	for(int j = 1; j <= SZ; j ++) Ans = 1ll * Ans * j % mod ;
	inv[0] = inv[1] = 1 ;
	for(int j = 2; j <= n; j ++) inv[j] = 1ll * (mod - mod / j) * inv[mod % j] % mod ;
	for(int j = 1; j <= n; j ++) inv[j] = 1ll * inv[j] * inv[j - 1] % mod ; 
	for(int j = 1; j <= tot; j ++)  Ans = 1ll * Ans * inv[sz[id[j]]] % mod ;
	cout << Ans << endl ;
	return 0 ; 
}


Measured memory_bytes: 28160
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using P = pair<int, int>;
using LL = long long;

#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define IN_LL(v) LL v;cin>>v;
#define IN(v) int v;cin>>v;
#define OUT(v) cout<<v<<endl
#define MOD 1000000007

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

  int x = 0;
  int max_x = 0;
  REP(i, N) {
    if (S[i] == 'I')
      ++x;
    else
      --x;
    max_x = max(max_x, x);
  }
  OUT(max_x);

  return 0;
}


Measured memory_bytes: 256
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


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

    string S; cin >> S;
    int N = S.size();
    S = "#" + S;

    const ll MOD = 1e9 + 7;

    vvl dp(N + MGN, vl(4, 0));
    dp[0][0] = 1;
    FOR(i,1,N+1) {
        REP(j,4) {
            if (S[i] == '?') dp[i][j] += dp[i-1][j] * 3 % MOD;
            else dp[i][j] += dp[i-1][j] % MOD;
        }

        if (S[i] == 'A' || S[i] == '?') dp[i][1] += dp[i-1][0] % MOD;
        if (S[i] == 'B' || S[i] == '?') dp[i][2] += dp[i-1][1] % MOD;
        if (S[i] == 'C' || S[i] == '?') dp[i][3] += dp[i-1][2] % MOD;
    }

    ll ans = dp[N][3] % MOD;
    cout << ans << endl;

    return 0;
}

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

int main(){
	string divide[4] = {"maerd", "remaerd", "esare", "resare"};
	string s;
	cin >> s;
	reverse(s.begin(),s.end());
	rep(i,s.size()){
		bool can = false;
		rep(j,4){
			if(s.substr(i, divide[j].size()) == divide[j]){
				i += divide[j].size() - 1;
				can = true;
			}
		}
		if(!can){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	
    return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

main() {
    int64_t n, q;
    cin >> n >> q;

    vector<int64_t> a(n);
    vector<int64_t> sum;
    vector<int64_t> psum;
    for (auto&& aa : a) {
        cin >> aa;

        sum.push_back(sum.empty() ? 0 : sum.back());
        sum.back() += aa;
        psum.push_back(psum.size() >= 2 ? psum[psum.size() - 2] : 0);
        psum.back() += aa;
    }

    for (auto _ : irange(0L, q)) {
        int64_t x;
        cin >> x;

        auto r = irange(0L, n);
        auto i = *partition_point(r.begin(), r.end(), [x, n, &a](int64_t i) {
            // i ～ n-1 番目までを全て先手がとるときにfalse
            auto k = n - i;

            auto j = n - 2 * k + 1;
            if (j < 0) {
                return true;
            }

            auto c = a[j];
            auto d = a[i];

            if (abs(c - x) <= abs(d - x)) {
                return false;
            }
            return true;
        });


        int64_t ans = 0;
        ans += sum.back() - sum[i - 1];

        auto k = n - i;
        auto j = n - 2 * k - 1;
        if (j >= 0) {
            ans += psum[j];
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 4332
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	int r = sc.nextInt();
    	sc.close();
    	if(10 <= n){
    		System.out.println(r);
    	}else{
    		System.out.println(r + (100*(10-n)));
    	}
    }
}

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A,B,C;
  cin >> A >> B >> C;
  if(A==B&&B==C){
    cout << "No" << endl;
  }else if(A!=B&&B!=C&&C!=A){
    cout << "No" << endl;
  }else {cout << "Yes" << endl;}
}


Measured memory_bytes: 256
import sys
import operator
# l = sys.stdin.readline()
l= []
for i in xrange(10):
    l.append(int(sys.stdin.readline()))

first = max(l)
print(first)
del l[l.index(first)]
first = max(l)
print(first)
del l[l.index(first)]
first = max(l)
print(first)
del l[l.index(first)]

Measured memory_bytes: 6432
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin>>s;
  int flag=1;

  rep(i,s.length())
  {
    if(i%2==1)
    {
      if(s[i]=='R')flag=0;
    }
    else
    {
      if(s[i]=='L')flag=0;
    }
    if(flag==0)break;
  }
  if(flag)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << p.first << " " << p.second;
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll cnt = 0LL;
  for (auto c : S) {
    if (c == 'x') {
      cnt++;
    }
  }
  if (cnt >= 8) print("NO");
  else print("YES");

  return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	var m [1000]byte

	for _, v := range s {
		m[v]++
	}

	for _, v := range m {
		if v != 0 && v != 2 {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}


Measured memory_bytes: 1920
#define rep(i,n) for (int i=0;i<(n);i++) 
#include <iostream>
#include <string>
#include <vector>
using namespace std;

struct UnionFind {
	vector<int> data;
	UnionFind(int size) : data(size, -1) { }
	bool unite(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int main(void) {
	int h, w;
	char c;
	string s;
	int a[26] = {};
	cin >> h >> w;
	rep(i, h) {
		cin >> s;
		rep(j, w) {
			c= s[j];
			a[c - 'a']++;
			a[c - 'a']%=4;
		}
	}
	if (h*w == 1) {
	}
	else if (h == 1) {
		int remain1 = 1;
		int remain2 = w-1;
		rep(i, 26) {
			if (a[i] == 1) {
				remain1--;
			}
			else if (a[i] == 3) {
				remain1--;
				remain2-=2;
			}
			else if (a[i] == 2) {
				remain2-=2;
			}
		}
		if ((remain2 < 0)||(remain1<0)) {
			cout << "No";
			return 0;
		}
	}
	else if (w == 1) {
		int remain1 = 1;
		int remain2 = h-1;
		rep(i, 26) {
			if (a[i] == 1) {
				remain1--;
			}
			else if (a[i] == 3) {
				remain1--;
				remain2-=2;
			}
			else if (a[i] == 2) {
				remain2-=2;
			}
		}
		if ((remain2 < 0)||(remain1<0)) {
			cout << "No";
			return 0;
		}
	}else if ((h*w) % 2 == 1) {//両方奇数
		int remain1 = 1;
		int remain2 = h+w-2;
		rep(i, 26) {
			if (a[i] == 1) {
				remain1--;
			}
			else if (a[i] == 3) {
				remain1--;
				remain2-=2;
			}
			else if (a[i] == 2) {
				remain2-=2;
			}
		}
		if ((remain2 < 0)||(remain1<0)) {
			cout << "No";
			return 0;
		}
	}else if (h%2 == 1) {//h奇数
		int remain2 = w;
		rep(i, 26) {
			if ((a[i] == 1) || (a[i] == 3)) {
				cout << "No";
				return 0;
			}
			else if (a[i] == 2) {
				remain2-=2;
			}
		}
		if (remain2 < 0) {
			cout << "No";
			return 0;
		}
	}else if (w%2 == 1) {//w奇数
		int remain2 = h;
		rep(i, 26) {
			if ((a[i] == 1) || (a[i] == 3)) {
				cout << "No";
				return 0;
			}
			else if (a[i] == 2) {
				remain2-=2;
			}
		}
		if (remain2 < 0) {
			cout << "No";
			return 0;
		}
	}else{//両方偶数
		rep(i, 26) {
			if (a[i] != 0) {
				cout << "No";
				return 0;
			}
		}
	}
	cout << "Yes";
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <iostream>
#include <stack>

using namespace std;

int main(){
    int n, m;
    scanf("%d %d", &n, &m);
    int maxl = 1;
    int minr = n;
    for(int i = 0; i < m; ++i){
        int l, r;
        scanf("%d %d", &l, &r);
        maxl = max(l, maxl);
        minr = min(r, minr);
    }
    printf("%d\n", max(0, minr - maxl + 1));
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<limits.h>
#include<assert.h>
#include<stdbool.h>
#include<stddef.h>
#include<stdint.h>
#include<string.h>
#include<unistd.h>
#include<stdlib.h>

#include<ctype.h>
#include<time.h>
typedef long long ll;
#define pi 3.14159
int main()
{ 
int x,flag=1;scanf("%d",&x);char c[x];scanf("%s",c);
if(x &1){ printf("No");goto G;}
for(int t=0;t<x/2;t++){
if(c[t]!=c[t+x/2]) {flag=0;break;}}
printf((flag==1)?"Yes":"No");
G:
return 0;}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	int a,b;
	cin>>a>>b;
	if(a>=13)
		cout<<b<<endl;
	else if(a>=6)
		cout<<b/2<<endl;
	else
		cout<<0<<endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("trapv")
#pragma GCC target("sse4")

#include <bits/stdc++.h>
using namespace std;

#define deb(x) cout << #x << " is " << x << "\n"
#define int long long
#define mod 1000000007
#define PI acos(-1)
// void swap(int *a, int *b)
// {
//     int t = *a;
//     *a = *b;
//     *b = t;
// }

int32_t main()
{
    int n;
    cin>>n;
    int arr[n];
    for(int i =0; i < n; i++)
    cin>>arr[i];
    int m = -1;
    int s= 0;
    for(int i = 0; i < n; i++)
    { if(arr[i]>m)
    {
        m = arr[i];
    } s += (m - arr[i]);

    }
    cout<<s;

    

    return 0;
}

Measured memory_bytes: 5176
N, A, B = map(int, input().split())
t_a = True
t_b = False
while True:
    if t_a:
        if A - B > 0:
            if A - 1 == B:
                A += 1
            else:
                A -= 1
        elif A - B < 0:
            if A + 1 == B:
                A -= 1
            else:
                A += 1

        if A == B or A < 0 or A > N:
            print("Borys")
            break
        t_a = False
        t_b = True
    elif t_b:
        if B - A > 0:
            if B - 1 == B:
                B += 1
            else:
                B -= 1
        elif B - A < 0:
            if B + 1 == B:
                B -= 1
            else:
                B += 1

        if A == B or B < 0 or B > N:
            print("Alice")
            break
        t_a = True
        t_b = False

Measured memory_bytes: 3064
n,k = map(int,input().split())
p = list(map(int,input().split()))
l = []
for x in p:
    tmp = 1.0+0.5*(float(x)-1.0)
    l.append(tmp)
max = sum(l[:k])
now = max
for i in range(k,n):
    now = now + l[i] - l[i-k]
    if now >= max:
        max = now
print(max)

Measured memory_bytes: 25060
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  string s;
  cin>>s;
  
  int f=0,e=0;
  f += s[0]-'0';
  f *= 10;
  f += s[1]-'0';
  e += s[2]-'0';
  e *= 10;
  e += s[3]-'0';
  
  if(1<=f && f<=12 && 1<=e && e<=12){
    cout<<"AMBIGUOUS"<<endl;
  }else if(1<=f && f<=12){
    cout<<"MMYY"<<endl;
  }else if(1<=e && e<=12){
    cout<<"YYMM"<<endl;
  }else{
    cout<<"NA"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
n, m, k = gets.split.map(&:to_i)
h = {}
(1..n).each do |i|
    h[i] = i
end

def root(h, i)
    if h[i].class == String
        return h[i]
    elsif h[i] == i
        return i
    else
        return h[i] = root(h, h[i])
    end
end

ans = nil
k.times do |i|
    t, x, y = gets.split.map(&:to_i)
    if t == 1
        # x, y = y, x if rand(2) == 1
        r1 = root(h, x)
        r2 = root(h, y)
        if r1.class == String and r2.class == String and r1 != r2
            ans = i + 1
            break
        elsif r1.class == String and r2.class == String

        elsif r1.class == String
            h[r2] = r1
        else
            h[r1] = r2
        end
    else
        r = root(h, x)
        if r.class == String and r != y.to_s
            ans = i + 1
            break
        elsif r.class == String
        else
            h[r] = y.to_s
        end
    end
end
puts ans ? ans : 0



Measured memory_bytes: 16024
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;


void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}


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

	map<string, int> day;

	day["SUN"] = 7;
	day["MON"] = 6;
	day["TUE"] = 5;
	day["WED"] = 4;
	day["THU"] = 3;
	day["FRI"] = 2;
	day["SAT"] = 1;

	cout << day[s] << endl;

	return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    N=1<<n
    s=list(map(int,input().split()))
    s.sort(reverse=1)
    p=[s[0]]
    s[0]=INF
    for _ in range(n):
        p.sort(reverse=1)
        q=p[:]
        idx=0
        for i in q:
            while(idx!=N):
                j=s[idx]
                idx+=1
                if(i<=j): continue
                p.append(j)
                s[idx-1]=INF
                break
    print("Yes" if len(p)==N else "No")
resolve()

Measured memory_bytes: 110824
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atc_0034
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();

            int Cnt = 0;
            int result = 0;

            for (int i = 0; i < str.Length; i++)
            {
                if (str.Substring(i, 1) == "A" ||
                    str.Substring(i, 1) == "T" ||
                    str.Substring(i, 1) == "C" ||
                    str.Substring(i, 1) == "G")
                {
                    Cnt++;

                    if (result <= Cnt)
                    {
                        result = Cnt;
                    }
                }
                else
                {
                    if (result <= Cnt)
                    {
                        result = Cnt;
                    }
                    Cnt = 0;
                }
            }

            Console.WriteLine(result);
        }
    }
}


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

namespace HABIT{
    #define f(a,b,c,d) for(register int a=b,c=d;a<=c;a++)
    #define g(a,b,c,d) for(register int a=b,c=d;a>=c;a--)
    #define LOCAL
    typedef int i32;
    typedef unsigned int u32;
    typedef long long int i64;
    typedef unsigned long long int u64;
    typedef pair<i32,i32> pii;
    const i32 MAXN=1024;
    typedef i32 ar[MAXN];
    
    template<typename T> inline T Max(T a) { return a; }
    template<typename T,typename... Args> inline T Max(T a,Args... args){
        T b=Max(args...);
        return (a>b)?a:b;
    }
    template<typename T> inline T Min(T a) { return a; }
    template<typename T,typename... Args> inline T Min(T a,Args... args){
        T b=Min(args...);
        return (a<b)?a:b;
    }

    #ifdef LOCAL
        inline char gc() { return getchar(); }
    #else
        inline char gc() {
            static char s[1<<20|1]={0},*p1=s,*p2=s;
            return (p1==p2)&&(p2=(p1=s)+fread(s,1,1<<20,stdin),p1==p2)?EOF:*(p1++);
        }
    #endif
    inline i64 read(){
        register i64 ans=0;register char c=gc();register bool neg=0;
        while(c<48||c>57) neg^=!(c^'-'),c=gc();
        while(c>=48&&c<=57) ans=(ans<<3)+(ans<<1)+(c^48),c=gc();
        return neg?-ans:ans;
    }

    char Output_Ans[1<<20|1],*Output_Cur=Output_Ans;
    inline void output() { Output_Cur-=fwrite(Output_Ans,1,Output_Cur-Output_Ans,stdout); }
    inline void print(char c){
        if(Output_Cur-Output_Ans+1>>20) output();
        *(Output_Cur++)=c;
    }
    inline void print(char *s) { while(*s) print( *(s++) ); }
    inline void print(u64 x){
        if(!x) { print('0'); return ; }
        char buf[30]={0},*p=buf+28;
        while(x) *(p--)=x%10+48,x/=10;
        print(p+1);
    }
    inline void print(u32 x) { print( (u64)x ); }
    inline void print(i64 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
    inline void print(i32 x){
        if(x<0) print('-'),x=-x;
        print( (u64)x );
    }
}
using namespace HABIT;

int main(){
    i32 H1=read(),M1=read();
    i32 H2=read(),M2=read();
    i32 T=(H2-H1)*60+(M2-M1)-read();
    print( T );
    output();
    return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define INFTY 200000000000

int main(){
    int v,e;cin>>v>>e;
    long long dis[v][v];
    for (int i = 0; i < v; i++)
    {
        for (int j = 0; j < v; j++)
        {
            if(i==j)dis[i][j] = 0;
            else dis[i][j] =  INFTY;      
        }     
    }
    for (int i = 0; i < e; i++)
    {
        int s,t;long long d;cin>>s>>t>>d;
        dis[s][t] = d;
    }
      
    
    for (int k = 0; k < v; k++)
    {
        for (int i = 0; i < v; i++)
        {
            for (int j = 0; j < v; j++)
            {
                if(i==j&&dis[i][j]<0){cout << "NEGATIVE CYCLE"<<endl;return 0;}
                if(dis[i][k]==INFTY||dis[k][j]==INFTY) continue;
                else dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]);
            }         
        }        
    }
    for (int i = 0; i < v; i++)
    {
        for (int j = 0; j < v; j++)
        {
            if(dis[i][j] == INFTY){cout << "INF";}
            else cout << dis[i][j];   
            if(j<v-1) cout<<" "; 
        }   
        cout << endl;
    }
    
    return 0;
}


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

int main() {
	// 変数宣言
	int n, a, b;
	int i;			// ループカウンタ
	int sum = 0;	// 合計

	int num;
	int place_sum;	// 各位の和

	// 入力
	cin >> n >> a >> b;

	// ----- 計算 -----

	// 1～20
	for (i = 1; i <= n; i++) {

		// 各位の和を計算
		num = i;
		place_sum = 0;
		while (num) {
			place_sum = place_sum + (num % 10);
			num = num / 10;
		}

		// 各位の和がa以上b以下なら足す
		if (a <= place_sum && place_sum <= b)	sum += i;
	}

	// 出力
	cout << sum << endl;
}

Measured memory_bytes: 256
N=int(input())
if N%2==1:
  print(0)
  exit()
def func1(n):
  if n==0:
    return 0
  if n==1:
    return 1
  return 5*func1(n-1)+1
def func(x):
  if x==0:
    return 0
  for i in range(26):
    if x<5**(i+1):
      a=i
      b=x//(5**a)#商
      c=x%(5**a)#あまり
      break
  return b*func1(a)+func(c)
print(func(N//2))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007

typedef long long ll;

int N,mem;
int A[100010];
int sum[100010] = {0};
int side = 0;
ll D[100010],R[100010];

ll power(ll a,ll b)
{
    if(b == 0)return 1;
    ll res = power(a * a % mod,b / 2);
    if(b & 1)res = res * a % mod;
    return res;
}

ll con(int a,int b)
{
    if(a < b)return 0;
    return (D[a] * R[b] % mod) * R[a - b] % mod;
}

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N + 1; i++){scanf("%d",&A[i]);sum[A[i]]++;}
    for(int i = 0; i < N + 1; i++)if(sum[i] == 2)mem = i;
    for(int i = 0; i < N + 1; i++)if(A[i] == mem){side += i;break;}
    for(int i = N; i >= 0; i--)if(A[i] == mem){side += N - i;break;}
    ll now = 1;
    for(int i = 0; i < N + 2; i++){D[i] = now;now *= i + 1;now %= mod;}
    for(int i = 0; i < N + 2; i++){R[i] = power(D[i],mod - 2);}
    for(int i = 1; i < N + 2; i++)
    {
        if(i == 1)printf("%d\n",N);
        else
        {
            printf("%lld\n",(con(N + 1,i) - con(side,i - 1) + mod) % mod);
        }
    }
    return 0;
}


Measured memory_bytes: 3584
def main():

    N = int(input())
    a = int(input())
    A = [a]

    if a != 0:
        return -1

    else:
        for i in range(N-1):
            a_ = int(input())
            if a_ > a + 1:
                return -1

            else:
                a =  a_
                A.append(a)
            
        count = 0
        for i in range(N-1):
            a = A[N-1-i]
        
            if a == 0:
                continue
            elif a == A[N-2-i] + 1:
                count += 1
            else:
                count += a
                
        return count

print(main())

Measured memory_bytes: 11028
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    rr = []
    ddd = []
    for i in range(-2,3):
        for j in range(1,4):
            if abs(i)+j > 3:
                break
            ddd.append((i,j))

    while True:
        w,h = LI()
        if w == 0:
            break

        a = [LS() for _ in range(h)]
        b = [[int(c) if '1' <= c <= '9' else 0 for c in t] for t in a]

        def search():
            d = collections.defaultdict(lambda: inf)
            q = []
            for i in range(w):
                if a[-1][i] == 'S':
                    for j in [-1,1]:
                        s = (h-1, i, j)
                        d[s] = 0
                        heapq.heappush(q, (0, s))

            v = collections.defaultdict(bool)
            while len(q):
                k, u = heapq.heappop(q)
                if v[u]:
                    continue
                v[u] = True
                if a[u[0]][u[1]] == 'T':
                    return k

                for di, dj in ddd:
                    ni = u[0] + di
                    nj = u[1] + dj * u[2]
                    if ni < 0 or ni >= h or nj < 0 or nj >= w or a[ni][nj] == 'X':
                        continue
                    uv = (ni,nj,-u[2])

                    if v[uv]:
                        continue
                    ud = b[ni][nj]
                    vd = k + ud
                    if d[uv] > vd:
                        d[uv] = vd
                        heapq.heappush(q, (vd, uv))

            return -1

        rr.append(search())

    return '\n'.join(map(str, rr))



print(main())



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

int		main(void)
{
	string s;
	
	cin >> s;
	vector<char> ans;
	for (int i = 0; s[i]; i++)
	{
		if (s[i] == 'B')
		{
			if (ans.size() > 0)
				ans.pop_back();
		}
		else
			ans.push_back(s[i]);
	}
	for (int i = 0; i < ans.size(); i++)
		cout << ans[i];
	cout << endl;
}



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

int main(){
    ll N;
    cin >> N;
    ll ans = 0;
    for (ll i = 1; i <= N; i++) {
        ll t = N/i;
        ans += t*(t+1)/2*i;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){

	while(true){
		int I, S;
		cin >> I >> S;
		if(I == 0 && S == 0){
			break;
		}

		int* r = new int[I];
		int count = 0;
		int low, hi, mid;

		for(int i = 0; i < I; i++){
			cin >> r[i];
		}

	/*	for(int i = 0; i < I; i++){
			low = i + 1;
			hi = I;

			while(low / hi){
				mid = (low + hi) / 2;
				if(r[i]){
				}
			}

		}*/

		for(int i = 0; i < I - 1; i++){
			for(int j = i + 1; j < I; j++){
				if(r[i] + r[j] > S){
					count++;
				}
			}
		}

		cout << count << endl;

	}

}

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

using namespace std;

using ll = long long;

int main(void){
    ll x,sum;
    vector<ll> mod_price = {5,4,3,2,1};
    vector<ll> mod_count(6,0);

    cin >> x;

    mod_count[0] = x/100;
    ll mod = x % 100;

    for(int i=0; i<mod_price.size(); i++){
        int m=mod_price[i];
        mod_count[m] = mod/m;
        mod -= m*mod_count[m];
        mod_count[0] -= mod_count[m];
    }
    mod_count[0] = max(0ll,mod_count[0]);
    
    sum = mod_count[0]*100;
    for(int i=1; i<mod_count.size(); i++){
        sum+=mod_count[i]*(100+i);
    }

    cout << (int)(sum == x) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
const int MAX = 1e5+1000;
ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  COMinit();

  int n,m;
  cin >> n >> m;
  vector<int> p;
  for (int i = 2; i*i <= m; i++)
  {
    if (m % i == 0) {
      int cnt = 0;
      while (m % i == 0)
      {
        cnt++;
        m /= i;
      }
      p.push_back(cnt);
    }
  }

  if (m > 1) p.push_back(1);
  ll ans = 1;
  for (auto x: p) {
    ans *= COM(x+n-1,x);
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 5976
data class Point(val x:Int, val y:Int){
    fun neighbors():List<Point> = listOf(Point(x + 1, y), Point(x - 1, y), Point(x, y + 1), Point(x, y - 1))
}
class Array2DWithSentinel<T>(array:Array<Array<T>>, val sentinel:T){
    val mArray:Array<Array<T>>
    init{
        mArray = array
    }
    operator fun get(point:Point):T{
        return when (point.y in 0 until mArray.size && point.x in 0 until mArray[point.y].size){
            true -> mArray[point.y][point.x]
            else -> sentinel
        }
    }
}
fun main(args:Array<String>):Unit{
    val (h, w) = readLine()!!.split(' ').map(String::toInt)
    val strings = Array2DWithSentinel(Array(h){ readLine()!!.toCharArray().toTypedArray() }, '.')
    var canDraw = true
    loop@for (x in 0 until w){
        for (y in 0 until h){
            if (strings[Point(x, y)] == '#'){
                if (Point(x, y).neighbors().all { strings[it] == '.' }){
                    canDraw = false
                    break@loop
                }
            }
        }
    }
    println(when(canDraw){
        true -> "Yes"
        false -> "No"
    })
}

Measured memory_bytes: 36332
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<iomanip>
#include<map>
#include<cstring>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const ll LLINF = 1LL<<60;
/* -- template -- */

int main(){
    int N, H; cin >> N >> H;
    P a[N], b[N];
    rep(i, N){
        cin >> a[i].first >> a[i].second;
        b[i].first = a[i].second;
        b[i].second = a[i].first;
    }
    sort(a, a + N);
    int pivot = a[N - 1].first;
    sort(b, b + N);
    int ans = 0;
    for(int i = N - 1;i >= 0;--i){
        if(b[i].first > pivot){
            H -= b[i].first;
            ++ans;
        }
        else{
            break;
        }
        if(H <= 0){
            cout << ans << endl;return 0;
        }
    }
    ans += ((H % pivot == 0) ? H / pivot : H / pivot + 1);
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
    int C;
    double a, b, S, L, h, rad, x;
    double PI = acos(-1);
    
    cin >> a >> b >> C;
    rad = PI * C / 180;
    x = sqrt(a*a + b*b - 2*a*b*cos(rad));
    S = a*b*sin(rad) / 2;
    L = a + b + x;
    h = b*sin(rad);
    printf("%.8f\n %.8f\n %.8f\n", S, L, h);
    return 0;
}


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

using namespace std;

typedef long long ll;

struct LN {
    ll k, b;

    ll f(ll x) {
        return k * x + b;
    }
};

const int N = 1e6 + 10;
const ll INF = 1e18;
LN t[4 * N];
ll dp[N], h[N];

void addLine(int v, int tl, int tr, LN nw) {
    if (t[v].f(tl) < nw.f(tl) && t[v].f(tr) < nw.f(tr)) {
        return;
    }
    if (nw.f(tl) < t[v].f(tl) && nw.f(tr) < t[v].f(tr)) {
        t[v] = nw; return;
    }
    if (tl + 1 == tr)
        return;
    int tm = (tl + tr) >> 1;
    if (t[v].f(tl) > nw.f(tl))
        swap(t[v], nw);
    if (t[v].f(tm) < nw.f(tm))
        addLine(v * 2 + 1, tm, tr, nw);
    else
        swap(t[v], nw), addLine(v * 2, tl, tm, nw);
}

ll get(int v, int tl, int tr, int x) {
    if (tr - tl == 1)
        return t[v].f(x);
    int tm = (tl + tr) >> 1;
    if (x < tm)
        return min(t[v].f(x), get(2 * v, tl, tm, x));
    else
        return min(t[v].f(x), get(2 * v + 1, tm, tr, x));
}

void solve() {
    for (int i = 0; i < 4 * N; i++) {
        t[i] = {0, INF};
    }
    int n;
    ll C;
    cin >> n >> C;
    for (int i = 0; i < n; i++) {
        cin >> h[i];
        if (i != 0) {
            dp[i] = C + h[i] * h[i] + get(1, 1, 1e6, h[i]);
        }
        LN l = {-2 * h[i], dp[i] + h[i] * h[i]};
        addLine(1, 1, 1e6, l);
    }
    cout << dp[n - 1];
}

int main() {
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(20);
    solve();
}


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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var num = new int[5];
            for (int i = 0; i < 5; i++)
            {
                num[i] = ReadInt();
            }
            var k = ReadInt();
            if (Math.Abs(num[4] - num[0]) > k)
            {
                Console.WriteLine(":(");
                return;
            }

            Console.WriteLine("Yay!");
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 13140
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong() * 2;
        }
        Arrays.sort(a);
        long maxR = a[0];
        long maxN = a[n-1];
        for (int i = 1; i < n; i++) {
            if (Math.abs(maxN/2 - maxR) > Math.abs(maxN/2 - a[i])) {
                maxR = a[i];
            }
        }
        System.out.println(maxN/2 + " " + maxR/2);
    }
}

Measured memory_bytes: 53016
X, K, D = [int(x) for x in input().split()]

k = abs(X) // D

if k > K:
    ans = min(abs(X - K * D),abs(X + K * D))
else:
    Xk = min(abs(X - k * D), abs(X + k * D))
    if (K - k) % 2 == 0:
        ans = Xk
    else:
        ans = min(abs(Xk-D),abs(Xk+D))

print(ans)

Measured memory_bytes: 9192
a,b = map(int,input().split())
s = list(str(input()))

flag = True

for i in range(a+b):
    if i == a and not(s[i] == '-'):
        flag = False

    if i is not a and s[i] == '-':
        flag = False


if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
n = gets.chop.to_i
num = gets.chop.split.map(&:to_i)

cnt = 0

##インデックスがほしいときはeach_with_indexを使う
num.each_with_index{|value, index|
  if value != index+1
    cnt += 1
  end
}

if cnt > 2
  puts "NO"
else
  puts "YES"
end


Measured memory_bytes: 1788
from math import*
from bisect import*
import copy

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
brr=copy.deepcopy(arr)
brr=list(set(brr))
brr.sort()
#print(arr)
#print(brr)
ans=0
#print(bisect_right(arr,6))
for i in range(len(brr)):
	d=bisect_left(arr,brr[i])
	c=bisect_right(arr,brr[i]+2)
#	print(d,c)
	if ans<c-d:
		ans=c-d
print(ans)

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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    ll n, c, k; cin >> n >> c >> k;
    vector<ll> lis(n);
    REP(i, 0, n){cin >> lis[i];}
    sort(ALL(lis));
    ll ans = 1, count = 1, mintime = lis[0];
    REP(i, 1, n){
        if(count < c && mintime+k >= lis[i]){
            count++;
        }else{
            count = 1;
            ans++;
            mintime = lis[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
import java.util.*;

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

		int n=sc.nextInt();

		int total=0;
		
		for(int i=1;i<=n;i++){
			total+=i;
		}
		System.out.println(total);

	}
}


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

using namespace std;

int main(){
  int n, ans=0;
  cin >> n;
  vector<int> l(n), r(n);
  for(int i=0;i<n;i++){
    cin >> l[i] >> r[i];
    ans+=r[i]-l[i]+1;
  }
  
  
  cout << ans;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>

using namespace std;
typedef long long ll;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}



int main(){
 int n;
 cin>>n;
 string s[n];
 int a[26];
 int tmp[26];
 for(int i =0; i < 26; i++){
   a[i]=0;
   tmp[i]=0;
 }
 for(int i = 0; i < n; i++){
   cin>>s[i];
   for(int j = 0;j < s[i].length(); j++){
     tmp[s[i][j]-'a']++;
   }
   for(int j =0; j < 26; j++){
     if(i==0){
       a[j]=tmp[j];
     }
     else{
       a[j]=min(a[j],tmp[j]);
     }
     tmp[j]=0;
 }
 }
 for(int i =0; i < 26; i++){
   for(int k = 0; k < a[i]; k++){
     cout<<(char)(i+'a');
   }
 }
 cout<<endl;
return 0;
}

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

int H, W, D;
char col[4] = { 'R', 'Y', 'G', 'B' };

int main() {
    scanf("%d %d %d", &H, &W, &D);

    int p;
    for(int i = 1;; i<<=1) {
        if(D % i) {
            p = i;
            break;
        }
    }

    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            printf("%c", col[ ((i + j) % p) / (p/2) * 2 + (((i - j) % p + p) % p) / (p/2) ]);
        }
        printf("\n");
    }
}


Measured memory_bytes: 512