criyle/codenet-compile-errors huggingface dataset:
Language: C++

/* 解答時間→ 101:22(途中) */
#include <math.h>
#include <iomanip>
#include <iostream>		//基本入出力
using namespace std;

double dist2d(double x1, double y1, double x2, double y2){
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int main(){
	cout << setprecision(16);
	while(1){
		//入力
		int n;
		cin >> n;
		if(n == 0)
			break;
		double x[25],y[25],r[25];
		for(int i = 0; i < n; i++){
			cin >> x[i] >> y[i] >> r[i];
		}
		int V = n * 2;
		double pos_x[50], pos_y[50];
		pos_x[0] = x[0];
		pos_y[0] = y[0];
		pos_x[V - 1] = x[n - 1];
		pos_y[V - 1] = y[n - 1];
		for(int i = 0; i < n - 1; i++){
			double d = sqrt(1.0 * (x[i] - x[i + 1]) * (x[i] - x[i + 1]) + (y[i] - y[i + 1]) * (y[i] - y[i + 1]));
			double a = (d * d + r[i] * r[i] - r[i + 1] * r[i + 1]) / (d * 2);
			double b = sqrt(-a * a + r[i] * r[i]);
			double va_x = a * (x[i + 1] - x[i]) / d, va_y = a * (y[i + 1] - y[i]) / d;
			double vb_x = b * (y[i] - y[i + 1]) / d, vb_y = b * (x[i + 1] - x[i]) / d;
			pos_x[i * 2 + 1] = va_x + vb_x + x[i];
			pos_y[i * 2 + 1] = va_y + vb_y + y[i];
			pos_x[i * 2 + 2] = va_x - vb_x + x[i];
			pos_y[i * 2 + 2] = va_y - vb_y + y[i];
		}
		//総当りで距離を計算
		double dist[50][50];
		for(int i = 0; i < V; i++){
			for(int j = 0; j < V; j++){
				dist[i][j] = DBL_MAX;
			}
		}
		for(int i = 0; i < V - 1; i++){
			for(int j = i + 1; j < V; j++){
				//交差判定(準備)
				int flg = 1;
				double x1, y1, x2, y2, x3, y3, x4, y4;
				x1 = pos_x[i];
				y1 = pos_y[i];
				x2 = pos_x[j];
				y2 = pos_y[j];
				int pos_ls, pos_lg;
				if(i == 0)
					pos_ls = 1;
				else
					pos_ls = (i + 1) / 2 + 1;
				if(j == V - 1)
					pos_lg = n - 1;
				else
					pos_lg = (j + 1) / 2 - 1;
				//交差判定(本番)
				double ta, tb, tc, td;
				for(int k = pos_ls; k <= pos_lg; k++){
					x3 = pos_x[k * 2 - 1];
					y3 = pos_y[k * 2 - 1];
					x4 = pos_x[k * 2];
					y4 = pos_y[k * 2];
					ta = (x3-x4)*(y1-y3)+(y3-y4)*(x3-x1);
					tb = (x3-x4)*(y2-y3)+(y3-y4)*(x3-x2);
					tc = (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3);
					td = (x1-x2)*(y4-y1)+(y1-y2)*(x1-x4);
					if((tc*td>=0.0)||(ta*tb>=0.0)){
						flg=0;
						break;
					}
				}
				if(flg == 1){
					dist[i][j] = dist2d(pos_x[i], pos_y[i], pos_x[j], pos_y[j]);
					dist[j][i] = dist[i][j];
				}
			}
		}
		//ワーシャル・フロイド法
		for(int i = 0; i < V; i++){
			for(int j = 0; j < V; j++){
				for(int k = 0; k < V; k++){
					if(dist[i][j] > dist[i][k] + dist[k][j])
						dist[i][j] = dist[i][k] + dist[k][j];
				}
			}
		}
		//出力
		cout << dist[0][V - 1] << "\n";
	}
	cout << flush;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:46: error: 'DBL_MAX' was not declared in this scope
   44 |                                 dist[i][j] = DBL_MAX;
      |                                              ^~~~~~~
a.cc:5:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    4 | #include <iostream>             //基本入出力
  +++ |+#include <cfloat>
    5 | using namespace std;
Language: C++

/* 解答時間→ 101:22(途中) */
#include <math.h>
#include <iomanip>
#include <iostream>		//基本入出力
using namespace std;

double dist2d(double x1, double y1, double x2, double y2){
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

int main(){
	double dist[50][50];
	cout << setprecision(16);
	while(1){
		//入力
		int n;
		cin >> n;
		if(n == 0)
			break;
		double x[25],y[25],r[25];
		for(int i = 0; i < n; i++){
			cin >> x[i] >> y[i] >> r[i];
		}
		int V = n * 2;
		double pos_x[50], pos_y[50];
		pos_x[0] = x[0];
		pos_y[0] = y[0];
		pos_x[V - 1] = x[n - 1];
		pos_y[V - 1] = y[n - 1];
		for(int i = 0; i < n - 1; i++){
			double d = sqrt(1.0 * (x[i] - x[i + 1]) * (x[i] - x[i + 1]) + (y[i] - y[i + 1]) * (y[i] - y[i + 1]));
			double a = (d * d + r[i] * r[i] - r[i + 1] * r[i + 1]) / (d * 2);
			double b = sqrt(-a * a + r[i] * r[i]);
			double va_x = a * (x[i + 1] - x[i]) / d, va_y = a * (y[i + 1] - y[i]) / d;
			double vb_x = b * (y[i] - y[i + 1]) / d, vb_y = b * (x[i + 1] - x[i]) / d;
			pos_x[i * 2 + 1] = va_x + vb_x + x[i];
			pos_y[i * 2 + 1] = va_y + vb_y + y[i];
			pos_x[i * 2 + 2] = va_x - vb_x + x[i];
			pos_y[i * 2 + 2] = va_y - vb_y + y[i];
		}
		//総当りで距離を計算
		for(int i = 0; i < V; i++){
			for(int j = 0; j < V; j++){
				dist[i][j] = DBL_MAX;
			}
		}
		for(int i = 0; i < V - 1; i++){
			for(int j = i + 1; j < V; j++){
				//交差判定(準備)
				int flg = 1;
				double x1, y1, x2, y2, x3, y3, x4, y4;
				x1 = pos_x[i];
				y1 = pos_y[i];
				x2 = pos_x[j];
				y2 = pos_y[j];
				int pos_ls, pos_lg;
				if(i == 0)
					pos_ls = 1;
				else
					pos_ls = (i + 1) / 2 + 1;
				if(j == V - 1)
					pos_lg = n - 1;
				else
					pos_lg = (j + 1) / 2 - 1;
				//交差判定(本番)
				double ta, tb, tc, td;
				for(int k = pos_ls; k <= pos_lg; k++){
					x3 = pos_x[k * 2 - 1];
					y3 = pos_y[k * 2 - 1];
					x4 = pos_x[k * 2];
					y4 = pos_y[k * 2];
					ta = (x3-x4)*(y1-y3)+(y3-y4)*(x3-x1);
					tb = (x3-x4)*(y2-y3)+(y3-y4)*(x3-x2);
					tc = (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3);
					td = (x1-x2)*(y4-y1)+(y1-y2)*(x1-x4);
					if((tc*td>=0.0)||(ta*tb>=0.0)){
						flg=0;
						break;
					}
				}
				if(flg == 1){
					dist[i][j] = dist2d(pos_x[i], pos_y[i], pos_x[j], pos_y[j]);
					dist[j][i] = dist[i][j];
				}
			}
		}
		//ワーシャル・フロイド法
		for(int i = 0; i < V; i++){
			for(int j = 0; j < V; j++){
				for(int k = 0; k < V; k++){
					if(dist[i][j] > dist[i][k] + dist[k][j])
						dist[i][j] = dist[i][k] + dist[k][j];
				}
			}
		}
		//出力
		cout << dist[0][V - 1] << "\n";
	}
	cout << flush;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:46: error: 'DBL_MAX' was not declared in this scope
   44 |                                 dist[i][j] = DBL_MAX;
      |                                              ^~~~~~~
a.cc:5:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    4 | #include <iostream>             //基本入出力
  +++ |+#include <cfloat>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#pragma comment(linker, "/STACK:400000000")

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(it=X.begin();it!=X.end();it++)
#define iss istringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sst stringstream
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int N,M,L,a[8],b[8],c[8],x[8];
ll ans;

ll nCk(int n,int k){
	if(n<k)return 0;
	ll res=1;
	rep2(i,n-k+1,n+1)res*=i;
	rep2(i,1,k+1)res/=i;
	return res;
}

void f(int cur,int blank){
	if(x[cur-1]>M)return;
	if(cur==L){
		int count[21]={};
		rep(i,cur)count[x[i]]++;
		rep(i,cur)rep(j,cur)rep(k,cur){
			int needed[21]={};
			rep(l,7){
				needed[x[i]+l]+=a[l];
				needed[x[j]+l]+=b[l];
				needed[x[k]+l]+=c[l];
			}
			rep(l,21)if(needed[l]>count[l])goto fail;
			ll res=1;
			rep(l,14)res*=nCk(N,count[l]);
			ans+=res*nCk(M-x[cur-1]+blank,blank);
			return;
			fail:;
		}
		return;
	}
	x[cur]=x[cur-1];
	f(cur+1,blank);
	x[cur]=x[cur-1]+1;
	f(cur+1,blank);
	x[cur]=x[cur-1]+2;
	f(cur+1,blank+1);
}

int main(){
	while(cin>>N>>M>>L && N){
		rep(i,7)a[i]=b[i]=c[i]=0;
		string h;
		rep(i,L){
			cin>>h;
			if(h[0]=='a')a[h.sz-1]++;
			if(h[0]=='b')b[h.sz-1]++;
			if(h[0]=='c')c[h.sz-1]++;
		}
		ans=0;
		x[0]=1;
		f(1,1);
		cout<<setprecision(11)<<1.*ans/nCk(N*M,L)<<endl;
	}
}

Compiler output:
a.cc: In function 'void f(int, int)':
a.cc:77:25: error: jump to label 'fail'
   77 |                         fail:;
      |                         ^~~~
a.cc:72:61: note:   from here
   72 |                         rep(l,21)if(needed[l]>count[l])goto fail;
      |                                                             ^~~~
a.cc:73:28: note:   crosses initialization of 'long long int res'
   73 |                         ll res=1;
      |                            ^~~
Language: Java

package learning;
import java.util.Scanner;

public class MainClass {
	
	public static int cal(int w, int h){
		return w*w + h*h;
	}
	
	public static void print(int w, int h) {
		int d = cal(w,h);
		int optW = w+1;
		int optH = h;
		int optD = cal(optW, optH);
		for(int j = (int)((Math.sqrt(2*d+1)+1)/2) ; j < (int)Math.sqrt(optD-1) + 1 ; j++){
			int i = (int)Math.sqrt(d-j*j)+1;
			if(i >= j){
				continue;
			}
			if(cal(j,i-1) == d && i-1 > h){
				if(optD != d || (optD ==d && optH > i -1)){
					optH = i-1;
					optW = j;
					optD = d;
					continue;
				}
				
			}
			int k = cal(i,j);
			if( k < optD){
				optW = j;
				optH = i;
				optD = k;
			} else if( k == optD){
				if(optH > i){
					optH = i;
					optW = j;
					optD = k;
				}
			}
		}
		
		System.out.println(optH + "," + optW);
		
		
	}
	
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int[][] data = new int[100][2];
		int length = 0;
		while(true){
			data[length][0] = in.nextInt();
			data[length][1] = in.nextInt();
			if(data[length][0] + data[length][1] > 0) length++;
			else break;
		}
		for(int j = 0 ; j < length ; j++){
			print(data[j][1],data[j][0]);
		}
	}

}

Compiler output:
Main.java:4: error: class MainClass is public, should be declared in a file named MainClass.java
public class MainClass {
       ^
1 error
Language: Java

public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while (true) {
			String str1 = br.readLine();
			String str2 = br.readLine();
			int h = Integer.parseInt(str1);
			int w = Integer.parseInt(str2);

			if(h==0&&w==0) {
				System.exit(0);
			}

			int base = 0;
			base = h * h + w * w;//デフォの二乗

			int newnew = 0;

			int newI = 150;
			int newJ = 150;

			for (int i = 1; i < 150; i++) {
				for (int j = 1; j < 150; j++) {

					if(i>j) {
						continue;
					}

					if(i==j) {
						continue;
					}
					newnew = (i*i)+(j*j);
					if (newnew > base) {
						if (((newI * newI)+(newJ*newJ) )>newnew) {
							newI = i;
							newJ = j;
						}
					}
				}
			}
			System.out.println(newI + " " + newJ);

		}

	}
}



Compiler output:
Main.java:2: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int num1 = scan.nextInt();
        int num2 = scan.nextInt();
        System.out.println("最初のトークンは: "+ num1 + num2);
        
        int sum1 = num1*num1;
        int sum2 = num2*num2;
        
        double ans1 = Math.sqrt(sum1 + sum2);
        
        int a = this.checkA(num1);
        
        int b = this.checkB(num2);
        
        if (a * a + sum2 > b * b + sum1) {
            
        }
        
        if (a * a + sum2 < b * b + sum1) {
            
        }
        
        if (a * a + sum2 == b * b + sum1) {
            if (a > num1) {
                
            }
            
            if (a < num1) {
                
            }
            
            if (a == num1) {
                
            }
        }

    }
    
    public int checkA(int num1) {
        int a = 0;
        for (int i = 0; i > num1; i++) {
            a = num1 + 1;
            
            if (i == 150) {
                break;
            }
        }
        
        return a;
        
    }
    
    public int checkB(int num2) {
        int b = 0;
        for (int j = 0; j > num2; j++) {
            
            if (i == 150) {
                break;
            }
            
        }
        
        return b;
    }
    
}



Compiler output:
Main.java:18: error: non-static variable this cannot be referenced from a static context
        int a = this.checkA(num1);
                ^
Main.java:20: error: non-static variable this cannot be referenced from a static context
        int b = this.checkB(num2);
                ^
Main.java:64: error: cannot find symbol
            if (i == 150) {
                ^
  symbol:   variable i
  location: class Main
3 errors
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class sample {
    public static void main(String args[]){
        List<Integer> X = new ArrayList<Integer>();
        List<Integer> Y = new ArrayList<Integer>();
        int count = 0;
        int x;
        int y;
        int max;
        int opp;
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            if(n!=0) {
                if (count % 2 == 0) {
                    X.add(n);
                } else {
                    Y.add(n);
                }
                count++;
            } else {
                break;
            }
        }
        ArrayList<Integer> list = new ArrayList<>();
        ArrayList<Integer> H = new ArrayList<>();
        ArrayList<Integer> W = new ArrayList<>();
        for(int i=0;i<X.size();i++){
            x = X.get(i);
            y = Y.get(i);
            max = (int) Math.floor(Math.sqrt(x*x+y*y));

            for (int j=1; j<=max/2; j++){
                opp = (int) Math.ceil(Math.sqrt(x*x+y*y-j*j+1));
                list.add(j*j+opp*opp);
                System.out.println(j);
                System.out.println(opp);

            }
            System.out.println(list);
            int h = list.indexOf(Collections.min(list))+1;
            int w = (int) Math.ceil(Math.sqrt(x*x+y*y-h*h+1));
            H.add(h);
            W.add(w);
        }
        for(int i=0;i<H.size();i++) {
            System.out.println(H.get(i)+" "+W.get(i));
        }
    }
}


Compiler output:
Main.java:6: error: class sample is public, should be declared in a file named sample.java
public class sample {
       ^
1 error
Language: Java

import com.sun.tools.javac.util.List;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine().trim()) != null && !"0 0".equals(line)) {
            String[] hoge = line.split(" ");
            int seiseki[][] = new int[151][151];
            for(int i = 1 ; i < 150; i++) {
                for(int j = 2 ; j <= 150; j++) {
                    seiseki[i][j] = i*i + j*j;
                }
            }
            int a = Integer.parseInt(hoge[0]);
            int b = Integer.parseInt(hoge[1]);
            int calc = a*a + b*b;

            boolean flg = false;
            for(int i = 1 ; i < 150; i++) {
                for(int j = 2 ; j <= 150; j++) {
                    if(( calc + 1 == seiseki[i][j]
                            || calc + 2 == seiseki[i][j]
                            || calc + 3 == seiseki[i][j]
                            || calc + 4 == seiseki[i][j]
                            || calc + 5 == seiseki[i][j]) && !flg) {
                        System.out.println(i + " " + j);
                        flg = true;
                    }
                }
            }
        }
    }
}


Compiler output:
Main.java:1: error: package com.sun.tools.javac.util is not visible
import com.sun.tools.javac.util.List;
                          ^
  (package com.sun.tools.javac.util is declared in module jdk.compiler, which does not export it to the unnamed module)
1 error
Language: Java

import java.util.*;

public class A {
    static class Rect implements Comparable<Rect> {
        int h;
        int w;
        int d2;

        public Rect(int h, int w) {
            this.h = h;
            this.w = w;
            this.d2 = h * h + w * w;
        }

        @Override
        public int compareTo(Rect other) {
            if (d2 != other.d2) {
                return Integer.compare(d2, other.d2);
            }
            return Integer.compare(h, other.h);
        }

        @Override
        public boolean equals(Object other) {
            return compareTo((Rect) other) == 0;
        }
    }

    public static void main(String[] args) {
        List<Rect> candidates = new ArrayList<>();
        for (int h = 1; h <= 150; h++) {
            for (int w = h + 1; w <= 150; w++) {
                candidates.add(new Rect(h, w));
            }
        }
        Collections.sort(candidates);

        Scanner sc = new Scanner(System.in);
        while (true) {
            int h = sc.nextInt();
            int w = sc.nextInt();
            if (h == 0 && w == 0) {
                break;
            }
            Rect rect = new Rect(h, w);
            Rect ansRect = candidates.get(candidates.indexOf(rect) + 1);
            System.out.println(ansRect.h + " " + ansRect.w);
        }
        sc.close();
    }
}

Compiler output:
Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

import java.util.*;

public class A {
    static class Rect implements Comparable<Rect> {
        int h;
        int w;
        int d2;

        public Rect(int h, int w) {
            this.h = h;
            this.w = w;
            this.d2 = h * h + w * w;
        }

        @Override
        public int compareTo(Rect other) {
            if (d2 != other.d2) {
                return Integer.compare(d2, other.d2);
            }
            return Integer.compare(h, other.h);
        }

        @Override
        public boolean equals(Object other) {
            return compareTo((Rect) other) == 0;
        }
    }

    public static void main(String[] args) {
        List<Rect> candidates = new ArrayList<Rect>();
        for (int h = 1; h <= 150; h++) {
            for (int w = h + 1; w <= 150; w++) {
                candidates.add(new Rect(h, w));
            }
        }
        Collections.sort(candidates);

        Scanner sc = new Scanner(System.in);
        while (true) {
            int h = sc.nextInt();
            int w = sc.nextInt();
            if (h == 0 && w == 0) {
                break;
            }
            Rect rect = new Rect(h, w);
            Rect ansRect = candidates.get(candidates.indexOf(rect) + 1);
            System.out.println(ansRect.h + " " + ansRect.w);
        }
        sc.close();
    }
}

Compiler output:
Main.java:3: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class IntegralRectangles {
	FastScanner in = new FastScanner(System.in);
	PrintWriter out = new PrintWriter(System.out);

	public void run() {
		while (true) {
			int h = in.nextInt(), w = in.nextInt();
			if ((h|w) == 0) break;
			
			int resH = 1000, resW = 1000;
			loop : for (int i = h+1; i <= 150; i++) {
				for (int j = i + 1; j <= 150; j++) {
					if (h*h + w*w == i*i + j*j) {
						resH = i;
						resW = j;
						break loop;
					}
				}
			}
			
			if (resH == 1000 && resW == 1000) {
				for (int i = 1; i <= 150; i++) {
					for (int j = i + 1; j <= 150; j++) {
						if (h*h + w*w < i*i + j*j && i*i + j*j < resH * resH + resW * resW) {
							resH = i;
							resW = j;
						}
					}
				}
			}
			
			System.out.println(resH + " " + resW);
		}
	}

	public static void main(String[] args) {
		new IntegralRectangles().run();
	}

	public void debug(Object... obj) {
		System.out.println(Arrays.deepToString(obj));
	}

	class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
			//stream = new FileInputStream(new File("dec.in"));

		}

		int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}

Compiler output:
Main.java:4: error: class IntegralRectangles is public, should be declared in a file named IntegralRectangles.java
public class IntegralRectangles {
       ^
1 error
Language: C

m,M,X,Y,x,y,i,j;
main() while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--)for(j=i+1,t=i*i+j*j;j<=150;j++)if(m==t&&x<i)M=t,X=i,Y=j;else if(m<t&&M>=t)M=t,X=i,Y=j;
printf("%d %d\n",X,Y);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | m,M,X,Y,x,y,i,j;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'X' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'Y' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |       ^
main.c:1:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |         ^
main.c:1:11: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |           ^
main.c:1:13: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |             ^
main.c:1:15: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |               ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main() while(scanf("%d%d",&x,&y),x||y){
      | ^~~~
main.c: In function 'main':
main.c:2:8: error: expected declaration specifiers before 'while'
    2 | main() while(scanf("%d%d",&x,&y),x||y){
      |        ^~~~~
main.c:7: error: expected '{' at end of input
Language: C

m,M,X,Y,x,y,i,j;
main() while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
printf("%d %d\n",X,Y);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | m,M,X,Y,x,y,i,j;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'X' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'Y' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |       ^
main.c:1:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |         ^
main.c:1:11: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |           ^
main.c:1:13: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |             ^
main.c:1:15: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | m,M,X,Y,x,y,i,j;
      |               ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main() while(scanf("%d%d",&x,&y),x||y){
      | ^~~~
main.c: In function 'main':
main.c:2:8: error: expected declaration specifiers before 'while'
    2 | main() while(scanf("%d%d",&x,&y),x||y){
      |        ^~~~~
main.c:7: error: expected '{' at end of input
Language: C

#include <stdio.h>
 
int main(void){
 
int h, w, l;
int hs, ws;
 
while(1){
 
scanf("%d %d", &h, &w);
 
if(h==0 && w==0)
break;
 
l=h*h+w*w;
hs=h;
ws=w;
 
 
while(1){
 
for(h=1; h<=150; h++){
for(w=h+1; w<=150; w++){
 
if(h*h+w*w==l && (h!=hs || w!=ws)){
printf("%d %d", h, w);
break;
}

if(h*h+w*w>l)
coutinue;
 
 }
}
 
l++;
 
}
 
 
}
 
return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:31:1: error: 'coutinue' undeclared (first use in this function)
   31 | coutinue;
      | ^~~~~~~~
main.c:31:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {
    int h, w;

    while (scanf("%d%d", &h, &w), h != 0) {
        int x = h * h + w * w;
        int bigh = h + 1;
        int bigw = w + 1;
        int h2, w2, newx;
        for (h2 = 1; h2 < 150; h2++) {
            for (w2 = h2 + 1; w2 < 150; w2++) {
                newx = bigh * bigh + bigw * bigw;
                if ((h2 * h2 + w2 * w2 > x &&
                     h2 * h2 + w2 * w2 < bigh * bigh + bigw * bigw)
                    || (h2 * h2 + w2 * w2 == bigh * bigh + bigw * bigw && h2 < \
bigh)) {
                    bigh = h2;
                    bigw = w2;
                }
            }
        }
        printf("%d %d\n", bigh, bigw);
    }
    return 0;
}?\#include <stdio.h>

int main(void) {
    int h, w;

    while (scanf("%d%d", &h, &w), h != 0) {
        int x = h * h + w * w;
        int bigh = h + 1;
        int bigw = w + 1;
        int h2, w2;
        for (h2 = 1; h2 < 150; h2++) {
            for (w2 = h2 + 1; w2 < 150; w2++) {
                if ((h2 * h2 + w2 * w2 > x &&
                     h2 * h2 + w2 * w2 < bigh * bigh + bigw * bigw)
                    || (h2 * h2 + w2 * w2 == bigh * bigh + bigw * bigw && h2 < \
bigh)
                    || (h2 * h2 + w2 * w2 == x && h2 < h)) {
                    bigh = h2;
                    bigw = w2;
                }
            }
        }
        printf("%d %d\n", bigh, bigw);
    }
    return 0;
}

Compiler output:
main.c:26:2: error: expected identifier or '(' before '?' token
   26 | }?\#include <stdio.h>
      |  ^
main.c:26:3: error: stray '\' in program
   26 | }?\#include <stdio.h>
      |   ^
main.c:26:4: error: stray '#' in program
   26 | }?\#include <stdio.h>
      |    ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define rep1(i,n) for(int i=1;i<=n;i++)
struct rec{int di,h;};
vector<rec> vc;
bool comp(rec const &l,rec const &r){
	return l.di!=r.di ? l.di<r.di : l.h<r.h;
}
int main(){
	rep1(i,150) rep1(j,i-1) vc.push_back({i*i+j*j,j});
	sort(vc.begin(),vc.end(),comp);
	while(true){
		int n,m;
		scanf("%d%d",&n,&m);
		if(n==0) break;
		rec e={n*n+m*m,n};
		rec rc=*upper_bound(vc.begin(),vc.end(),e,comp);
		printf("%d %d\n",rc.h,(int)((1e-9)+sqrt(rc.di-rc.h*rc.h)));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:52: error: 'sqrt' was not declared in this scope
   20 |                 printf("%d %d\n",rc.h,(int)((1e-9)+sqrt(rc.di-rc.h*rc.h)));
      |                                                    ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  int h, w;
  while (scanf("%d%d", &h, &w) != EOF && h && w) {
    int S = h*h+w*w;
    bool finished = false;
    for (int i=h+1; i<=150; i++) {
      int W = S - i*i;
      for (int j=i+1; j<150; j++) {
	if (j * j == W) {
	  finished = true;
	  printf("%d %d\n", i, j);
	  goto END;
	}
      }
    }
    while (!finished) {
      S++;
      for (int i=1; i<=150; i++) {
	for (int j=i+1; j<150; j++) {
	  if (S == i*i+j*j) {
	    printf("%d %d\n", i, j);
	    goto END;
	  } else if (S < i*i+j*j) {
	    break;
	  }
	}
      }
    }
  END: continue;
  }
}
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
  int h, w;
  while (scanf("%d%d", &h, &w) != EOF && h && w) {
    int S = h*h+w*w;
    bool finished = false;
    for (int i=h+1; i<=150; i++) {
      int W = S - i*i;
      for (int j=i+1; j<150; j++) {
	if (j * j == W) {
	  finished = true;
	  printf("%d %d\n", i, j);
	  goto END;
	}
      }
    }
    while (!finished) {
      S++;
      for (int i=1; i<=150; i++) {
	for (int j=i+1; j<150; j++) {
	  if (S == i*i+j*j) {
	    printf("%d %d\n", i, j);
	    goto END;
	  } else if (S < i*i+j*j) {
	    break;
	  }
	}
      }
    }
  END: continue;
  }
}

Compiler output:
a.cc:40:5: error: redefinition of 'int main()'
   40 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

int h,w;
int hw;
int tai;
int cheak;
int mn;
int high,wide;

main(){
  while(cin >> h >> w,h||w){
    hw=h*h+w*w;
    tai=-1;
    mn=0;
    for(int i=1;i<=150 && mn==0;i++){
      cheak=0;
      for(int j=i+1;j<=150 && cheak==0;j++){
        if(hw<i*i+j*j && (tai==-1 || tai>i*i+j*j)){
          tai=i*i+j*j;
          high=i;
          wide=j;
        }
        else if(hw==i*i+j*j && i>h){
          high=i;
          wide=j;
          cheak=1;
          mn=1;
        }
      }
    cout << high << " " << wide << endl;

  }
}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:12:7: note: to match this '{'
   12 | main(){
      |       ^
Language: C++

m,M,X,Y,x,y,i,j;
main(){
while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
printf("%d %d\n",Y,X);
}
}

Compiler output:
a.cc:1:1: error: 'm' does not name a type
    1 | m,M,X,Y,x,y,i,j;
      | ^
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:21: error: 'x' was not declared in this scope
    3 | while(scanf("%d%d",&x,&y),x||y){
      |                     ^
a.cc:3:24: error: 'y' was not declared in this scope
    3 | while(scanf("%d%d",&x,&y),x||y){
      |                        ^
a.cc:3:7: error: 'scanf' was not declared in this scope
    3 | while(scanf("%d%d",&x,&y),x||y){
      |       ^~~~~
a.cc:4:1: error: 'm' was not declared in this scope
    4 | m=x*x+y*y,M=90000;
      | ^
a.cc:4:11: error: 'M' was not declared in this scope
    4 | m=x*x+y*y,M=90000;
      |           ^
a.cc:5:5: error: 'i' was not declared in this scope
    5 | for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
      |     ^
a.cc:5:22: error: 'j' was not declared in this scope
    5 | for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
      |                      ^
a.cc:5:69: error: 'X' was not declared in this scope
    5 | for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
      |                                                                     ^
a.cc:5:73: error: 'Y' was not declared in this scope
    5 | for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
      |                                                                         ^
a.cc:6:18: error: 'Y' was not declared in this scope
    6 | printf("%d %d\n",Y,X);
      |                  ^
a.cc:6:20: error: 'X' was not declared in this scope
    6 | printf("%d %d\n",Y,X);
      |                    ^
a.cc:6:1: error: 'printf' was not declared in this scope
    6 | printf("%d %d\n",Y,X);
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | m,M,X,Y,x,y,i,j;
Language: C++

int m,M,X,Y,x,y,i,j;
main(){
while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--) for(j=i-1;j;j--) if(m<i*i+j*j&&M>i*i+j*j)M=i*i+j*j,X=i,Y=j;
printf("%d %d\n",Y,X);
}
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:7: error: 'scanf' was not declared in this scope
    3 | while(scanf("%d%d",&x,&y),x||y){
      |       ^~~~~
a.cc:6:1: error: 'printf' was not declared in this scope
    6 | printf("%d %d\n",Y,X);
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int m,M,X,Y,x,y,i,j;
Language: C++

m,M,X,Y,x,y,i,j;
main(){ while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
printf("%d %d\n",X,Y);}}

Compiler output:
a.cc:1:1: error: 'm' does not name a type
    1 | m,M,X,Y,x,y,i,j;
      | ^
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:29: error: 'x' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |                             ^
a.cc:2:32: error: 'y' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |                                ^
a.cc:2:15: error: 'scanf' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |               ^~~~~
a.cc:3:1: error: 'm' was not declared in this scope
    3 | m=x*x+y*y,M=90000;
      | ^
a.cc:3:11: error: 'M' was not declared in this scope
    3 | m=x*x+y*y,M=90000;
      |           ^
a.cc:4:5: error: 'i' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |     ^
a.cc:4:21: error: 'j' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |                     ^
a.cc:4:65: error: 'X' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |                                                                 ^
a.cc:4:69: error: 'Y' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |                                                                     ^
a.cc:4:95: error: 'X' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |                                                                                               ^
a.cc:4:99: error: 'Y' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1,y=i*i+j*j;j<=150;j++)if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;
      |                                                                                                   ^
a.cc:5:18: error: 'X' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}}
      |                  ^
a.cc:5:20: error: 'Y' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}}
      |                    ^
a.cc:5:1: error: 'printf' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}}
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | m,M,X,Y,x,y,i,j;
Language: C++

m,M,X,Y,x,y,i,j;
main(){ while(scanf("%d%d",&x,&y),x||y){
m=x*x+y*y,M=90000;
for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
printf("%d %d\n",X,Y);}return 0;}

Compiler output:
a.cc:1:1: error: 'm' does not name a type
    1 | m,M,X,Y,x,y,i,j;
      | ^
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:29: error: 'x' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |                             ^
a.cc:2:32: error: 'y' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |                                ^
a.cc:2:15: error: 'scanf' was not declared in this scope
    2 | main(){ while(scanf("%d%d",&x,&y),x||y){
      |               ^~~~~
a.cc:3:1: error: 'm' was not declared in this scope
    3 | m=x*x+y*y,M=90000;
      | ^
a.cc:3:11: error: 'M' was not declared in this scope
    3 | m=x*x+y*y,M=90000;
      |           ^
a.cc:4:5: error: 'i' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |     ^
a.cc:4:21: error: 'j' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |                     ^
a.cc:4:66: error: 'X' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |                                                                  ^
a.cc:4:70: error: 'Y' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |                                                                      ^
a.cc:4:96: error: 'X' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |                                                                                                ^
a.cc:4:100: error: 'Y' was not declared in this scope
    4 | for(i=150;i;i--)for(j=i+1;j<=150;j++){y=i*i+j*j;if(m==y&&x<i)M=y,X=i,Y=j;else if(m<y&&M>=y)M=y,X=i,Y=j;}
      |                                                                                                    ^
a.cc:5:18: error: 'X' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}return 0;}
      |                  ^
a.cc:5:20: error: 'Y' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}return 0;}
      |                    ^
a.cc:5:1: error: 'printf' was not declared in this scope
    5 | printf("%d %d\n",X,Y);}return 0;}
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | m,M,X,Y,x,y,i,j;
Language: C++

#前計算をしておく
$hw_dict = []
def init_dict()
	for w in (1..151)
		for h in (1...w)
			elm = [h*h+w*w,h,w]
			$hw_dict.push(elm)
		end
	end
	$hw_dict = $hw_dict.sort()
end

def pred_pair(p1,p2)
	if p1[0] < p2[0]
		1
	elsif p1[0] > p2[0]
		-1
	else
		if p1[1] < p2[1]
			1
		elsif p1[1] > p2[1]
			-1
		else
			0
		end
	end
end


def solve(h,w)
	l = 0
	r = $hw_dict.length() - 1
	p = [h*h+w*w,h,w]
	ansp = 0
	found = 0
	while r - l > 1
		m = (l + r) / 2
		if pred_pair(p,$hw_dict[m]) > 0
			r = m
		elsif pred_pair(p,$hw_dict[m]) < 0
			l = m
		else
			ansp = m + 1
			found = 1
			break
		end
	end
	if found == 0
		ansp = r
	end
	[$hw_dict[ansp][1],$hw_dict[ansp][2]]
end

init_dict()

while nums = STDIN.gets().chomp().split(" ")
	if nums[0].to_i() == 0 && nums[1].to_i() == 0
		exit
	else
		ans = solve(nums[0].to_i(),nums[1].to_i())
		puts "#{ans[0]} #{ans[1]}"
	end
end

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #\U0000524d\U00008a08\U00007b97\U00003092\U00003057\U00003066\U0000304a\U0000304f
    1 | #前計算をしておく
      |  ^~~~~~~~~~~~~~~~
a.cc:4:19: error: too many decimal points in number
    4 |         for w in (1..151)
      |                   ^~~~~~
a.cc:5:27: error: too many decimal points in number
    5 |                 for h in (1...w)
      |                           ^~~~~
a.cc:2:1: error: '$hw_dict' does not name a type
    2 | $hw_dict = []
      | ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>

using namespace std;

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
typedef complex<int> P;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tii;
const double EPS = 1e-10;
const double PI = acos(-1.0);



const int n = 151;
vector<vector<int>> a(n, vector<int>(n));

void init(){
	for(int i=1;i<n;++i) for(int j=i+1;j<n;++j){
		a[i][j] = i * i + j * j;
	}
}

bool solve(){
	int h, w;
	cin>> h>> w;
	if(!h && !w) return false;

	int x = h * h + w * w;
	pii ans(n, n);
	for(int i=1;i<n;++i){
		for(int j=i+1;j<n;++j){
		int y = i*i + j*j;
		if((i <= h && y == x) || y < x) continue;
		if(y < ans.first * ans.first + ans.second * ans.second){
			int j = (int)sqrt(y - i * i);
			ans = pii(i, j);
		}
	}
	cout<< ans.first<< " "<< ans.second<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed); cout.precision(10);
	init();
	while(solve());
	return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:60:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   60 | int main(){
      |         ^~
a.cc:60:9: note: remove parentheses to default-initialize a variable
   60 | int main(){
      |         ^~
      |         --
a.cc:60:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:60:11: error: a function-definition is not allowed here before '{' token
   60 | int main(){
      |           ^
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:40:13: note: to match this '{'
   40 | bool solve(){
      |             ^
a.cc:65:2: warning: control reaches end of non-void function [-Wreturn-type]
   65 | }
      |  ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>
#include <iomanip>

using namespace std;

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
typedef complex<int> P;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tii;
const double EPS = 1e-10;
const double PI = acos(-1.0);



const int n = 151;
vector<vector<int>> a(n, vector<int>(n));

void init(){
	for(int i=1;i<n;++i) for(int j=i+1;j<n;++j){
		a[i][j] = i * i + j * j;
	}
}

bool solve(){
	int h, w;
	cin>> h>> w;
	if(!h && !w) return false;

	int x = h * h + w * w;
	pii ans(n, n);
	for(int i=1;i<n;++i){
		for(int j=i+1;j<n;++j){
		int y = i*i + j*j;
		if((i < h && y == x) || y < x) continue;
		if(y < ans.first * ans.first + ans.second * ans.second){
			int j = (int)sqrt(y - i * i);
			ans = pii(i, j);
		}
	}
	cout<< ans.first<< " "<< ans.second<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed); cout.precision(10);
	init();
	while(solve());
	return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:60:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   60 | int main(){
      |         ^~
a.cc:60:9: note: remove parentheses to default-initialize a variable
   60 | int main(){
      |         ^~
      |         --
a.cc:60:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:60:11: error: a function-definition is not allowed here before '{' token
   60 | int main(){
      |           ^
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:40:13: note: to match this '{'
   40 | bool solve(){
      |             ^
a.cc:65:2: warning: control reaches end of non-void function [-Wreturn-type]
   65 | }
      |  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef long long ll;
typedef pair<int, int> PII;

const double EPS = 1e-10;

int h, w;

int main() {
  int i, j;
  int rh, rw;
  while (1) {
    scanf("%d%d ", &h, &w); 
    if (!h && !w) break;

    rh = = rw = 200;
    int min_diag = rh*rh + rw*rw;
    for (i=1; i<=150; i++)
      for (j=i+1; j<=150; j++) {
        int diag = i*i + j*j; 
        if ((diag <= h*h + w*w) && (diag != (h*h + w*w) || i<=h)) continue;
        if ((diag < min_diag) || (diag = min_diag && i < rh)) {
          rh = i;
          rw = j; 
          min_diag = diag;
        }
      }
    printf("%d %d\n", rh, rw);
  }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: expected primary-expression before '=' token
   26 |     rh = = rw = 200;
      |          ^