akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define frw(i, a, b) for(int i = a; i < b; i++)
#define fi first
#define se second
#define pb push_back
#define in insert
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) int(a.size())
#define pii pair<int, int>
#define piii pair<int, pii>
#define pll pair<ll, ll>
#define plll pair<ll, pll>
#define vpii vector<pii>
#define P pair<ll, ll>
#define V vector<ll>
#define C vector<char>
#define vpiii vector<piii>
#define vpll vector<pll>
#define vplll vector<plll>
#define mod 1000000007
#define rep(i, s, n) for (ll i = (ll)(s); i < (ll)(n); i++)


int power(ll x, unsigned int y)  
{  
	ll p=mod;
    ll res = 1;      
  
    x = x % p; 
               
   
    if (x == 0) return 0; 
  
    while (y > 0)  
    {  
       
        if (y & 1)  
            res = (res*x) % p;  
  
       
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}  

int main()
{
	double p=(acos(-1));
	double a,b,x;
	cin>>a>>b>>x;
	double t=(2*x)/(a*b);
	t=b/t;
	double ans=atan(t);
	
	if(2*x>a*a*b)
	{
		x=a*a*b-x;
		t=(2*x)/(a*a*a);
		ans=atan(t);

	}ans=(ans*180)/p;
	//cout<<atan(0);

	
	cout << setprecision(10) << fixed << ans << endl;


}


Measured memory_bytes: 256
#include<iostream>
using namespace std ;
 int main(){
int A,B;
cin>>A>>B;
if(A>=13){
    cout<<B;
}
else if (A<=12&&A>=6){
    cout<<B*0.5;
}
else if(A<=5){
    cout<<0;
}
 return 0;
 }


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

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

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const long double eps = 1E-14;

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

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

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

mint pw(mint a, ll b) {
	if (b == 0) { return 1; }
	mint ret = pw(a, b >> 1);
	ret *= ret;
	if (b & 1) { ret *= a; }
	return ret;
}

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

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

ll X, Y, K;

pair<ll,ll> nxt(ll x, ll y) {

	if (x < 0) {
		auto p = nxt(-x, y);
		return { -p.first,p.second };
	}

	if (y < 0) {
		auto p = nxt(x, -y);
		return { p.first,-p.second };
	}

	if (x < y) {
		auto p = nxt(y, x);
		return { p.second,p.first };
	}

	if (x + y > 2 * K) {
		return{ K,0 };
	}

	if (x + y == K) {
		return { x,y };
	}

	ll t = (2 * K - x - y);

	if (t % 2 == 0) {
		return { K - t / 2,-t / 2 };
	}

	return { K,0 };
}


int main() {
	cin >> K >> X >> Y;

	if (K % 2 == 0 && (abs(X) + abs(Y)) % 2 == 1) { cout << -1 << endl; return 0; }

	ll nowx = 0;
	ll nowy = 0;

	vector<pair<ll, ll>> ans;

	while (nowx != X || nowy != Y) {
		auto p = nxt(X - nowx, Y - nowy);
		nowx += p.first;
		nowy += p.second;
		ans.push_back({ nowx,nowy });
	}

	cout << ans.size() << endl;

	for (auto p : ans) {
		cout << p.first << " " << p.second << endl;
	}
}

Measured memory_bytes: 5740
#include<bits/stdc++.h>
using namespace std;
long long int arr1[30];
int main()
{
int n,k;
cin>>n>>k;
map<int,int>erm;
for(int i=0; i<k; ++i)
{
int l;
cin>>l;
for(int j=0; j<l; ++j)
{
int a;
cin>>a;
++erm[a];
}
}
int cnt(0);
for(int i=1; i<=n; ++i)
{
if(erm[i]==0)
++cnt;
}
cout<<cnt;
}


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

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

  int H; cin >> H;
  int A; cin >> A;
  int ans = (H + A - 1) / A;
  cout << ans << '\n';
  return 0;
}

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

int main() 
{ 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll r,g,b,k;
    cin>>r>>g>>b>>k;
    if((b>g)&&(g>r))
        cout<<"Yes";
    else
    {
        ll c=0;
        while(true)
        {
            if(g>r)break;
            g*=2;
            c++;
        }
        while(true)
        {
            if(b>g)break;
            b*=2;
            c++;
        }
        if(c<=k)
            cout<<"Yes";
        else
            cout<<"No";
    }
    return 0;
}       

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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define per(i, b) per2(i, 0, b)
#define per2(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define ALL(c) (c).begin(), (c).end()

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int X;
    cin >> X;
    int ans = (1999 - X) / 200 + 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3644
#include <cmath>
#include <map>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
const int MaxN = 1e5 + 4;
typedef long long LL;
map<int,int>mp;
pair<int,int> PLL;
int main(){
	char x,y,z;
	cin>>x>>y>>z;
	int t = 0;
	if(x == 'o') t++;
	if(y == 'o') t++;
	if(z == 'o') t++;
	int ans = 700+100*t;
	cout<<ans<<endl;
	return 0;
}

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

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
//vector<vector<int>> z(n,vector<int>(2));
//n番目から数えてm個の文字列をXに置換したい場合はreplace(n,m,X) teWttest
//s1.substr(3,3);
//n番目以降の文字列をm個取り出す、上だとtte

int main(){
  ll a,b;
  cin>>a>>b;

  ll c;
  c=gcd(a,b);
  vector<pair<ll, ll>> res;

  for(ll i=2;i*i<=c;i++){
  //  cout<<i<<endl;
    if(c%i!=0)continue;
    res.push_back(make_pair(i,0));
    while (c%i==0){
      c/=i;
      res.back().second++;
    }
  }
  if (c!=1) res.push_back(make_pair(c,1));
  ll ans;
  ans=res.size()+1;
  cout<<ans;


  }


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<utility>
#include<deque>
#include<iomanip>
#include<ctime>
using namespace std;

int main()
{
	unsigned short N, R;
	cin >> N >> R;

	if (N >= 10) {
		cout << R << endl;
	}
	else {
		cout << R + 100 * (10 - N) << endl;
	}

	return 0;
}

Measured memory_bytes: 256
N=int(input())
H=list(map(int,input().split()))
ans=0
cnt=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        cnt+=1
    if H[i]<H[i+1]:
        if cnt>ans:
            ans=cnt
        cnt=0
if cnt>ans: ans=cnt
print(ans)


Measured memory_bytes: 14252
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mp(x,y)     make_pair(x,y) 
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,a,n)   for(ll i=a;i<n;i++)
#define frr(i,a,n)  for(ll i=n-1;i>=a;i--)


const ll N   =  500005;
const ll mod = 1e9 + 7;

using namespace std;


void solve()
{
// string s;
  ll n,m,k,x=0,y=0,c=0,q,ans=0;
  cin>>n>>m;
  std::vector<ll> a(N);
  for (ll i = 0; i < m; ++i)
  {
    cin>>x>>y;
    a[x]++;
    a[y+1]--;
    
  }
  for (int i = 1; i <N; ++i)
  {
    a[i]+=a[i-1];
  }
  for (int i = 0; i < N; ++i)
  {
    if(a[i]==m)
      c++;
  }
  
  cout<<c<<" ";
}

signed main(){
 
      ios_base::sync_with_stdio(false);   
      cin.tie(NULL);
      ll T=1;
      //cin>>T;
      while(T--)
      {
      solve();
      }
      return 0;
    }


Measured memory_bytes: 4224
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>/*toupperとかが入っている*/
#include<vector>/*可変長配列vectorのインクルード*/
 
const int MOD=1000000007;/* 1,000,000,007 で割った余りを出力する　のとき使う*/
using namespace std;/*標準名前空間を利用する。cinやcoutはこれによって利用可能になる*/
 
string S;

int main(void) {
  cin >> S;
  if(S[2]==S[3] && S[4]==S[5]) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 256
s = int(input())
a_list = list(input())


def get_key(d, value):
    for k, v in d.items():
        if v == value:
            return k


output = []
a_dict = {1: 'A', 2: 'B', 3: 'C', 4: 'D', 5: 'E', 6: 'F', 7: 'G', 8: 'H', 9: 'I', 10: 'J', 11: 'K', 12: 'L', 13: 'M',
          14: 'N', 15: 'O', 16: 'P', 17: 'Q', 18: 'R', 19: 'S', 20: 'T', 21: 'U', 22: 'V', 23: 'W', 24: 'X', 25: 'Y',
          26: 'Z'}
for i, a in enumerate(a_list):
    n = get_key(a_dict, a)
    n += s
    if n > 26:
        if n % 26 == 0:
            n = 26
        else:
            n %= 26
    output.append(a_dict.get(n))
answer = ''.join(output)

print(answer)


Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		String ans = null;
		ans = a < b ? "a < b" : "a > b";
		if (a == b) {
			ans = "a == b";
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 17160
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
void Unused(...) {}
#ifndef DEBUG
  #define echo(...) Unused(__VA_ARGS__)
#else
  #define echo(...) fprintf(stderr, __VA_ARGS__)
#endif

typedef long long laolin;

const int MaxN = int(1e5) + 7;
const int Inf = 0x3f3f3f3f;

int n, k;
int pos[MaxN];
laolin dist[MaxN], sum[MaxN];
int beg = -1;

int main()
{
    // Scan
    scanf("%d %d", &n, &k);
    if (n == 1)
    {
        int p;
        scanf("%d", &p);
        printf("%d\n", abs(p));
        return 0;
    }
    for (int i = 1; i <= n; ++i)
        scanf("%d", pos + i);
    // Calc dist
    //printf("0:0 ");
    for (int i = 2; i <= n; ++i)
    {
        dist[i] = pos[i] - pos[i - 1];
        sum[i] = sum[i - 1] + dist[i];
        //printf("%d:%d ", dist[i], sum[i]);
    }
    //printf("\n");
    // Move win
    laolin ans = Inf;
    for (int i = 1; i <= n - k + 1; ++i)
    {
        laolin shift = 0;
        if (pos[i] > 0)
            shift = pos[i];
        else if (pos[i + k - 1] < 0)
            shift = -pos[i + k - 1];
        else
            shift = std::min(-pos[i], pos[i + k - 1]);
        //printf("at %d, shift %d, width %d\n", i, shift, sum[i + k - 1] - sum[i]);
        ans = std::min(ans, shift + sum[i + k - 1] - sum[i]);
    }
    printf("%lld\n", ans);
    return 0;
}



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

int main() {
    int n;
    cin >> n;
    vector<int> d(n);
    for (int i = 0; i < n; i++) {
        cin >> d[i];
    }
    sort(d.begin(),d.end());
    int number = d.size()/2;
    cout << d[number]-d[number-1] << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 5;
ll lcm(ll a,ll b){return a*b/__gcd(a,b);}
int main()
{
    set<string>s;
    int n;
    cin>>n;
    string o;
    for(int i=0;i<n;i++)cin>>o,s.insert(o);
    cout<<s.size()<<endl;
}


Measured memory_bytes: 19132
def main():
    n = int(input())
    a = list(map(int, input().split()))
    for i in range(200):
        if all(i % 2 == 0 for i in a):
            a = [i // 2 for i in a]
        else:
            print(i)
            break

if __name__ == "__main__":
    main()


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

int main(){
    int n;
    cin >> n;
    int a[n];
    int min,MAX;
    long int total=0;

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

    min=a[0];
    MAX=a[0];

    for(int i=0;i<n;i++){
        if(MAX<a[i]){
            MAX=a[i];
        }

        if(min>a[i]){
            min=a[i];
        }

        total=total+a[i];

    }

    cout << min << ' ' << MAX << ' ' << total << endl;


    return 0;
}


Measured memory_bytes: 3132
#include<stdio.h>

int main(void){
  int a, b;
  scanf("%d%d", &a, &b);

  if(a < 1 || a > 9 || b < 1 || b > 9){
    printf("-1\n");
  }
  else{
    printf("%d\n", a * b);
  }

  return 0;
}


Measured memory_bytes: 128
import java.io.PrintWriter
import kotlin.math.pow

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun Int.pow(n: Int) = pow(n.toLong())
fun Int.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()
fun Long.pow(n: Int) = pow(n.toLong())
fun Long.pow(n: Long) = toDouble().pow(n.toDouble()).toLong()

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val N = nextInt()
    val L = nextIntList().sorted().filterIndexed { index, l -> index % 2 == 0 }
    println(L.sum())
}

Measured memory_bytes: 40580
#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 <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    VS a(3);
    REP(i,3){
        cin >> a[i];
    }
    FOR(i, 1, 3) {
        if (a[i - 1][SZ(a[i-1]) - 1] != a[i][0]) {
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
  string x; cin>>x;
  int n = x.size();
  int s=0, st=0;
  rep(i,n){
    if(x[i]=='S'){
      s++;
    }else if(s>0){
      s--; st++;
    }
  }
  cout << n-st*2 << endl;
  return 0;
}


Measured memory_bytes: 720
#include<bits/stdc++.h>
using namespace std;
#define rkc ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define rfl(i,a,b) for(ll i=a;i>b;i--)
#define pb push_back
#define mp make_pair
#define test ll t;cin>>t;while(t--)
#define lld long double
#define vpp vector<pair<ll,ll>>
#define ff first
#define ss second
const ll M = 1e9 + 7;
const double pi  =3.141592653589793238463;
int main()
{
    rkc;
    ll a,b,q[3];
    cin>>a>>b;
    q[0]=a+b;q[1]=a-b;q[2]=a*b;
    sort(q,q+3);
    cout<<q[2];
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
	string s,s1,s2;
	cin>>s;
	while(true){
		s=s.erase(s.size()-2);
		s1=s.substr(0,s.size()/2);
		s2=s.substr(s.size()/2);
		if(s1==s2){
			cout<<s.size();
			break;
		}
	}
}

Measured memory_bytes: 256
input = gets(nil).chomp

input.split("\n").each_slice(2) do |l1, l2|
  x = l1.to_i
  h = l2.to_i
  exit if x == 0 && h == 0

  puts x * Math.sqrt(4 * (h**2) + x**2) + x ** 2
end

Measured memory_bytes: 6124
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;
using static System.Array;

class Program
{
	public static void Main()
	{
		var n = int.Parse(ReadLine());
		var a = ReadLine().Split().Select(long.Parse).ToArray();
		var d = new Dictionary<long, long>();
		for(int i = 0; i < n; i++)
		{
			if(!d.ContainsKey(a[i]))
				d.Add(a[i], 0);
			d[a[i]]++;
		}
		var four = 0L;
		if(d.Where(x => x.Value >= 4).Count() > 0)
			four = d.Where(x => x.Value >= 4).Max(x => x.Key);
		var two1 = 0L;
		if(d.Where(x => x.Value >= 2).Count() > 0)
			two1 = d.Where(x => x.Value >= 2).Max(x => x.Key);
		var two2 = 0L;
		if(d.Where(x => x.Value >= 2 && x.Key != two1).Count() > 0)
			two2 = d.Where(x => x.Value >= 2 && x.Key != two1).Max(x => x.Key);
		WriteLine(Max(four * four, two1 * two2));
	}
}


Measured memory_bytes: 36412
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()

using namespace __gnu_pbds;
using namespace std;

using ull = unsigned long long;
using ll = long long;
using ld = long double;
template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;

const int mod = 1e9 + 7;
const int inf = INT_MAX;
const int N = 2e5 + 5;

int n, a[N];

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

    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    sort(a, a + n);
    int c = n - 2;

    ll sum = a[n - 1];
    for (int i = n - 2; i >= 0; i--) {
        if (c == 0)
            break;
        if (c >= 2) {
            sum += 2 * a[i];
            c -= 2;
        }
        else {
            sum += a[i];
            c--;
        }
    }

    cout << sum << "\n";
    return 0;
}

Measured memory_bytes: 4436
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, x;
    cin >> n >> x;
    if (x == (2 * n - 1) || x == 1){
        printf("No\n");
    }
    else {
        printf("Yes\n");
        for (int i = 1, j = 2; i <= 2 * n - 1; i++) {
            if (i == n - 1)
                printf("1\n");
            else if (i == n)
                printf("%d\n", x);
            else if (i == n + 1)
                printf("%d\n", 2 * n - 1);
            else {
                if (j == x) j++;
                printf("%d\n", j);
                j++;
            }
        }
    }
}


Measured memory_bytes: 1536
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        String[] lines = getStdin();
        
        String[] input = lines[0].split(" ");
        int x = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        
        if (x < a){
            System.out.println("0");
        }
        else if (x >= a){
            System.out.println("10");
        }     
    }
    
    private static String[] getStdin() {
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> lines = new ArrayList<>();
        while (scanner.hasNext()) {
            lines.add(scanner.nextLine());
        }
        return lines.toArray(new String[lines.size()]);
    }
}

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

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

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

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

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const int MAXN = 120000;

int n;
ll a[MAXN];
vector<int> vv;
int ff[MAXN * 2];

void add(int x) {
	for (; x < MAXN * 2; x |= (x + 1))
		ff[x] += 1;
}

int get(int x) {
	int ans = 0;
	for (; x >= 0; x = (x & (x + 1)) - 1)
		ans += ff[x];
	return ans;
}

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		vv.push_back(a[i]);
	}
	sort(ALL(vv));
	vv.resize(unique(ALL(vv)) - vv.begin());
	int lb = 0;
	int rb = vv.size();
	ll all = ll(n) * (n + 1) / 2;
	while (rb - lb > 1) {
		int mid = (lb + rb) >> 1;
		memset(ff, 0, sizeof(ff));
		int cur = n;
		add(cur);
		ll now = 0;
		for (int i = 0; i < n; ++i) {
			if (a[i] >= vv[mid])
				++cur;
			else
				--cur;
			now += get(cur);
			add(cur);
		}
		if (now * 2 >= all)
			lb = mid;
		else
			rb = mid;
	}
	cout << vv[lb] << "\n";
	return 0;
}




Measured memory_bytes: 2552
#include <bits/stdc++.h>
#pragma GCC optimize("O3")  
#define pb push_back
#define F first
#define S second
using ll = long long;
using namespace std;
                          
const int N=200005+1;
int arr[N];
int n,k;
/*
bool check(int x){
	int step=0;
	for(int i=0;i<n;i++){
		if(x>=arr[i]) continue;
		int z=(x+arr[i]-1)/x;
		z--;
		step+=z;
		
	} 
//	return step;
	if(k==step) return true;
	return false; 
}
*/
void solve(){     
	   cin>>n>>k;
	   int val=0;
	   for(int i=0;i<n;i++){
	   	cin>>arr[i];
	   	val+=arr[i]+1;
	   }
	   int l=1;
	   int r=1000000000+1;
	   int ans=0; 
	   while(l<=r){
	   	int mid=l+(r-l)/2;	   	
	   	int step=0;
		for(int i=0;i<n;i++){
			if(mid>=arr[i]) continue;
			int z=(mid+arr[i]-1)/mid;
			z--;
			step+=z;
		} 
		if(step<=k){
			ans=mid;
			r=mid-1;				
		}
		if(step>k){
			l=mid+1;	
		}
	  }
	  cout<<ans<<endl;
	   
	
}


int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}






Measured memory_bytes: 4392
//k_tourist
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define mx 500005
#define non __builtin_popcount
#define ml map<ll, ll> 
#define uml unordered_map<ll, ll>
#define ms map<string , ll> 
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define pl pair<ll, ll>
#define vl vector<ll>
#define vll vector<pl>
#define tpl pair<ll, pl>
#define vlll vector<tpl>
#define vs vector<string>
#define pb push_back
#define mk make_pair
#define M_PI 3.14159265358979323846
#define endl '\n'
#define fst ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%I64d",&x)
#define inf ((ll)1e18 + 1)
#define bs binary_search
#define pq priority_queue
#define ub upper_bound
#define lb lower_bound
#define pow powr
#define rep(i,a,b)  for (i=(a);i<(b);i++)
#define nrep(i,a,b) for (i=(a);i>(b);i--)
using namespace std;
 
bool isp[mx];
 
void sv(){
 
	ll i,j;
	memset(isp, true, sizeof(isp));
	
	isp[1]= false;
	for(i=2;i*i<mx;i++){
		if(isp[i]){
			for(j=i*i;j<mx;j+=i)
			isp[j]= false;
		}
	}
}
 
ll powr(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b&1)res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

void bta_de_yarr(){
    
	ll  i, j,n;// a[mx], b[mx], c[mx];
    vl a, b, c;
	cin>>n;
	rep(i, 1, n+1)
	{
        // //cin>>a[i];
        // b[i]= a[i];
        ll tmp;
        cin>>tmp;
        a.pb(tmp);
        b.pb(tmp);
    }

    rep(i, 1, n+1)
    {
        ll tmp;
        cin>>tmp;
        c.pb(tmp);
    }

    map<vl, ll> mp;
    //sort(b, b+n);

   // sort(a, a + n);
   sort(all(a)); 
  
  i=0;
    // Find all possible permutations 
   // cout << "Possible permutations are:\n"; 
    do { 
       // display(); 

        mp[a]= i;
        i++;
    } while (next_permutation(all(a)));//(a, a + n)); 


    ll x1, x2;
    i=0;
    auto it= mp.begin();
    while(it != mp.end()){

        if(it->ff == b)
        x1= i;

        if(it->ff == c)
        x2= i;

        i++;
        it++;
    }

    ll ans= abs(x1 - x2);
    cout<<ans;
	
	cout<<endl;
}

int main(){
    fst
	ll t;
    t= 1;
	//cin>>t;
    while(t--){
        bta_de_yarr();
    }
    return 0;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Measured memory_bytes: 6528
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#include <utility>
#include <set>
#include <stack>
#include <deque>
#include <ctime>
#include <random>
#include <cassert>
#include <cmath>
#include <climits>
#include <queue>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <chrono>

/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("popcnt")
#pragma GCC target("avx2")
*/


#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << x << endl;
#else 
    #define dbg(x)
#endif

#define int long long
#define fi(a,b) for (int i=a;i<b;i++)
#define fj(a,b) for (int j=a;j<b;j++)
#define fk(a,b) for (int k=a;k<b;k++)
#define fi1(a,b) for (int i=a-1;i>=b;i--)
#define fj1(a,b) for (int j=a-1;j>=b;j--)
#define fk1(a,b) for (int k=a-1;k>=b;k--)
#define fx(x,a) for (auto& x : a)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rep1(i, a, b) for (int i = a - 1; i >= b; --i)
#define siz(x) (int)x.size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;

template<typename T1, typename T2>inline void mine(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void maxe(T1 &x, T2 y) { if (x < y) x = y; }

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << ' ';
    return a;
}


typedef long long ll;
typedef unsigned long long ull;
typedef char ch;
typedef string str;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<ch> vch;
typedef vector<vch> vvch;
typedef vector<str> vs;



const int MOD = 1000000007;
const int INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const int MX = 200010;
const double EPS = 1e-9;


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


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    str s;
    cin >> s;
    if (s[1] == 'B')
        cout << "ARC";
    else
        cout << "ABC";
}

Measured memory_bytes: 3648
#include<stdio.h>
#include<string.h>
#include<utility>
#include<queue>
using namespace std;

char maze[1000][1001];
void solve()
{
	bool flag[1000][1000]={0};
	int h,w,n,pow=1,ans=0;
	int h_route[4]={1,0,-1,0};
	int w_route[4]={0,1,0,-1};
	typedef pair <int,int> P;
	typedef pair<int ,P> P2;
	P data[10];


	scanf("%d %d %d\n",&h,&w,&n);
	
	for(int i=0;i<h;i++)//迷路読み込み
		for(int j=0;j<w+1;j++)
		{
			scanf("%c",&maze[i][j]);
			if(maze[i][j]=='S')
				data[0]=P(i,j);
			else if(maze[i][j] >='1' && maze[i][j] <='9')
				data[maze[i][j]-'0']=P(i,j);
		}

	for(int i=0;i<n;i++)
	{
		queue<P2> que;
		que.push(P2(ans,P(data[i].first,data[i].second)));
		while(!que.empty())
		{

			P2 temp = que.front();
			que.pop();
			if(temp.second.first==data[i+1].first && temp.second.second==data[i+1].second)
			{
				memset(flag,0,sizeof(flag));
				ans=temp.first;
				break;
			}
			for(int j=0;j<4;j++)
			{
				int Th=temp.second.first+h_route[j];
				int Tw=temp.second.second+w_route[j];
				if(Th>=0 && Th<h && Tw>=0 && Tw<w && maze[Th][Tw]!='X' && flag[Th][Tw]!=1)
				{
					que.push(P2(temp.first+1,P(Th,Tw)));
					flag[Th][Tw]=1;
				}
			}
		}
		
	}
	printf("%d\n",ans);
}

int main()
{
	solve();
}

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

int main() {
  int n;
  cin >> n;
  
  unordered_set<int> b;
  for(int i=0; i<n; i++) {
    int a;
    cin >> a;
    b.insert(a);
  }
  
  if(n==b.size()) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0; 
}

Measured memory_bytes: 11376
package main

import (
	"bufio"
	"os"
	"sort"
	"strconv"
	"fmt"
)

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)
}

//func nextString() string {
//	sc.Scan()
//	return sc.Text()
//}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n := nextInt()
	k := nextInt()
	p := make([]int, n, n)

	for i := 0; i < n; i++ {
		p[i] = nextInt()
	}

	sort.Ints(p)

	min := 0
	for i := 0; i < k; i++ {
		min += p[i]
	}

	fmt.Println(min)
}


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

int main(){
  int N, K;
  int len=0;
  cin >> N >> K;
  for(int i=0; i<N; i++){
    int x; cin >> x;
    len+= min(x-0, K-x);
  }
  cout << 2*len << endl;
  return 0;
}

Measured memory_bytes: 256
# encoding: utf-8
S = input()

ans = 0
state = 0
for i, Si in enumerate(S):
    # process
    if state < 1 and Si == 'B':
        state += 1
        marker = i
    elif state > 0 and Si == 'W':
        ans += i - marker
        marker += 1

print(ans)

Measured memory_bytes: 3500
s = input()
t = input()

cor = 0
ans = 0

for entry in range(len(s)-len(t)+1):
    for i in range(len(t)):
        if s[entry + i] == t[i]:
            cor += 1
    if ans < cor:
        ans = cor
    cor = 0

print(len(t)-ans)


Measured memory_bytes: 9052
//{{{
#include <bits/stdc++.h>
using namespace std;
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop,~))(__VA_ARGS__)
#define loop(n) rep2(_loop_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define repN(a) repX a
#define repX(a0,a1,a2,x,...) x
#define foreach(x,a) for(auto &x:a)
typedef long long ll;
const ll MOD = 998244353;
//}}}

int main(){
  int N;
  cin >> N;
  int ans = 0;
  rep(i, N){
    int a;
    cin >> a;
    while(a % 2 == 0){
      ans++;
      a /= 2;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
threshold :: Int -> [Int] -> Float
threshold m as = (fromIntegral . sum $ as) / (4.0 * fromIntegral m) 

point :: Int -> [Int] -> Int -> Int
point m as a = if fromIntegral a >= threshold m as then 1 else 0

selectedCount :: Int -> [Int] -> Int
selectedCount m as = foldr ((+) . point m as) 0 as

result :: Int -> [Int] -> String
result m as = if m <= selectedCount m as then "Yes" else "No"



main :: IO ()
main = do

    [n, m] <- map read . words <$> getLine :: IO [Int]
    as <- map read . words <$> getLine :: IO [Int]
    let as' = take n as 
    putStrLn $ result m as'

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

int main() {
    int a,b;
    cin>>a>>b;
    if(a%3!=0&&b%3!=0&&(a+b)%3!=0){
        cout<<"Impossible"<<endl;
    }else{
        cout<<"Possible"<<endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#define rep(i,st,ed) for (int i=st;i<=ed;++i)
#define lb(x) (x&-x)

const int N=500005;

struct data {
	int l,r;
} p[N];

int s[N],n,m;

int read() {
	int x=0,v=1; char ch=getchar();
	for (;ch<'0'||ch>'9';v=(ch=='-')?(-1):v,ch=getchar());
	for (;ch<='9'&&ch>='0';x=x*10+ch-'0',ch=getchar());
	return x*v;
}

void add(int x,int v) {
	for (;x<=m;x+=lb(x)) s[x]+=v;
}

int get(int x) {
	int res=0;
	for (;x;x-=lb(x)) res+=s[x];
	return res;
}

bool cmp(data a,data b) {
	return (a.r-a.l<b.r-b.l);
}

int main(void) {
	n=read(),m=read();
	rep(i,1,n) p[i].l=read(),p[i].r=read();
	std:: sort(p+1,p+n+1,cmp);
	int rec=n;
	for (int d=1,j=1;d<=m;++d) {
		while (j<=n&&p[j].r-p[j].l+1<d) {
			add(p[j].l,1),add(p[j].r+1,-1);
			j++,rec--;
		}
		int ans=rec;
		for (int i=0;i<=m;i+=d) {
			ans+=get(i);
		}
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 3584
d,n = map(int, input().split())
r = 0
if n == 100:
    if d == 0:
        print( 1 * 101)
    elif d == 1:
        print( 100 * 101)
    elif d == 2:
        print( 100*100 * 101)
else:
    if d == 0:
        print(n * 1)
    elif d == 1:
        print(n * 100)
    elif d == 2:
        print(n * 100*100)

Measured memory_bytes: 38608
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	// 問題数
	_ = nextInt()
	// 提出回数
	m := nextInt()

	was := map[int]int{}
	acs := map[int]bool{}
	for i := 0; i < m; i++ {
		j := nextInt()
		res := nextString()
		if _,ok := acs[j]; ok {
			continue
		}
		if res  == "WA" {
			was[j]++
		} else {
			acs[j] = true
		}
	}

	finAcs := len(acs)
	finWas := 0

	for j,_ := range acs {
		if r,ok := was[j]; ok {
			finWas += r
		}
	}

	fmt.Printf("%d %d\n" ,finAcs, finWas)
}


Measured memory_bytes: 6912
// Aizu Vol-5 0510: Score
// 2017.8.30 bal4u@uu

#include <stdio.h>

int main()
{
	int sa, sb, a, i;

	sa = sb = 0;
	for (i = 0; i < 4; i++) scanf("%d", &a), sa += a;
	for (i = 0; i < 4; i++) scanf("%d", &a), sb += a;
	if (sb > sa) sa = sb;
	printf("%d\n", sa);
	return 0;
}

Measured memory_bytes: 592
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *

sys.setrecursionlimit(100000000)


def input(): return sys.stdin.readline().rstrip()


N = int(input())


def f(x):
    ans = set()
    i = 1
    while i * i <= x:
        if x % i == 0:
            ans.add(i)
        i += 1
    for i in ans.copy():
        ans.add(x // i)
    return ans

ans = set()
for K in f(N) | f(N - 1):
    if K == 1:
        continue
    n = N
    while n % K == 0:
        n //= K
    if n % K == 1:
        ans.add(K)

print(len(ans))


Measured memory_bytes: 40432
#include<bits/stdc++.h>
#define fr(i,a,n) for(ll i=a;i<n;i++)
#define YES cout<<"YES"<<endl
#define all(v) v.begin(),v.end()
#define NO cout<<"NO"<<endl
#define pb(x) emplace_back(x)
#define fastio std::ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define vi vector<ll>
#define mi map<ll,ll>
#define pi pair<ll,ll>
#define what(x) cout<<#x<<" ="<<x<<endl;
using namespace std;
using ll =long long;


int main()
{
    ll t;
    ll mod=1e9+7;

        ll n;
        cin>>n;
        ll a[n+5]={0},cum[n+5]={0};

        fr(i,0,n)cin>>a[i];
        ll ans=0;
        fr(i,0,n)
        {
            cum[i+1]=cum[i]+a[i];
        }

        fr(i,0,n)
        {
            ans=ans%mod+(cum[n]-cum[i+1])%mod*a[i]%mod;
           // cout<<cum[n]-cum[i+1]<<endl;
           // cout<<ans<<endl;
        }

        cout<<ans<<endl;


}



























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

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


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	p := make([]string, 3)
	fmt.Scan(&p[0], &p[1], &p[2])
	i := 0
	for len(p[i]) > 0 {
		i, p[i] = int(p[i][0])-'a', p[i][1:]
	}
	fmt.Println(string(i + 'A'))
}


Measured memory_bytes: 512
#include <stdio.h>

int main(void){

	double a, b, c, d, e, f;

	double x, y;

	while ((scanf("%lf %lf %lf %lf %lf %lf", &a, &b, &c, &d, &e, &f))!=EOF){

		x = (c*e - b*f) / (a*e - b*d);
		y = (a*f - c*d) / (a*e - b*d);

		x *= 1000; x = x + (x > 0 ? 0.5 : -0.5); x = (int)x;
		y *= 1000; y = y + (y > 0 ? 0.5 : -0.5); y = (int)y;
		printf("%.3f %.3f\n", x / 1000, y / 1000);
	}

	return 0;
}

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

"""
参考：https://img.atcoder.jp/abc061/editorial.pdf
・ベルマンフォード
・負の閉路があっても、そこに頂点Nが含まれなければ今回はOK
　って点に気付けなかったー。
"""

import sys
def input(): return sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)

N, M = map(int, input().split())

edges = [None] * M
for i in range(M):
    a, b, c = map(int, input().split())
    # 0-indexed
    # コストの正負を逆転させれば最短経路問題として処理できる
    edges[i] = (a-1, b-1, -c)

def bellman_ford(N: int, edges: list, start: int) -> list:
    # 頂点[ある始点からの最短距離]
    # (経路自体を知りたい時はここに前の頂点も持たせる)
    verts = [float('inf')] * N
    verts[start] = 0
    # 各辺によるコストの置き換えを頂点数N-1回繰り返す
    for i in range(N-1):
        for src, dest, cost in edges:
            if verts[dest] > verts[src] + cost:
                verts[dest] = verts[src] + cost
    # 無限に減らせる場所がないか確認
    for src, dest, cost in edges:
        if verts[dest] > verts[src] + cost:
            verts[dest] = verts[src] + cost
            if dest == N-1:
                # 頂点Nがそれに該当していたら空リストを返却
                return []
    # 問題なければ頂点リストを返却
    return verts

verts = bellman_ford(N, edges, 0)
if not verts:
    print('inf')
else:
    # 正負を戻して出力
    print(-verts[N-1])


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

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

using ll = long long;
using ld = long double;
using ull = unsigned long long;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

struct st {
    ll a, b;
};

const int N = 120000;

st a[N];

int n;
ll sm[N];

ll ap = 0;
ll aq = 1;

ll gcd(ll a, ll b) {
    while (b) {
        ll q = a % b;
        a = b;
        b = q;
    }
    return a;
}

using lll = __int128_t;

void upd(ll p, ll q) {
    ll g = gcd(p, q);
    p /= g, q /= g;
    if (lll(ap) * q < lll(p) * aq) {
        ap = p;
        aq = q;
    }
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cout.setf(ios::fixed), cout.precision(20);
    cin >> n;
    ll sum = 0;
    for (int i = 0; i < n; ++i) {
        cin >> a[i].a >> a[i].b;
        sum += a[i].a;
    }
    sort(a, a + n, [] (st a, st b) {
                return max(a.a, a.b) > max(b.a, b.b);
            });
    sm[0] = 0;
    for (int i = 0; i < n; ++i) {
        sm[i + 1] = sm[i] + max(a[i].a, a[i].b);
    }
    for (int i = 0; i < n; ++i) {
        int l = 0;
        int r = n + 1;
        while (r - l > 1) {
            int m = (l + r) >> 1;
            ll cur = sum - a[i].b - sm[m];
            if (i < m) {
                cur += max(a[i].a, a[i].b);
            }
            if (cur > 0) {
                l = m;
            } else {
                r = m;
            }
        }
        if (r <= n) {
            int cnt = r;
            if (i >= r) {
                ++cnt;
            }
            cnt = n - cnt;
            ll cur = sum - sm[r];
            if (i < r) {
                cur += max(a[i].a, a[i].b);
            }
            if (cur <= 0) {
                upd(cnt + 1, n);
            } else {
                assert(cur <= a[i].b);
                ll p = cnt * a[i].b + a[i].b - cur;
                ll q = a[i].b * n;
                upd(p, q);
            }
        }
    }
    cout << ap << " " << aq << "\n";
	return 0;
}




Measured memory_bytes: 2560
#include <iostream>
#include <math.h>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define DIV 1000000007;
#define INF 1e9

using namespace std;

ll a, b, c, d, res;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> a >> b >> c >> d;
	cout << max({ a*c, a*d, b*c, b*d });
	return 0;
}

Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug: "<<x<<" "<<y<<endl;
using namespace std;
typedef long long ll;
const int maxn = 100005;
const int mod = 1000000007;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n;
  cin>>n;
  for(int i=1;i<=9&&i<=n;i++)if(n%i==0&&n/i<=9){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		out.println(sc.next().replace('?', 'D'));
		
		out.flush();
	}
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 36532
n = int(input())
a = list(map(int,input().split()))
m = [a[0]]
for i in range(1,n):
  m += [min(m[i-1], a[i])]
ans = 0
for i in range(n):
  ans += 1 if a[i] <= m[i] else 0
print(ans)

Measured memory_bytes: 26012
package main
import (
  "bufio"
  "fmt"
  // "math"
  "os"
  "strconv"
  "strings"
)

// 行単位で読み込む場合
var sc = bufio.NewScanner(os.Stdin)

func main() {
  sc.Scan()
  N, _ := strconv.Atoi((strings.Split(sc.Text(), " "))[0])
  X, _ := strconv.Atoi((strings.Split(sc.Text(), " "))[1])
  var list []int
  for i := 0; i < N; i++ {
    sc.Scan()
    val, _ := strconv.Atoi(sc.Text())
    list = append(list, val)
  }

  X -= arraySum(list)
  ans := N
  minDonut := arrayMin(list)
  ans += X / minDonut
  fmt.Println(ans)
}

// 配列中の文字列を全て数値に変換
func arrayAtoi(array []string) []int {
  retarray := []int{}
  for _, v := range array {
    num, e := strconv.Atoi(v)
    if e != nil {
      panic(e)
    }
    retarray = append(retarray, num)
  }
  return retarray
}

// 配列中の最小値を返す
func arrayMin(array []int) int {
  min := array[0]
  for _, v := range array {
    if v < min {
      min = v
    }
  }
  return min
}

// 配列中の要素の和を返す
func arraySum(array []int) int {
  sum := 0
  for _, v := range array {
    sum += v
  }
  return sum
}


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


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>


ll n, m;
bool used[110000];
vector<ll> g[110000], x, y, ans;

void dfs(ll a, ll b) {
	vector<ll> res;
	if(b == 0) x.push_back(a);
	else y.push_back(a);
	REP(i, g[a].size()) {
		if (!used[g[a][i]]) {
			used[g[a][i]] = true;
			dfs(g[a][i], b);
			break;
		}
	}
}

int main() {
	cin >> n >> m;
	REP(i, m) {
		ll a, b;
		cin >> a >> b;
		a--;
		b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	used[0] = true;
	dfs(0, 0);
	reverse(ALL(x));
	if (g[0].size() >= 2) {
		dfs(0, 1);
		reverse(ALL(y));
		y.pop_back();
		reverse(ALL(y));
	}
	cout << (ll)x.size() + y.size() << endl;
	REP(i, x.size()) {
		if (i != 0)cout << " ";
		cout << x[i] + 1;
	}
	REP(i, y.size()) {
		cout << " " << y[i] + 1;
	}
	cout << endl;
}


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

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int N, K;
  cin >> N >> K;
  cout << ((N+1)/2 >= K ? "YES" : "NO") << endl;
  return 0;
}

Measured memory_bytes: 256