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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    int n; cin >> n;
    vll a(n), sum(n+1, 0); 
    rep(i, n) {
        cin >> a[i];
        sum[i+1] = sum[i] + a[i];
    }
    
    ll ans = 1e18;
    
    auto f = [&](int a, int b){
        return sum[a+1] - 2 * sum[b+1];    
    };
    
    auto g = [&](int a, int b){
        return sum[(n-1)+1] - 2 * sum[b+1] + sum[a+1];    
    };
    
    rep3(m,1,n-3){
        // a[0] -> a[m], a[m+1] -> a[n-1]
        set<ll> cand;
        auto cpush = [&](int a, int b){
            cand.insert(sum[a+1] - sum[b+1]);
            return;
        };

        int l = 0, r = m;
        while(l + 1 != r){
            int mid = (l + r) / 2;
            if(f(m, mid) >= 0){
                l = mid;
            }else{
                r = mid;
            }
        }
        // cout << "debug1: " << l << " " << r << " " << m << endl;
        if(abs(f(m,l)) > abs(f(m,l+1))){
            cpush(l+1, -1);
            cpush(m, l+1);
        }else{
            cpush(l, -1);
            cpush(m, l);
        }
        
        l = m+1; r = n-1;
        while(l + 1 != r){
            int mid = (l + r) / 2;
            if(g(m,mid) >= 0){
                l = mid;
            }else{
                r = mid;
            }
        }
        // cout << "debug2: " << l << " " << r << " " << m << endl;
        if(abs(g(m,l)) > abs(g(m,l+1))){
            cpush(l+1, m);
            cpush(n-1, l+1);
        }else{
            cpush(l, m);
            cpush(n-1, l);
        }
        
        /*
        cout << m << ": ";
        for(auto c : cand){
            cout << c << " ";
        }
        cout << endl;
        //*/
        
        ll tmp = abs(*cand.begin() - *cand.rbegin());
        ans = min(ans, tmp);        
    }
    cout << ans << endl;
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Measured memory_bytes: 6336
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
	for j in range(1,105):
		for k in range(1,105):
			v = i*i+j*j+k*k+i*j+j*k+k*i;
			if v<10050:
				ans[v]+=1
for i in range(n):
	print(ans[i+1])


Measured memory_bytes: 9368
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll MOD = 1e9+7;
ll LLINF = 1LL << 60;
int INF = INT_MAX;

int main(){
    ll n,h; cin>>n>>h;
    priority_queue<pair<ll,ll>> v;
    rep(i,0,n){
        ll x,y; cin>>x>>y;
        v.push(make_pair(x,0));
        v.push(make_pair(y,1));
    }
    ll res=h;
    ll ans=0;
    while(!v.empty()){
        if(v.top().second==0){
            cout<<ans+(ll)ceil((res+0.0)/v.top().first)<<endl;
            return 0;
        }else{
            res-=v.top().first;
            ans++;
            v.pop();
            if(res<=0){
                cout<<ans<<endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 6384
#include<bits/stdc++.h>
#include <math.h>
#include <map>
#include <unordered_map>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define pb(s) push_back(s)
#define CST(x) cout<<fixed<<setprecision(x)
#define ci(x) cin >>x
#define co(x) cout<<x<<endl
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vvpl=vector<vector<pl>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
long long fac(ll a) {
 long long ans=1;
 while(a>1){
 ans*=a;
 ans%=1000000007;
     a--;
    }
    return ans;
     }

ll PS(ll x) {
  ll c=1;
  rep(i,x) {
    c=c*2;
  }
  return c;
}


int main() {
string S;
  string T;
  cin >>S>>T;
  
  ll c=0;
  rep(i,S.size()) {
if(S.at(i)!=T.at(i)){
  c++;
   }
   }

   
   
   cout<<c<<endl;
   }


Measured memory_bytes: 3796
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int h, w;
    cin >> h >> w;
    vector<vector<char>>vec(h,vector<char>(w));
    vector<int>dx{ 0, 1,  0, -1};
    vector<int>dy{ 1, 0, -1,  0};
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cin >> vec[i][j];
        }
    }
    bool flg=1;
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(vec[i][j]=='#'){
                for(int t=0; t<4; t++){
                    if(i+dx[t]>=0 && i+dx[t]<h && j+dy[t]>=0 && j+dy[t]<w && vec[i+dx[t]][j+dy[t]]=='#'){
                        flg=0;
                    }
                }
                if(flg){
                    puts("No");
                    return 0;
                }
                flg = 1;
            }
        }
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 3624
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    A, B = NMI()
    C = [[0]*2 for _ in range(42)]
    B = B + 1
    for i in range(42):
        tmp = B - (B // (2**(i+1))) * 2**(i+1)
        if tmp < 2**i:
            C[i][0] = tmp + (B // (2**(i+1))) * 2**i
            C[i][1] = (B // (2 ** (i + 1))) * 2 ** i
        else:
            C[i][0] = 2**i + (B // (2**(i+1))) * 2**i
            C[i][1] = tmp - 2**i + (B // (2**(i+1))) * 2**i


    B = A
    for i in range(42):
        tmp = B - (B // (2**(i+1))) * 2**(i+1)
        if tmp < 2**i:
            C[i][0] -= tmp + (B // (2**(i+1))) * 2**i
            C[i][1] -= (B // (2 ** (i + 1))) * 2 ** i
        else:
            C[i][0] -= 2**i + (B // (2**(i+1))) * 2**i
            C[i][1] -= tmp - 2**i + (B // (2**(i+1))) * 2**i
    ans = 0
    for i in range(42):
        ans += C[i][1] % 2 * 2**i
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 9116
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll MOD = 1e9+7;

int main(){
  string s;
  cin>>s;
  int c=0,f=0;
  for(int i=0;i<s.size();i++){
	if(s[i]=='C')c=1;
	if(s[i]=='F'&&c)f=1;
  }
  cout<<(c&&f?"Yes":"No")<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n, f[MAXN], dis[MAXN];
template <class T>
inline void _read(T &x)
{
    x = 0;
    char t = getchar();
    while(!isdigit(t) && t != '-') t = getchar();
    if(t == '-')
    {
        _read(x);
        x *= -1;
        return ;
    }
    while(isdigit(t))
    {
        x = x * 10 + t - '0';
        t = getchar();
    }
}
inline int getfa(int x)
{
    if(f[x] == x)
        return x;
    int fx = getfa(f[x]);
    dis[x] ^= dis[f[x]];
    return f[x] = fx;
}
inline void merge(int u, int v)
{
    int x = getfa(u), y = getfa(v);
    if(x == y) return;
    dis[y] = (dis[v] ^ dis[u] ^ 1), f[y] = x;
}
struct T
{
    int root, head[MAXN], cnt, to[MAXN], nxt[MAXN], son[MAXN];
    inline void ae(int u, int v)
    {
        ++cnt, to[cnt] = v, nxt[cnt] = head[u], head[u] = cnt;
    }
    inline void init()
    {
        for(int i = 1, fa; i <= n; ++i)
        {
            _read(fa);
            if(fa == -1)
                root = i;
            else
                ae(fa, i), ++son[fa];
        }
    }
    inline int work(int u)
    {
        vector<int> tp;
        for(int i = head[u]; i; i = nxt[i])
            tp.push_back(work(to[i]));
        if(!(son[u] & 1))
            tp.push_back(u);
        sort(tp.begin(), tp.end());
        for(int i = 1; i < tp.size(); i += 2)
            merge(tp[i], tp[i + 1]);
        return tp[0];
    }
};
T A, B;
int main()
{
    _read(n);
    A.init(), B.init();
    for(int i = 1; i <= n; ++i)
    {
        f[i] = i, dis[i] = 0;
        if((A.son[i] & 1) != (B.son[i] & 1))
        {
            puts("IMPOSSIBLE");
            return 0;
        }
    }
    puts("POSSIBLE");
    A.work(A.root), B.work(B.root);
    for(int i = 1; i <= n; ++i)
        if(!(A.son[i] & 1))
            printf("%d ", (getfa(i), dis[i]) ? +1 : -1);
        else
            printf("%d ", 0);
    return 0;
}

Measured memory_bytes: 10112
MOD = 10**9+7

N,K = map(int,input().split())
A = list(map(int,input().split()))

if N == K:
    #全部かけて出力
    ans = 1
    for i in range(0,N,1):
        ans = (ans*A[i])%MOD
    print(ans)
    exit()

plus = []
minus = []
for i in range(0,N,1):
    if A[i] < 0:
        minus.append(-A[i])
    if A[i] > 0:
        plus.append(A[i])
    if A[i]==0:
        minus.append(0)
        plus.append(0)


if len(plus)==0 and K%2 == 1:
    minus.sort()
    ans = 1
    for i in range(0,K,1):
        ans = (ans*(-minus[i]))%MOD
    print(ans)
    exit()
        


#既に絶対値を格納
plus.sort(reverse=True)
minus.sort(reverse=True)

ans = 1
if K%2 ==1:#奇数
    ans = ans*plus[0]#一番でかいやつ
    plus.pop(0)

pairs = []
for i in range(1,len(plus),2):
    pairs.append(plus[i]*plus[i-1])
for i in range(1,len(minus),2):
    pairs.append(minus[i]*minus[i-1])
pairs.sort(reverse=True)
#でかいほうから K//2 こかける

for i in range(0,K//2,1):
    ans = (ans * pairs[i])%MOD

print(ans)




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

using namespace std;

struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) {
    }

    int root(int x) {
        if (par[x] < 0) return x;
        return par[x] = root(par[x]);
    }

    bool unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return false;
        if (par[rx] > par[ry]) swap(rx, ry);
        par[rx] += par[ry];
        par[ry] = rx;
        return true;
    }

    bool same (int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }

    int size (int x) {
        return -par[root(x)];
    }
};

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

    UnionFind uf(n);
    vector<set<int>> dame(n);

    int a, b;
    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        a--; b--;
        dame[a].insert(b);
        dame[b].insert(a);

        uf.unite(a, b);
    }

    int c, d;
    for (int i = 0; i < k; i++) {
        cin >> c >> d;
        c--; d--;
        if (!uf.same(c, d)) continue;
        dame[c].insert(d);
        dame[d].insert(c);
    }

    for (int i = 0; i < n; i++) {
        int mem = uf.size(i) - 1;
        mem -= dame[i].size();
        cout << mem << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 24704
import bisect
A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]

R = []
for x in X:
    SL, SR, TL, TR = 10**20, 10**20, 10**20, 10**20
    i = bisect.bisect_left(S, x)
    if i != 0:
        SL = x-S[i-1]
    if i != A:
        SR = S[i]-x

    j = bisect.bisect_left(T, x)
    if j != 0:
        TL = x-T[j-1]
    if j != B:
        TR = T[j]-x

    ans = min(max(SL, TL), min(2*SL+TR, SL+2*TR),
              min(2*TL+SR, TL+2*SR), max(SR, TR))
    R.append(ans)
print(*R, sep='\n')


Measured memory_bytes: 108504
//#pragma warning disable

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

public class Test
{
    public static void Main()
    {
        var line1 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var N = line1[0];
        var M = line1[1];

        var a = new long[M];
        var b = new long[M];

        for (var i = 0; i < M; i++)
        {
            var line2 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            a[i] = line2[0];
            b[i] = line2[1];
        }

        var ab = a.Concat(b).OrderBy(x => x).ToArray();

        var last = long.MinValue / 3;
        var count = 0;

        for (int i = 0; i < ab.Length; i++)
        {
            if (last == ab[i])
            {
                count++;
            }
            else
            {
                if (count % 2 != 0)
                {
                    Console.WriteLine("NO");
                    return;
                }

                last = ab[i];
                count = 1;
            }
        }

        if (count % 2 != 0)
        {
            Console.WriteLine("NO");
        }
        else
        {
            Console.WriteLine("YES");
        }
    }
}

Measured memory_bytes: 30648
#include <iostream>
using namespace std;
int64_t gcd(int64_t a, int64_t b){
    if(b==0) return a;
    else return gcd(b, a%b);
}
int main(){
    int x,y; cin >> x >> y;
    cout << gcd(x, y) << endl;
    return 0;
}



Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;
const int MOD = 1000000007;

int main(){
    std::ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n; cin >> n;
    std::vector<int> a(n); 
    
    int p = 0;

    rep(i,n){
        cin >> a[i];
        p ^= a[i];
    }

    rep(i,n){
        int ans = p^a[i];
        if(i == n-1){
            cout << ans << endl;
        } else {
            cout << ans << " ";
        }
    }


    return 0;
}

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

#define int            long long int
#define float          long double
#define setbits(x)     __builtin_popcountll(x)
#define zrobits(x)     __builtin_ctzll(x)
#define mod            1000000007
#define inf            1e18
#define set_pre(x,y)   fixed<<setprecision(y)<<x
#define w(t)           int t; cin>>t; while(t--)
using namespace std;
int power(int x, int y, int p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
int modi(int a, int m)
{
    return power(a, m - 2, m);
}
int32_t main(){
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
        cin>>v[i];
    int dp[n][n];
    int grid[n][n];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            dp[i][j]=inf;
            grid[i][j]=0;
        }
    }
    for(int i=0;i<n;i++)
    {
        grid[i][i]=v[i];
        dp[i][i]=0;

    }
    for(int j=1;j<n;j++)
    {
        int l=0;
        int r=j;
        for(;l<n && r<n;l++,r++)
        {
            for(int k=l;k<r;k++)
            {
                if(dp[l][r]>((grid[l][k]+grid[k+1][r])+dp[l][k]+dp[k+1][r]))
                {
                    dp[l][r]=((grid[l][k]+grid[k+1][r])+dp[l][k]+dp[k+1][r]);
                    grid[l][r]=((grid[l][k]+grid[k+1][r]));
                }
            }
        }
    }
    cout<<dp[0][n-1]<<endl;
}

Measured memory_bytes: 2816
from sys import stderr
from functools import reduce
from operator import add
from math import log2
def f(): return [int(i) for i in input().split()]
def debug(*x): stderr.write(reduce(add,repr(x)).strip("()\',")+'\n')

n = int(input())
a = f()
ans = 0

for i in a:
    if i == 2:
        ans += 1
        continue
    for j in range(int(log2(i)),0,-1):
        if i % 2**j == 0:
            ans += j
            break
        else:
            pass

print(ans)

Measured memory_bytes: 4708
import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    int x = s.nextInt();
    int y = s.nextInt();
    while (x != 0 || y != 0) {
      if (x < y)
        System.out.println(x + " " + y);
      else
        System.out.println(y + " " + x);
      x = s.nextInt();
      y = s.nextInt();
    }
  }
}




Measured memory_bytes: 36632
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int main(){
    int n,r_count=0,b_count=0;
    scanf("%d",&n);
    char s[n];
    scanf("%s",s);
    for (int i=0; i<n; i++) {
        if (s[i]=='R') {
            r_count++;
        }else{
            b_count++;
        }
    }
    if (r_count>b_count) {
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			int c1, c2, c3;
			c1 = c2 = c3 = 0;
			if (line.length() < 6) {
				System.out.println("INVALID");
			} else {
				for (char c : line.toCharArray()) {
					if (c >= '0' && c <= '9') {
						c1++;
					} else if (c >= 'A' && c <= 'Z') {
						c2++;
					} else {
						c3++;
					}
				}
				if (c1 > 0 && c2 > 0 && c3 > 0) {
					System.out.println("VALID");
				} else {
					System.out.println("INVALID");
				}
			}
		}
	}
}

Measured memory_bytes: 17060
import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    if (args.length > 0 && args(0) == "TEST") {
      println(test())
    } else {
      val input = io.Source.stdin.getLines().mkString("\n")
      println(solve(input).trim())
    }
  }

  def solve(input: String): String = {
    val s: Scanner = new Scanner(input)
    val sc = s.next.toCharArray
    for (i <- 0 to 2) {
      if (sc(i) == sc(i+1)) return "Bad"
    }
    "Good"
  }

  val tests = List(
    """3776""".stripMargin -> """Bad""",
    """8080""".stripMargin -> """Good""",
    """1333""".stripMargin -> """Bad""",
    """0024""" -> """Bad"""
  )

  def test(): String = tests.map { case (i, o) => (i.trim(), o.trim()) }
    .zipWithIndex.map {
    case ((input, outputExpect), i) =>
      val output = solve(input).trim()
      val tnum = i + 1
      s"test$tnum:" + (
        if (output == outputExpect) "Passed"
        else s"Failed\nexpect:\n$outputExpect\noutput:\n$output")
  }
    .mkString("\n")
}

Measured memory_bytes: 25544
n,m = map(int, input().split())

a = [0]*m
b = [0]*m
for i in range(m):
  l,r = map(int, input().split())
  a[i] = l
  b[i] = r

x = min(b)
y = max(a)
if x >= y:
  print(x-y+1)
else:
  print(0)

Measured memory_bytes: 11124
#include <stdio.h>
unsigned long long Fibonacci(unsigned long long m)
{
  static unsigned long long n1 = 0,n2 = 1;
  if(m == 0) return n1 + n2;
  n1 ^= n2;
  n2 ^= n1;
  n1 ^= n2;
  n1 += n2;
  return Fibonacci(m - 1);
}
int main()
{
  unsigned long long i;
  scanf("%llu",&i);
  printf("%llu\n",Fibonacci(i));
return 0;
}

Measured memory_bytes: 604
#include <stdio.h>
#include <stdlib.h>
 
int main(int argc, char *argv[])
{
  int n, i, j, k;
  int *A;
  int cnt, m, G[12], v;
 
  scanf("%d", &n);
 
  A = (int *)malloc(sizeof(int) * n);
 
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
 
  cnt = 0;
  m = 1;
  G[0] = 1;
  while (3 * G[m-1] + 1 < n) {
    G[m] = 3 * G[m-1] + 1;
    m++;
  }
 
  for (i = 0; i < m / 2; i++) {
    v = G[i];
    G[i] = G[m-1-i];
    G[m-1-i] = v;
  }
 
  printf("%d\n", m);
  for (i = 0; i < m; i++) {
    if (i != m - 1) printf("%d ", G[i]);
    else printf("%d\n", G[i]);
  }
 
  for (i = 0; i < m; i++) {
    for (j = G[i]; j < n; j++) {
      v = A[j];
      k = j - G[i];
      while (k >= 0 && A[k] > v) {
    A[k+G[i]] = A[k];
    k -= G[i];
    cnt++;
      }
      A[k+G[i]] = v;
    }
  }
 
  printf("%d\n", cnt);
  for (i = 0; i < n; i++) printf("%d\n", A[i]);
 
  return 0;
}

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

      int x = sc.nextInt();
      int y = sc.nextInt();

      int[] data1={1,3,5,7,8,10,12};
      int[] data2={4,6,9,11};

      int count1=0;
      int count2=0;


      for (int i = 0;i<data1.length ;i++ ) {
        if(x==data1[i]){
          count1++;
        }
        if(y==data1[i]){
          count1++;
        }
      }
      for (int i = 0;i<data2.length ;i++ ) {
        if(x==data2[i]){
          count2++;
        }
        if(y==data2[i]){
          count2++;
        }
      }
      if(count1==2||count2==2||(x==2&&y==2)){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }

}
}

Measured memory_bytes: 23124
import java.util.*;
public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main() {
		new AOJ0207();
	}
	
	class AOJ0207{
		int w,h;
		int sx,sy,gx,gy;
		int[][] map;
		
		void makeBoead(int bx,int by,int muki,int color){
			if(muki==0){//横
				for(int i=0;i<2;i++)for(int s=0;s<4;s++)map[by+i][bx+s]=color;
			}else if(muki==1){
				for(int i=0;i<4;i++)for(int s=0;s<2;s++)map[by+i][bx+s]=color;
			}
		}
		
		void print(){
			for(int i=1;i<=h;i++){
				for(int s=0;s<w;s++)System.out.print(map[i][s]);
				System.out.println();
			}
		}
		
		public AOJ0207() {
			while(true){
				w = in.nextInt();
				h = in.nextInt();
				if(w==0&&h==0)break;
				map = new int[h+1][w+1];
				sx = in.nextInt(); sy = in.nextInt();
				gx = in.nextInt(); gy = in.nextInt();
				int n = in.nextInt();
				for(int i=0;i<n;i++){
					int color = in.nextInt();
					int muki = in.nextInt();
					int bx = in.nextInt();
					int by = in.nextInt();
					makeBoead(bx, by, muki, color);
				}
//				print();
				LinkedList<Integer> list = new LinkedList<Integer>();
				list.add(sx);list.add(sy);
				boolean sw = false;//flg
				int[] gox = {1,0,-1,0};
				int[] goy = {0,1,0,-1};
				int target_c = map[sy][sx];
				while(list.size()>0){
					int x = list.remove();
					int y = list.remove();
					if(x==gx&&y==gy){
						sw=true;
						break;
					}
					for(int i=0;i<4;i++){
						int nx = x+gox[i];
						int ny = y+goy[i];
						if(nx<0||nx>w||ny<0||ny>h)continue;
						if(map[ny][nx]!=target_c)continue;
						map[ny][nx] = -1;
						list.add(nx);list.add(ny);
					}
				}
				System.out.println(sw? "OK":"NG");
			}
		}
	}
}

Measured memory_bytes: 24068
//{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_a.end()
#define pb push_back
#ifdef brian
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // brian
//}


const ll MAXn=1e3+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=ll(1e17);

vector<ii> v[MAXn];
ll dis[MAXn];
ll neg[MAXn];
int main()
{
    IOS();
    ll n,m;
    cin>>n>>m;
    REP(i,m)
    {
        ll a,b,c;
        cin>>a>>b>>c;
        v[a].pb(ii(b,-c));
    }
    REP1(i,n)dis[i] = INF;
    dis[1] = 0;
    REP(t,2 * n)
    {
        REP1(i,n)for(ii tmp:v[i])
        {
            if(dis[i] + tmp.Y < dis[tmp.X])
            {
                dis[tmp.X] = dis[i] + tmp.Y;
                if(t >= n)neg[tmp.X] = 1;
            
            }
            if(neg[i])neg[tmp.X] = 1;
        }
    }
    if(neg[n])cout<<"inf"<<endl;
    else cout<<-dis[n]<<endl;
}


Measured memory_bytes: 384
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        double r = scan.nextDouble();
        
        double result =  r * r * Math.PI;
        double result_2 = (r + r) * Math.PI;
        
        System.out.printf("%f %f", result, result_2);
        
    }
}


Measured memory_bytes: 28108
//created by Whiplash99
import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int i,N;

        String s[]=br.readLine().trim().split(" ");
        N=Integer.parseInt(s[0]);
        int M=Integer.parseInt(s[1]);

        s=br.readLine().trim().split(" ");
        int a[]=new int[N];
        for(i=0;i<N;i++)
            a[i]=Integer.parseInt(s[i]);

        int sum=0;
        for(i=0;i<N;i++) sum+=a[i];

        double req=(double)sum/(4*M);

        int count=0;
        for(i=0;i<N;i++)
        {
            if(a[i]>=req) count++;
        }

        System.out.println(count>=M?"Yes":"No");
    }
}

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

int main() {
    long long n;
    cin >>n;
    long long ans=1e13;
    for(long long i=1; i<=sqrt(n); ++i){
        if(n%i==0 && ans>(n/i)){
            ans=(n/i)+i-2;
        }
    }
    cout << ans <<endl;
}

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

bool ishisi(int a,int b, int c)
{
	if(a==b)
		return true;
	return false;
}

bool istyou(int a,int b, int c)
{
	if(a*a+b*b == c*c)
		return true;
	return false;
}

int main()
{
	int a,b,c;
	char dot;
	int hisicount=0;
	int tyoucount=0;
	while(cin >> a && cin >> dot && cin >> b && cin >> dot && cin >> c){
		if(ishisi(a,b,c))
			hisicount++;
		if(istyou(a,b,c))
			tyoucount++;
	}
	cout << tyoucount << endl;
	cout << hisicount << endl;
	return 0;
}

Measured memory_bytes: 0
//此程序使用了qt专属名称，请勿模仿。侵权必究！！！
//我真是太菜了…… 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1010,P=1<<30;
int n,m,a[N];
inline int read()
{
	int sum=0,flag=1;
	char c;
	for(;c<'0'||c>'9';c=getchar())if(c=='-') flag=-1;
	for(;c>='0'&&c<='9';c=getchar())sum=(sum<<1)+(sum<<3)+c-'0';
	return sum*flag;
}
int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();
	m=read();
	printf("%d\n",max(n-m*2,0));
	return 0;
}

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



int main(){
    ll N;
    cin >> N;
    vector<ll> a(N , 0);
    vector<ll> ans(N , 0);

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

    }

    ll def = a[0];
    
    for(int i = 1; i < N; i++) def = def ^ a[i];
    


    for(int i = 0; i < N; i++){
        cout << (def ^ a[i]) << " ";
    }

    cout << endl;

    

}


Measured memory_bytes: 6364
#include <bits/stdc++.h>
using namespace std;
int power(int num)
{
    int ans=1;
    for(int i=0;i<num;i++)ans*=10;
    return ans;
}
int main() {
    int n,m,a[3]={15,3,5};
    while(cin>>m>>n,n,m){
        string str,fb[3]={"FizzBuzz","Fizz","Buzz"};
        bool player[1000]={};
        for(int i=1,now=0,out=m;i<=n;i++,now=(now+1)%m){
			cin>>str;
			int num=0,co=-1;
			if(out>1){
				while(player[now])now=(now+1)%m;
				for(int j=0;j<3&&co<0;j++)if(i%a[j]<1)co=j;
				if(co<0)for(int j=0;j<str.size();j++)num+=(str[j]-'0')*power(str.size()-1-j);
				if(co>-1&&str!=fb[co]||co<0&&i!=num)player[now]=1;
				if(player[now])out--;
			}
		}
		for(int i=0,co=0;i<m;i++){
			if(co==0&&!player[i]){
				cout<<i+1;
				co++;
			}
			else if(!player[i])cout<<" "<<i+1;
		}
		cout<<endl;
	}
}

Measured memory_bytes: 1220
#include "bits/stdc++.h"
using namespace std;
 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    double d,t,s;
    cin >> d >> t >> s;

    if(d/s<=t)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



Measured memory_bytes: 3736
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;

int main() {

    int n;
    ll cnt = 0;
    cin >> n;
    string s;

    map<string, ll> mp;

    for (int i = 0; i < n; i++) {
        cin >> s;
        sort(ALL(s));
        mp[s] ++;
    }

    for(auto p:mp){
        cnt += p.second * (p.second-1) / 2;
    }

    cout << cnt << endl;

    return 0;

}

Measured memory_bytes: 11136
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;

class Main {
	public static void main(String[] a) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer[] mountains = new Integer[10];
		for (int i = 0; i < 10; i++) {
			mountains[i] = Integer.parseInt(br.readLine());
		}
		Arrays.sort(mountains, Collections.reverseOrder());
		for (int i = 0; i < 3; i++)
			System.out.println(mountains[i]);
	}
}

Measured memory_bytes: 24364
object Main extends App {
	val Array(n, m) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
	val sum = Array.ofDim[Long](n, 3)

	for(i<-0 until n){
		sum(i) = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	}

	var ans = 0L

	for(x <- 0x0 to 0x7){
		var a = new Array[Long](n)

		val a1 = if((0x4 & x)>>2 == 0x1) 1 else -1
		val a2 = if((0x2 & x)>>1 == 0x1) 1 else -1
		val a3 = if((0x1 & x)>>0 == 0x1) 1 else -1

		for(i<-0 until n){
			a(i) = a1*sum(i)(0) + a2*sum(i)(1) + a3*sum(i)(2)
		}

		a = a.sorted.drop(n-m)

		ans = math.max(ans, a.sum)
	}

	println(ans)

}

Measured memory_bytes: 30080
N = gets.chomp.to_i
l = gets.split.map(&:to_i).sort!
ans = 0
size = N - 1
size.times do |i|
  (i+1).step(size) do |j|
     upper = l[i] + l[j]
     ans += (l.bsearch_index {|x| x >= upper }&.-(1) || size) - (j + 1) + 1
  end
end

p ans


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

const long double PI = acos(-1);
constexpr long double EPS = 1e-15;
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;

//#define all(v) (v).begin(), (v).end()
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

void solve() {
  int n,m;
  cin >> n >> m;
  int l = 1, r = n;
  REP(i,m) {
    int left, right;
    cin >> left >> right;
    l = max(l, left);
    r = min(r, right);
  }
  if (l > r) cout << 0 << endl;
  else cout << r - l + 1 << endl;
}

int main(int argc, char *argv[]){
  int case_num = 1;
  if (argc > 1 && stoi(argv[1])) cin >> case_num;
  REP(case_no, case_num) {
    cerr << endl << "case " << case_no + 1 << endl;
    solve();
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <numeric>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)

using namespace std;


int main() {
	int K;
	cin >> K;
	vector<ll> ans;
	set<ll> prevs;

	for(int i = 1; i <= 9; i++) {
		ans.push_back(i);
		prevs.insert(i);
	}

	for (int i = 2; i <= 10; i++) {
		set<ll> curs;

		for (ll prev : prevs) {
			ll last = prev % 10;

			if (last == 0) {
				curs.insert(prev * 10 + 0);
				curs.insert(prev * 10 + 1);
			} else if (last == 9) {
				curs.insert(prev * 10 + 9);
				curs.insert(prev * 10 + 8);
			} else {
				curs.insert(prev * 10 + last - 1);
				curs.insert(prev * 10 + last + 1);
				curs.insert(prev * 10 + last);
			}
		}
		for(ll cur : curs) {
			ans.push_back(cur);
		}
		prevs = move(curs);
	}
	sort(ans.begin(), ans.end());
	cout << ans[K - 1] << endl;

	return 0;

}

Measured memory_bytes: 12140
#include <bits/stdc++.h>
using namespace std;
int main() {
    int r, c;
    cin >> r >> c;
    vector<vector<int>> v(r, vector<int>(c));
    for (auto& a: v) {
        int sum = 0;
        for (auto& b: a) {
            cin >> b;
            cout << b << " ";
            sum += b;
        }
        cout << sum << endl;
        a.push_back(sum);
    }
    for (int i = 0; i < c+1; i++) {
        int sum = 0;
        for (int j = 0; j < r; j++) {
            sum += v[j][i];
        }
        if (i) cout << " ";
        cout << sum;
    }
    cout << endl;
}


Measured memory_bytes: 3184
#include<stdio.h>
#include<stdlib.h>

int main(){

    int n,i,times=0,min_num,min2_num;
    double v[50],min,min2;

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%lf",v+i);
    }


for(;n>1;n--){
    for(i=0,min=v[0],min_num=0;i<n;i++){
        if(min>v[i]){
            min=v[i];
            min_num=i;
        }
    }
    if(min_num==0){
        min2_num=min_num+1;
    }else{
        min2_num=min_num-1;
    }
    min2=v[min2_num];
    for(i=0;i<n;i++){
        if(min2>v[i] && i!=min_num){
            min2=v[i];
            min2_num=i;
        }
    }

    v[min_num]=(v[min_num]+v[min2_num])/2;

    for(i=min2_num;i<n;i++){
        v[i]=v[i+1];
    }
    
}

    printf("%f\n",v[0]);
    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

#define MAX_LENGTH 32

int main(void)
{
        char line[MAX_LENGTH];
        int W,H,x,y,r;
        int result = 0;

        fgets(line, sizeof(line), stdin);
        sscanf(line, "%d %d %d %d %d", &W, &H, &x, &y, &r);

        if ( (x - r < 0) || (x + r > W ) ) {
                result = 0;
        } else if( (y - r < 0) || (y + r > H ) ) {
                result = 0;
        } else {
                result = 1;
        }

        if (result == 1)
                printf("Yes\n");
        else
                printf("No\n");

        return 0;
}

Measured memory_bytes: 592
# -*- coding: utf-8 -*-
from sys import stdin

class Dice:

    def __init__(self,dicelist):
        self.dice_list = dicelist

    def roll(self, direction):
        work = list(self.dice_list)
        if (direction == 'N'):
            self.dice_list[0] = work[1]
            self.dice_list[1] = work[5]
            self.dice_list[2] = work[2]
            self.dice_list[3] = work[3]
            self.dice_list[4] = work[0]
            self.dice_list[5] = work[4]
        elif (direction == 'E'):
            self.dice_list[0] = work[3]
            self.dice_list[1] = work[1]
            self.dice_list[2] = work[0]
            self.dice_list[3] = work[5]
            self.dice_list[4] = work[4]
            self.dice_list[5] = work[2]
        elif (direction == 'S'):
            self.dice_list[0] = work[4]
            self.dice_list[1] = work[0]
            self.dice_list[2] = work[2]
            self.dice_list[3] = work[3]
            self.dice_list[4] = work[5]
            self.dice_list[5] = work[1]
        elif (direction == 'W'):
            self.dice_list[0] = work[2]
            self.dice_list[1] = work[1]
            self.dice_list[2] = work[5]
            self.dice_list[3] = work[0]
            self.dice_list[4] = work[4]
            self.dice_list[5] = work[3]

    def getTop(self):
        return self.dice_list[0]

dice_list = list(map(int, stdin.readline().rstrip().split()))
dice = Dice(dice_list)

rolls = stdin.readline().rstrip()
for roll in rolls:
    dice.roll(roll)
else:
    print(dice.getTop())


Measured memory_bytes: 5620
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int A[210000];

int main(){
	
	int N;
	cin >> N;
	
	unordered_map<long long int, int> m;
	
	for(int i = 0; i < N; i++){
		cin >> A[i];
		m[A[i]] += 1;
	}
	
	sort(A, A + N);
	int ans = 0;
	
	for(int i = N - 1; i >= 0; i--){
		long long int num1 = A[i];
		long long int num2, hoge = 1;
		for(int j = 0; j <= 40; j++){
			if(hoge > num1){
				num2 = hoge - num1;
				break;
			}
			hoge *= 2;
		}
		if(num1 == num2){
			if(m[num1] >= 2){
				ans += 1;
				m[num1] -= 2;
			}
		}else if(m.find(num2) != m.end() && m[num1] > 0 && m[num2] > 0){
			ans += 1;
			m[num1] -= 1;
			m[num2] -= 1;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 10056
from collections import deque

k=int(input())
d=deque()
for i in range(1,10):
    d.append(i)

for i in range(1,k):
    v=d.popleft()
    s=v%10
    if s>0:
        d.append(10*v+s-1)
    d.append(10*v+s)
    if s<9:
        d.append(10*v+s+1)
    
print(d[0])

Measured memory_bytes: 18688
sx,sy,tx,ty = map(int,input().split())
answer = []
dx = tx-sx
dy = ty-sy
answer.append('R'*dx)
answer.append('U'*dy)
answer.append('L'*dx)
answer.append('D'*dy)
answer.append('D')
answer.append('R'*(dx+1))
answer.append('U'*(dy+1))
answer.append('L')
answer.append('U')
answer.append('L'*(dx+1))
answer.append('D'*(dy+1))
answer.append('R')
print("".join(answer))

Measured memory_bytes: 3064
//It’s never too late to become what you might have been....
 #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define inf 1000000000000
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define S second
#define F first
#define boost1 ios::sync_with_stdio(false);
#define boost2 cin.tie(0);
#define mem(a,val) memset(a,val,sizeof a)
#define endl "\n"
#define maxn 100001
set<ll>s;
int main()
{
	boost1;boost2;	
	ll i,j,n,x;
	for(i=1;i<=3;i++)
	{
		cin>>x;
		s.insert(x);
	}
	cout<<s.size();
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(n%2==1)n-=1;
		int max = 0,a, count,ans=1;
		for(int i = 2;i <= n;i+=2) {
			count = 0;
			a = i;
			for(;;) {
				if(a / 2 != 0) {
					a = a/2;
					count++;
				}
				else {
					count++;
					break;
				}
			}
			if(max < count) {
				max = count;
				ans = i;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 23764
n, m = map(int, input().split())
g = [[] for _ in range(n+1)]
for _ in range(m):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)
d = {1:0}
q = [1]
for i in q:
    for j in g[i]:
        if j not in d:
            d[j] = i
            q.append(j)
print('Yes')
for i in range(2, n+1):
    print(d[i])

Measured memory_bytes: 40868
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int>P;
const int len=2e5+10;
const LL mod=998244353;
const int inf=0x3f3f3f3f;
string str[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
int main()
{
   string s;
   cin>>s;
   for(int i=0;i<7;++i)
   {
        if(str[i]==s)
        {
            cout<<7-i<<endl;
            break;
        }
   }

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long N;
	cin >> N;
	vector<long long>A(N);
	for (long long i = 0; i < N; i++)
	{
		cin >> A.at(i);
	}
	sort(A.begin(), A.end());
	for (long long i = 1; i < N; i++) {
		if (A.at(i - 1) == A.at(i)) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
}

Measured memory_bytes: 1792
import sys
input = sys.stdin.readline


def main():
    K, N = map(int, input().split())
    A = list(map(int, input().split()))
    diff = [A[i+1] - A[i] for i in range(N-1)]
    diff.append(A[0]+K-A[N-1])
    print(sum(diff)-max(diff))


if __name__ == '__main__':
    main()


Measured memory_bytes: 25880
n=[0]*10000
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      ans=(x**2+y**2+z**2+x*y+y*z+x*z)
      if ans<=10000:
        n[ans-1]+=1
for i in range(int(input())):
  print(n[i])

Measured memory_bytes: 69124
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).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; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
	ll a, b, c;
	cin >> a >> b >> c;
    if (c-a-b>0 && (c-a-b)*(c-a-b) > 4*a*b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
	return 0;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#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 <queue>
#include <random>
#include <complex>
#include <regex>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

struct edge {
    int to;
    double cost;
};

int main() {

    while (true) {

        int N, M, P, A, B;
        cin >> N >> M >> P >> A >> B;

        if (!(N | M | P | A | B)) break;
        A--, B--;

        vector<double> t(N);
        for (int i = 0; i < N; i++) cin >> t[i];

        vector<vector<edge>> G(M, vector<edge>());

        for (int i = 0; i < P; i++) {
            int x, y;
            double z;
            cin >> x >> y >> z;
            x--, y--;
            G[x].push_back({y, z});
            G[y].push_back({x, z});
        }

        vector<vector<double>> dp(M, vector<double>((1 << N), LONG_LONG_MAX));
        dp[A][0] = 0;
        //cost state vertex
        priority_queue<tuple<double, int, int>, vector<tuple<double, int, int>>, greater<tuple<double, int, int>>> Q;
        Q.push(make_tuple(0, 0, A));
        while (!Q.empty()) {
            auto tup = Q.top();
            Q.pop();
            double cost = get<0>(tup);
            int state = get<1>(tup);
            int v = get<2>(tup);
            if (dp[v][state] < cost) continue;

            for (int i = 0; i < G[v].size(); i++) {
                int to = G[v][i].to;
                double e_cost = G[v][i].cost;
                for (int j = 0; j < N; j++) {
                    if (state & (1 << j)) continue;
                    int to_state = state | (1 << j);
                    double to_cost = cost + e_cost / t[j];
                    if (dp[to][to_state] > to_cost) {
                        dp[to][to_state] = to_cost;
                        Q.push(make_tuple(to_cost, to_state, to));
                    }
                }
            }
        }

        double minCost = LONG_LONG_MAX;
        for (int i = 0; i < (1 << N); i++)minCost = min(minCost, dp[B][i]);
        if (minCost >= LONG_LONG_MAX - 1) cout << "Impossible" << endl;
        else  cout << fixed << setprecision(3) << minCost << endl;

    }

    return 0;
}






























































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

ll rec(vector<vector<ll>> &dp, vector<vector<ll>> &arr, ll &p, ll &n, ll &k, ll pickup, ll stno)
{
	if (pickup >= p)
		return 0;
	if (stno >= n)
		return 0;

	ll sumv = 0;

	if (dp[stno][pickup] != -1)
		return dp[stno][pickup];
	ll max_pro = rec(dp, arr, p, n, k, pickup, stno + 1);

	for (int i = 0; i < min(k, p - pickup); i++)
	{
		// cout<<stno<<" "<<i<<endl;
		sumv += arr[stno][i];
		max_pro = max(rec(dp, arr, p, n, k, pickup + i + 1, stno + 1) + sumv, max_pro);
	}

	dp[stno][pickup] = max_pro;
	// cout<<pickup<<" "<<stno<<" "<<max_pro<<endl;
	return max_pro;
}


bool ispalind(string s)
{	
	string t = s;
	reverse(s.begin(),s.end());
	return s == t;
}
int main()
{
	string s;
	cin>>s;
	if(ispalind(s) && ispalind(s.substr(0,(s.size()-1)/2)) && ispalind(s.substr((s.size()-1)/2 +1,(s.size()-1)/2) ) )
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}
	

}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>



void swap (int *x, int *y) {
  int temp;

  temp = *x;
  *x = *y;
  *y = temp;

  return;
}


int gcd(int a, int b){
  int c;

  while (b > 0){
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

long int modpow(long int a,long int n,long int mod){
  long int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

long int modinv(long int a,long int mod){
  return modpow(a,mod-2,mod);
}

int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}

int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}

void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }

  return;
}

void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }

  return;
}

int main(void){
  int L[30];
  for(int i=0;i<30;i++){
    L[i]=0;
  }
  char s[30];
  scanf("%s",s);
  int l=strlen(s);
  for(int i=0;i<l;i++){
    int len=s[i]-'a';
    L[len]++;
  }
  for(int i=0;i<l;i++){
    if(L[i]>1){
      printf("no\n");
      return 0;
    }
  }
  printf("yes\n");
  return 0;
}

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

int main(){
  int d;
  int c[27];
  int s[400][27];
  int t[400];
  static int last[27];//最後の開催日

  cin >> d;
  rep(i, 26)cin >> c[i+1];
  rep(i, d){
    rep(j, 26){
      cin >> s[i+1][j+1];
    }
  }

  for(int i=1;i<=d;i++){
    int mx = -INF;
    int mxi;
    for(int j=1;j<=26;j++){
      int tmp=0;
      tmp += s[i][j];
      for(int k=1;k<=26;k++){
        if(j!=k)tmp-=(i-last[k])*c[k];
      }
      if(tmp>mx){
        mx = tmp;
        mxi = j; 
      }
    }
    t[i]=mxi;
    last[t[i]]=i;
  }

  //
  int target = 0;
  rep(i, 26)last[i+1]=0;
  for(int i=1;i<=d;i++){
    target += s[i][t[i]];
    last[t[i]]=i;
    for(int j=1;j<=26;j++)target-=(i-last[j])*c[j];
  }

  pair<int, int> pr[26];
  rep(i, 26){
    pr[i] = pair<int, int>(c[i+1], i+1);
  }
  sort(pr, pr+26);
  
  //ここから焼きなまし法
  rep(l, 600){
    int aft = pr[l/5].second;
    for(int k=1;k<=d;k++){
      //k日目をaftに変更する
      int tmp = 0;
      rep(i, 26)last[i+1]=0;
      for(int i=1;i<=d;i++){
        if(i==k){
          tmp += s[i][aft];
          last[aft]=i;
          for(int j=1;j<=26;j++)tmp-=(i-last[j])*c[j];
          continue;
        }
        tmp += s[i][t[i]];
        last[t[i]]=i;
        for(int j=1;j<=26;j++)tmp-=(i-last[j])*c[j];
      }
      // cout << target << ":" << tmp << endl;
      if(tmp>target){
        t[k]=aft;
        target = tmp;
      }
    }
  }
  
  rep(i, d)cout << t[i+1] << endl;
  return 0;
}


Measured memory_bytes: 3680