criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

public class Main {
	static int p,q,a,n,count;
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);

		while(true){
			count=0;
			p=sc.nextInt();
			q=sc.nextInt();
			a=sc.nextInt();
			n=sc.nextInt();
			if(p+q+a+n==0) break;
			s.clear();
			search(1,0,0,1);
			System.out.println(count);
		}
	}
	static void search(int deno,int nume,int k,int t){
		if(n<k) return;
		if(p*deno==q*nume){
			count++;
		}
		for(int i=t;i*deno<=a;i++){
			int de=deno*i;
			int nu=(nume*i)+deno;
			search(de,nu,k+1,i);
		}
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
			s.clear();
			^
  symbol:   variable s
  location: class Main
1 error
Language: Java

import static java.lang.Math.*;
import static java.util.Arrays.*;

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

public class Main1 {
	int p, q, a, n, cnt;
	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			p = sc.nextInt(); q = sc.nextInt(); a = sc.nextInt(); n = sc.nextInt();
			if( (p|q|a|n) == 0 ) break;
			
			cnt = 0;
			int vs[] = new int[n];
			dfs(1, 0, 1, vs);
			System.out.println(cnt);
		}
	}
	
	void dfs( int i, int x, int mul, int[] vs) {
//		debug(i, x, mul, add);
		int sum = 0;
		for(int j=0;j<x;j++) sum += mul / vs[j];
		if( p * mul == sum * q ) {
//			debug(i, x, mul, vs);
			cnt++; return;
		}
		if( x == n ) return;
		for(int j=i;j<=a;j++) {
			if( mul * j > a )break;
			vs[x] = j;
			dfs( j, x+1, mul*j, vs );
		}
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}

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

Compiler output:
Main.java:7: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
Main.java:43: error: cannot access Main
		new Main().run();
		    ^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
Language: Java


public class Main {
	public static int dfs(int p, int q, int a, int n, int cur_pro, int prev_d){
		if(n < 0){
			return 0;
		}
		
		if(p == 0 && cur_pro <= a){
			return 1;
		}else if(n == 0){
			return 0;
		}
		
		int sum = 0;
		
		int divide = /* a */ a / cur_pro + 1;
		while(p * divide >= q){
			//System.out.println("[" + n +"]" + " 1 / " + divide);
			if(divide * cur_pro > a){
				divide--;
				continue;
			}else if(n * q < p * divide){
				divide--;
				continue;
			}else if(divide < prev_d){
				break;
			}
			
			final int upper = p * divide - q;
			final int downer = q * divide;
			
			sum += dfs(upper, downer, a, n - 1, cur_pro * divide, divide);
			
			divide--;
		}
		
		return sum;
	}
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			StringTokenizer tok = new StringTokenizer(br.readLine());
			final int p = Integer.parseInt(tok.nextToken());
			final int q = Integer.parseInt(tok.nextToken());
			final int a = Integer.parseInt(tok.nextToken());
			final int n = Integer.parseInt(tok.nextToken());
			
			if(p == 0 && q == 0 && a == 0 && n == 0){
				break;
			}
			
			int sum = dfs(p, q, a, n, 1, 0);
			
			System.out.println(sum);
		}
		
	}

}

Compiler output:
Main.java:40: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:41: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:41: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:41: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:44: error: cannot find symbol
			StringTokenizer tok = new StringTokenizer(br.readLine());
			^
  symbol:   class StringTokenizer
  location: class Main
Main.java:44: error: cannot find symbol
			StringTokenizer tok = new StringTokenizer(br.readLine());
			                          ^
  symbol:   class StringTokenizer
  location: class Main
6 errors
Language: C

#include<stdio.h>
#include<stdlib.h>

int func(int p, int q, double a, int n, int i)
{
    int i;
    int b=0;
    
    if(n>0&&p>0){
        for(i=1;i<=a;i++){
            if(p*i==q){
                b++;
                b+=func(p*i-q, a/i, n-1, i);
            }
        }
    }
    return b;
}

int main(void)
{
    int p, q, a, n;
    
    while(1)
    {
        scanf("%d %d %d %d ", &p, &q, &a, &n);
        if(p==0&&q==0&&a==0&&n==0)
            break;
        
        printf("%d\n", unit(p, q, (double)a, n, 1));
    }
    return 0;
}



Compiler output:
main.c: In function 'func':
main.c:6:9: error: 'i' redeclared as different kind of symbol
    6 |     int i;
      |         ^
main.c:4:45: note: previous definition of 'i' with type 'int'
    4 | int func(int p, int q, double a, int n, int i)
      |                                         ~~~~^
main.c:13:20: error: too few arguments to function 'func'
   13 |                 b+=func(p*i-q, a/i, n-1, i);
      |                    ^~~~
main.c:4:5: note: declared here
    4 | int func(int p, int q, double a, int n, int i)
      |     ^~~~
main.c: In function 'main':
main.c:30:24: error: implicit declaration of function 'unit'; did you mean 'unix'? [-Wimplicit-function-declaration]
   30 |         printf("%d\n", unit(p, q, (double)a, n, 1));
      |                        ^~~~
      |                        unix
main.c: At top level:
main.c:34:1: error: stray '\23' in program
   34 | <U+0013>
      | ^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>

int func(int p, int q, double a, int n, int i)
{
    int i;
    int b=0;
    
    if(n>0&&p>0){
        for(i=1;i<=a;i++){
            if(p*i==q){
                b++;
                b+=func(p*i-q, a/i, n-1, i);
            }
        }
    }
    return b;
}

int main(void)
{
    int p, q, a, n, i;
    
    while(1)
    {
        scanf("%d %d %d %d ", &p, &q, &a, &n);
        if(p==0&&q==0&&a==0&&n==0)
            break;
        
        printf("%d\n", unit(p, q, (double)a, n, 1));
    }
    return 0;
}



Compiler output:
main.c: In function 'func':
main.c:6:9: error: 'i' redeclared as different kind of symbol
    6 |     int i;
      |         ^
main.c:4:45: note: previous definition of 'i' with type 'int'
    4 | int func(int p, int q, double a, int n, int i)
      |                                         ~~~~^
main.c:13:20: error: too few arguments to function 'func'
   13 |                 b+=func(p*i-q, a/i, n-1, i);
      |                    ^~~~
main.c:4:5: note: declared here
    4 | int func(int p, int q, double a, int n, int i)
      |     ^~~~
main.c: In function 'main':
main.c:30:24: error: implicit declaration of function 'unit'; did you mean 'unix'? [-Wimplicit-function-declaration]
   30 |         printf("%d\n", unit(p, q, (double)a, n, 1));
      |                        ^~~~
      |                        unix
main.c: At top level:
main.c:34:1: error: stray '\23' in program
   34 | <U+0013>
      | ^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>

int func(int p, int q, double a, int n, int 1)
{
    int i;
    int b=0;
    
    if(n>0&&p>0){
        for(i=1;i<=a;i++){
            if(p*i==q){
                b++;
            }
            b+=func(p*i-q, q*i, a/i, n-1, i);
        }
    }
    return b;
}

int main(void)
{
    int p, q, a, n;
    
    while(1)
    {
        scanf("%d %d %d %d ", &p, &q, &a, &n);
        if(p==0&&q==0&&a==0&&n==0)
            break;
        
        printf("%d\n", unit(p, q, (double)a, n, 1));
    }
    return 0;
}


Compiler output:
main.c:4:45: error: expected ';', ',' or ')' before numeric constant
    4 | int func(int p, int q, double a, int n, int 1)
      |                                             ^
main.c: In function 'main':
main.c:30:24: error: implicit declaration of function 'unit'; did you mean 'unix'? [-Wimplicit-function-declaration]
   30 |         printf("%d\n", unit(p, q, (double)a, n, 1));
      |                        ^~~~
      |                        unix
Language: C

#include<stdio.h>
#include<stdlib.h>

int func(int p, int q, double a, int n, int l)
{
    int i;
    int b=0;
    
    if(n>0&&p>0){
        for(i=l;i<=a;i++){
            if(p*i==q){
                b++;
            }
            b+=func(p*i-q, q*i, a/i, n-1, i);
        }
    }
    return b;
}

int main(void)
{
    int p, q, a, n;
    
    while(1)
    {
        scanf("%d %d %d %d ", &p, &q, &a, &n);
        if(p==0&&q==0&&a==0&&n==0)
            break;
        
        printf("%d\n", unit(p, q, (double)a, n, 1));
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:24: error: implicit declaration of function 'unit'; did you mean 'unix'? [-Wimplicit-function-declaration]
   30 |         printf("%d\n", unit(p, q, (double)a, n, 1));
      |                        ^~~~
      |                        unix
Language: C

#include <iostream>
#include <algorithm>

using namespace std;

int a, n, p, q;

int gcd(int x, int y){
  return (y == 0) ? x : gcd(y, x%y);
}

int lcm(int x, int y){
  return x * y / gcd(x, y);
}

int solve(int sp, int sq, int sa, int sn, int pre){
  if(sn > n) return 0;
  if(p / q < sp / sq) return 0;
  if(sp == p && sq == q) return 1;
  int res = 0;
  for(int i=pre;sa*i<=a;i++){
    int tp = 1, tq = i;
    int tmp = lcm(sq, tq);
    tp = tp * (tmp / tq) + sp * (tmp / sq);
    tq = tmp;
    tmp = gcd(tp, tq);
    res += solve(tp/tmp, tq/tmp, sa*i, sn+1, i);
  }
  return res;
}

main(){
  while(cin >> p >> q >> a >> n && (p|q|a|n)){
    int tmp = gcd(p, q), ans = 0;
    p /= tmp;
    q /= tmp;
    for(int i=1;i<=a&&n>0;i++) ans += solve(1, i, i, 1, i);
    cout << ans << endl;
  }
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

inline int solve(pair<int,int> fra, int b, int a, int n){
	int res = 0, temp = 1, hoge;
	// cout<<fra.numerator<<"/"<<fra.denominator<<" "<<b<<" "<<a<<" "<<n<<endl;
	if(n == 0) return 0;
	if(n == 1){
		if(fra.numerator == 1 && b <= fra.denominator && fra.denominator <= a) return 1;
		else return 0;
	}
	if(fra.numerator*b > fra.denominator*n) return -1;
	
	// cout<<"temp "<<temp<<endl;
	for(int i = 1;fra.numerator*b > fra.denominator*i; i++){
		 temp *= b;
		if(temp > a){
			// con++;
			return 0;
		}
	}
	// cout<<"temp "<<temp<<endl;
	for(int i = max(b, fra.denominator/fra.numerator); i <= a; i++){
		if(fra.numerator*i == fra.denominator) res++;
		else if(fra.numerator*i > fra.denominator){
			hoge = solve(add(fra,make_pair(-1,i)),i,a/i,n-1);
			if(hoge == -1)break;
			res += hoge;
		}
	}
	return res;
}



Compiler output:
a.cc:1:18: error: 'pair' was not declared in this scope
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                  ^~~~
a.cc:1:23: error: expected primary-expression before 'int'
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                       ^~~
a.cc:1:27: error: expected primary-expression before 'int'
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                           ^~~
a.cc:1:37: error: expected primary-expression before 'int'
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                                     ^~~
a.cc:1:44: error: expected primary-expression before 'int'
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                                            ^~~
a.cc:1:51: error: expected primary-expression before 'int'
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                                                   ^~~
a.cc:1:56: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | inline int solve(pair<int,int> fra, int b, int a, int n){
      |                                                        ^
Language: C++

#include<cstdio>

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

int p,q,a,n;
int cnt;

void dfs(int v,int l,int r,int now){
	if(v!=0){
		int d=gcd(r,l);
		if((double)p/q<(double)l/r)return;
		if(l/d==p && r/d==q)cnt++;
	}
	if(v<n){
		for(int i=now;i<=a/r;i++){
			data[v]=i;
			dfs(v+1,l*i+r,r*i,i);
		}
	}
}

int main(void){
	while(1){
		scanf("%d %d %d %d",&p,&q,&a,&n);
		if(p+q+a+n==0)break;
		int d=gcd(p,q);
		p/=d;
		q/=d;
		cnt=0;
		dfs(0,0,1,1);
		printf("%d\n",cnt);
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int, int)':
a.cc:19:25: error: 'data' was not declared in this scope
   19 |                         data[v]=i;
      |                         ^~~~
Language: C++

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

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

#define fst first
#define snd second
#define MP make_pair
#define PB push_back

VI PS, QS, AS, NS, cnts;
int P, Q, A, N;
int T;

VVI have_n_ts;

// p / q

PII ymemo[10000][10000] = {}

int p_, q_;

inline void yakubun(int p, int q) {
    p_ = p, q_ = q;
    if (p_ < 10000 && q_ < 10000 && ymemo[p_][q_]) {
        p = ymemo[p_][q_].fst;
        q = ymemo[p_][q_].snd;
        return;
    }

    int c = __gcd(p, q);
    if (c - 1) return;
    p /= c;
    q /= c;

    if (p_ < 10000 && q_ < 10000) {
        ymemo[p_][q_].fst = p;
        ymemo[p_][q_].snd = q;
    }
}

inline void add(int p1, int q1, int p2, int q2, int &np, int &nq) {
    np = p1 * q2 + p2 * q1;
    nq = q1 * q2;
    yakubun(np, nq);
}

inline void sub(int p1, int q1, int p2, int q2, int &np, int &nq) {
    add(p1, q1, -1 * p2, q2, np, nq);
}

inline void dfs(int p, int q, int a, int n, int before) {
    if (a > 12000) return;
    if (n >= 7) return;

    for (int t : have_n_ts[n]) {
        cnts[t] += a <= AS[t] && p == PS[t] && q == QS[t];
    }

    int np, nq;

    if (n == 6) {
        for (int t : have_n_ts[7]) {
            if (AS[t] > a) continue;
            sub(PS[t], QS[t], p, q, np, nq);
            cnts[t] += np == 1 && nq * a <= AS[t];
        }

        return;
    }

    for (int i = before; i * a <= 12000; i++) {
        add(p, q, 1, i, np, nq);
        dfs(np, nq, a * i, n + 1, i);
    }
}

int main(void) {
    have_n_ts.resize(8);
    T = 0;
    while (cin >> P >> Q >> A >> N, P) {
        yakubun(P, Q);
        PS.PB(P);
        QS.PB(Q);
        AS.PB(A);
        NS.PB(N);
        for (int i = 1; i <= N; i++) {
            have_n_ts[i].PB(T);
        }
        ++T;
    }

    cnts.resize(T);

    dfs(0, 1, 1, 0, 1);

    for (auto cnt : cnts) cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc:23:1: error: expected ',' or ';' before 'int'
   23 | int p_, q_;
      | ^~~
a.cc: In function 'void yakubun(int, int)':
a.cc:26:5: error: 'p_' was not declared in this scope; did you mean 'p'?
   26 |     p_ = p, q_ = q;
      |     ^~
      |     p
a.cc:26:13: error: 'q_' was not declared in this scope; did you mean 'q'?
   26 |     p_ = p, q_ = q;
      |             ^~
      |             q
Language: C++

#include <iostream>
using namespace std;
void func(int,int,double,int);
int p,q,a,n,cnt;
double k;
 
int main(){
  while(1){
    cin>>p>>q>>a>>n;
    if(!p&&!q&&!a&&!n) break;
    k=1.0*p/q;
    cnt=0;
    func(0,1,0,1);
    cout<<cnt<<endl;
  }
  return 0;
}
 
void func(int x,int w,double y,int I){
  if(-0.00000001<=k-y&&k-y<=0.00000001) cnt++;
  if(x==n) return ;
  for(int i=I;w*i<=a;i++){
    if(y+1.0/i>k+0.5) continue;
    func(x+1,w*i,1.0/i+y,i);
  }
}
#include <iostream>
using namespace std;
void func(int,int,double,int);
int p,q,a,n,cnt;
double k;
 
int main(){
  while(1){
    cin>>p>>q>>a>>n;
    if(!p&&!q&&!a&&!n) break;
    k=1.0*p/q;
    cnt=0;
    func(0,1,0,1);
    cout<<cnt<<endl;
  }
  return 0;
}
 
void func(int x,int w,double y,int I){
  if(-0.00000001<=k-y&&k-y<=0.00000001) cnt++;
  if(x==n) return ;
  for(int i=I;w*i<=a;i++){
    if(y+1.0/i>k+0.5) continue;
    func(x+1,w*i,1.0/i+y,i);
  }
}

Compiler output:
a.cc:30:5: error: redefinition of 'int p'
   30 | int p,q,a,n,cnt;
      |     ^
a.cc:4:5: note: 'int p' previously declared here
    4 | int p,q,a,n,cnt;
      |     ^
a.cc:30:7: error: redefinition of 'int q'
   30 | int p,q,a,n,cnt;
      |       ^
a.cc:4:7: note: 'int q' previously declared here
    4 | int p,q,a,n,cnt;
      |       ^
a.cc:30:9: error: redefinition of 'int a'
   30 | int p,q,a,n,cnt;
      |         ^
a.cc:4:9: note: 'int a' previously declared here
    4 | int p,q,a,n,cnt;
      |         ^
a.cc:30:11: error: redefinition of 'int n'
   30 | int p,q,a,n,cnt;
      |           ^
a.cc:4:11: note: 'int n' previously declared here
    4 | int p,q,a,n,cnt;
      |           ^
a.cc:30:13: error: redefinition of 'int cnt'
   30 | int p,q,a,n,cnt;
      |             ^~~
a.cc:4:13: note: 'int cnt' previously declared here
    4 | int p,q,a,n,cnt;
      |             ^~~
a.cc:31:8: error: redefinition of 'double k'
   31 | double k;
      |        ^
a.cc:5:8: note: 'double k' previously declared here
    5 | double k;
      |        ^
a.cc:33:5: error: redefinition of 'int main()'
   33 | int main(){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(){
      |     ^~~~
a.cc:45:6: error: redefinition of 'void func(int, int, double, int)'
   45 | void func(int x,int w,double y,int I){
      |      ^~~~
a.cc:19:6: note: 'void func(int, int, double, int)' previously defined here
   19 | void func(int x,int w,double y,int I){
      |      ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
using namespace std;

void yakubun(int &p,int &q){
	for(int i = 2; i <= q; i++){
		if(p%i==0&&q%i==0){
			p/=i;
			q/=i;
			i--;
		}
	}
}
int gcd(int a,int b){
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int lcm(int a,int b){
	return a*b/gcd(a,b);
}
// ツ暗クツつォツ算ツづーツ行ツつ、
void subOperation(int p,int q,int r,int s,int &np,int &nq){
	int t=lcm(s,q);
	int u=(t/q)*p-(t/s)*r;
    yakubun(u,t);
    np=u;nq=t;
}

#define EPS (1e-10)
int lim;
int cnt;
void dfs(int p,int q,int next,int rem,int a){
    if(a>lim)
        return;
    else{
        if(p==1)
            if(a*q<=lim&&q>=next)
                cnt++;
        rem--;
        if(rem==0)
            return;
        for(int i = (int)(sqrt(1.0*lim/a)+EPS); i >= next; i--){
            //if(i*i*a>lim)continue;
            int np,nq;
            subOperation(p,q,1,i,np,nq);
            if(np<=0)
                break;
            if(i*a*nq<=lim)
                dfs(np,nq,i,rem,i*a);
        }
    }
}

int main(){
    int p,q,a,n;
    while(cin>>p>>q>>a>>n&&!(p==0&&q==0&&a==0&&n==0)){
        lim=a;cnt=0;
        yakubun(p,q);
        // ツ催渉可づ個青板つゥツづァツづづアツづづアツ暗クツつ「ツづつ「ツつュツ催帰
        dfs(p,q,1,n,1);
        cout<<cnt<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int, int, int)':
a.cc:47:27: error: 'sqrt' was not declared in this scope
   47 |         for(int i = (int)(sqrt(1.0*lim/a)+EPS); i >= next; i--){
      |                           ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<queue>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int cont;
void saiki(double rest,int a, int n, int st, vector<int>& bin){
	
	if(fabs(rest)<0.0000001){cont++; return;}
	if(bin.size()==n)return;
	
	int sum = 1;
	rep(i,bin.size())sum*=bin[i];
	
	for(int i=st;;i++){
		if(sum*i<=a){
			bin.push_back(i);
			saiki(rest-1.0/i, a, n, i, bin);
			bin.pop_back();
		}else{
			break;
		}
	}
}

int main(){
	while(1){
		int p,q,a,n;
		cin>>p>>q>>a>>n;
		cont = 0;
		
		if(n==0)break;
		
		vector<int> bin;
		int st = 1;
		double rest = (double)p/q;
		saiki(rest,a,n,st,bin);
		
		printf("%d\n",cont);
	}
}

Compiler output:
a.cc: In function 'void saiki(double, int, int, int, std::vector<int>&)':
a.cc:17:12: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   17 |         if(fabs(rest)<0.0000001){cont++; return;}
      |            ^~~~
      |            labs
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<queue>
#include<cstdlib>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int cont;
void saiki(double rest,int a, int n, int st, vector<int>& bin){
	
	if(fabs(rest)<0.0000001){cont++; return;}
	if(bin.size()==n)return;
	
	int sum = 1;
	rep(i,bin.size())sum*=bin[i];
	
	for(int i=st;;i++){
		if(sum*i<=a){
			bin.push_back(i);
			saiki(rest-1.0/i, a, n, i, bin);
			bin.pop_back();
		}else{
			break;
		}
	}
}

int main(){
	while(1){
		int p,q,a,n;
		cin>>p>>q>>a>>n;
		cont = 0;
		
		if(n==0)break;
		
		vector<int> bin;
		int st = 1;
		double rest = (double)p/q;
		saiki(rest,a,n,st,bin);
		
		printf("%d\n",cont);
	}
}

Compiler output:
a.cc: In function 'void saiki(double, int, int, int, std::vector<int>&)':
a.cc:18:12: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   18 |         if(fabs(rest)<0.0000001){cont++; return;}
      |            ^~~~
      |            labs
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<queue>
#include<cstdlib>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int cont;
void saiki(double rest,int a, int n, int st, vector<int>& bin){
	
	if(fabs(rest)<0.0000001){cont++; return;}
	if(bin.size()==n)return;
	if(rest<0)break;
	
	int sum = 1;
	rep(i,bin.size())sum*=bin[i];
	
	for(int i=st;;i++){
		if(sum*i<=a){
			bin.push_back(i);
			saiki(rest-1.0/i, a, n, i, bin);
			bin.pop_back();
		}else{
			break;
		}
	}
}

int main(){
	while(1){
		int p,q,a,n;
		cin>>p>>q>>a>>n;
		cont = 0;
		
		if(n==0)break;
		
		vector<int> bin;
		int st = 1;
		double rest = (double)p/q;
		saiki(rest,a,n,st,bin);
		
		printf("%d\n",cont);
	}
}

Compiler output:
a.cc: In function 'void saiki(double, int, int, int, std::vector<int>&)':
a.cc:21:19: error: break statement not within loop or switch
   21 |         if(rest<0)break;
      |                   ^~~~~
Language: C++

#include <iostream>
using namespace std;

int P, Q, MS, C;

bool f(int shi, int bo, int start, int dep, int check){
  
  //cout << "!" << endl;
  //cout << shi << " " << bo << endl;
  
  if(check > MS) {
    return false;
  }
  if(shi * Q == bo * P) {
    Count++;
    //return true;
  }
  if(shi * Q > bo * P) {
    return false;
  }
  if(dep == 0) {
    return false;
  }
  
  for(int i = start; i <= 6000; i++) {
    
    f(i*shi + bo, bo*i, i, dep - 1, check * i);
  }
  
  return true;
}

int main(){

  int n;
  while(cin >> P >> Q >> MS >> n) {

    if(P == 0 && Q == 0 && MS == 0 && n == 0)
      break;

    Count = 0;
    f(0, 1, 1, n, 1);

    cout << Count << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool f(int, int, int, int, int)':
a.cc:15:5: error: 'Count' was not declared in this scope
   15 |     Count++;
      |     ^~~~~
a.cc: In function 'int main()':
a.cc:41:5: error: 'Count' was not declared in this scope
   41 |     Count = 0;
      |     ^~~~~
Language: C++

#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; ++i)
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define P pair<int, int>

int ans = 0, p, q, a, n;

void reduce(int &p, int &q, int &x, int &y){
  p = p * y;
  x = x * q;
  q = q * y;
  y = q;
}

bool isSame(int x, int y){
  // 求める分数とx, yで通分
  int tmp_p = p, tmp_q = q;
  reduce(tmp_p, tmp_q, x, y);

  // 値が同じならok
  if(tmp_p == x){
    return true;
  } else{
    // 違うならだめ
    return false;
  }
}

// 必要なもの ... 今までの和の分子、分母、何個見たか、どの数まで見たか
// 必ず通分すれば積は求めなくていい
// 答えを求めるときも通分する
void dfs(int x, int y, int cnt, int max){

  // それが答えならばansを1増やす、これ以上は探索しても意味が無いので打ち切る
  if(isSame(x, y)){
    ans++;
    return ;
    // 答えじゃないけど、もうn個まで見てしまったか、積がaぴったし
  } else if(cnt >= n || y >= a){
    return ;
  }

  // 見た数から、積がリミット以上になるまで
  for(int i = max; i * y <= a; ++i){
    int tmp_x = x, tmp_y = y, tmp = 1, tmp_i = i;
    // 通分して、足す
    reduce(tmp_x, tmp_y, tmp, tmp_i);
    // 再帰
    dfs(tmp_x + tmp, tmp_y, cnt + 1, i);
  }
}

int main() {
  while(cin >>p >>q >>a >>n && p){
    ans = 0;
    // 再帰処理, 最初は 0 / 1
    dfs(0, 1, 0, 1);
    cout <<ans <<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:9: error: 'cin' was not declared in this scope
   71 |   while(cin >>p >>q >>a >>n && p){
      |         ^~~
a.cc:18:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   17 | #include <ctime>
  +++ |+#include <iostream>
   18 | using namespace std;
a.cc:75:5: error: 'cout' was not declared in this scope
   75 |     cout <<ans <<endl;
      |     ^~~~
a.cc:75:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
using namespace std;
int a, n, x;
int cnt, deno;

void search( double p, double q , int x){
    if( x / deno  < 1 ||  ) return 0;
    if( x )
}

int main(){
    int p, q;
    while( cin >> p >> q >> a >> n && p ){
        cnt = 0;
        deno = 2;
    }
}

Compiler output:
a.cc: In function 'void search(double, double, int)':
a.cc:7:27: error: expected primary-expression before ')' token
    7 |     if( x / deno  < 1 ||  ) return 0;
      |                           ^
a.cc:7:36: error: return-statement with a value, in function returning 'void' [-fpermissive]
    7 |     if( x / deno  < 1 ||  ) return 0;
      |                                    ^
a.cc:9:1: error: expected primary-expression before '}' token
    9 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>

int all[8];
int max, maxcnt;
int res = 0;

int gcm(int a, int b){
	if (b == 0)return a;
	else gcm(b, a%b);
}

int lcm(int a, int b){
	int c = gcm(a, b);
	return a / c*b / c*c;
}

bool ask(int p, int q, int pp, int qq){
	return p*qq >= pp*q;
}

std::pair<int, int> hiku(int p, int q, int pp, int qq){

	int g = lcm(std::max(q, qq), std::min(q, qq));
	int a = (p*g / q) - (pp*g / qq), b = g;
	int c = gcm(b, a);
	a /= c; b /= c;
	return std::make_pair(a, b);
}

void calc(int p, int q, int cnt){

	int sum = 1;
	for (int i = 1; i < cnt; i++)sum *= all[i];

	if (sum > max || cnt > maxcnt)return;

	if (p == 0)res++;

	for (int i = all[cnt - 1]; i < max; i++){
		if (ask(p, q, 1, i)){
			all[cnt] = i;
			std::pair<int, int> a = hiku(p, q, 1, i);
			calc(a.first, a.second, cnt + 1);
		}
	}
}


int main(){

	int p, q;
	while (std::cin >> p >> q >> max >> maxcnt, p || q || max || maxcnt){

		res = 0;
		memset(all, 0, sizeof(all));

		maxcnt++;

		calc(p, q, 1);

		std::cout << res << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
   56 |                 memset(all, 0, sizeof(all));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | 
a.cc: In function 'int gcm(int, int)':
a.cc:10:17: warning: control reaches end of non-void function [-Wreturn-type]
   10 |         else gcm(b, a%b);
      |              ~~~^~~~~~~~
Language: C++

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



int main()
{
	int p, q, a, n, m[8];
	while (cin >> p >> q >> a >> n, p || q || a || n){
		int counter = 0;
		for (int i0 = 1; i0 <pow((double)a, (double)3 / (double)2); i0++){
			m[0] = i0;
			if (n >= 1){
				int s = q * m[0];
				if (s * p / q == s / m[0]){
					counter++;
				}
			}
			for (int i1 = 1; i1 <= i0; i1++){
				m[1] = i1;
				if (m[0] * m[1] > a || n < 2){
					break;
				}
				else{
					int s = q * m[0] * m[1];
					if (s * p / q == s / m[0] + s / m[1]){
						counter++;
					}
				}
				for (int i2 = 1; i2 <= i1; i2++){
					m[2] = i2;
					if (m[0] * m[1] * m[2] > a || n < 3){
						break;
					}
					else{
						int s = q * m[0] * m[1] * m[2];
						if (s * p / q == s / m[0] + s / m[1] + s / m[2]){
							counter++;
						}
					}
					for (int i3 = 1; i3 <= i2; i3++){
						m[3] = i3;
						if (m[0] * m[1] * m[2] * m[3] > a || n < 4){
							break;
						}
						else {
							int s = q * m[0] * m[1] * m[2] * m[3];
							if (s * p / q == s / m[0] + s / m[1] + s / m[2] + s / m[3]){
								counter++;
							}
						}
						for (int i4 = 1; i4 <= i3; i4++){
							m[4] = i4;
							if (m[0] * m[1] * m[2] * m[3] * m[4] > a || n < 5){
								break;
							}
							else {
								int s = q * m[0] * m[1] * m[2] * m[3] * m[4];
								if (s * p / q == s / m[0] + s / m[1] + s / m[2] + s / m[3] + s / m[4]){
									counter++;
								}
							}
							for (int i5 = 1; i5 <= i4; i5++){
								m[5] = i5;
								if (m[0] * m[1] * m[2] * m[3] * m[4] * m[5] > a || n < 6){
									break;
								}
								else{
									int s = q * m[0] * m[1] * m[2] * m[3] * m[4] * m[5];
									if (s * p / q == s / m[0] + s / m[1] + s / m[2] + s / m[3] + s / m[4] + s / m[5]){
										counter++;
									}
								}
								for (int i6 = 1; i6 <= i5; i6++){
									m[6] = i6;
									if (m[0] * m[1] * m[2] * m[3] * m[4] * m[5] * m[6] > a || n < 7){
										break;
									}
									else{
										int s = q * m[0] * m[1] * m[2] * m[3] * m[4] * m[5] * m[6];
										if (s * p / q == s / m[0] + s / m[1] + s / m[2] + s / m[3] + s / m[4] + s / m[5] + s / m[6]){
											counter++;
										}
									}
								}
							}
						}
					}
				}
			}
		}
		cout << counter << endl;
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:95:18: error: expected '}' at end of input
   95 |         return 0;
      |                  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <iostream>

using namespace std;

class Frac{
public:
    int num, den;
    Frac():num(0), den(1){}
    Frac(const Frac &f):num(f.num), den(f.den){}
    Frac(int num_, int den_):num(num_), den(den_){}
    Frac& operator-=(const Frac &f){
        int g = __gcd(den, f.den);
        Frac t((num * f.den - f.num * den) / g, den * f.den / g);
        g = __gcd(t.num, t.den);
        num = t.num / g; den = t.den / g;
        return *this;
    }
};

inline Frac operator-(const Frac &lhs, const Frac &rhs){
    Frac t(lhs);
    t -= rhs;
    return t;
}

int solve(Frac prev, int lo, int hi, int n){
    if(prev.num == 0)return 1;
    if(n == 0)return 0;
    int res = 0;
    for(int d=lo; d<=hi; ++d)res += solve(prev - Frac(1, d), d, hi/d, n-1);
    return res;
}

int main(){
    int p, q, a, n;
    while(cin >> p >> q >> a >> n, p|q|a|n)cout << solve(Frac(p, q), 1, a, n) << '\n';
    return 0;
}

Compiler output:
a.cc: In member function 'Frac& Frac::operator-=(const Frac&)':
a.cc:12:17: error: '__gcd' was not declared in this scope
   12 |         int g = __gcd(den, f.den);
      |                 ^~~~~
Language: C

#include"env.h"
double X[300],Y[300],x,y,d,s,t,p,q;
N,i,j,m,c;
C(k){
	c=0;
	for(k=N;k--;c>m?m=c:0)
		c+=k==i|k==j|hypot(X[k]-p,Y[k]-q)<1;
}
main(){
	for(;scanf("%d",&N)*N;printf("%d \n",m)){
		for(i=N;i--;)
			scanf("%lf%lf",X+i,Y+i);
		for(m=1;++i<N;)
			for(j=i;j--;
					d<2?
						s=(X[i]+X[j])/2,t=(Y[i]+Y[j])/2,
						x*=d=sqrt(1-d*d/4)/d,y*=d,
						p=s-y,q=t+x,C(),p=s+y,q=t-x,C()
					:0)
				d=hypot(x=X[i]-X[j],y=Y[i]-Y[j]);
	}
}

Compiler output:
main.c:1:9: fatal error: env.h: No such file or directory
    1 | #include"env.h"
      |         ^~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>

using namespace std;

typedef complex<double> Point;

const double EPS = 1e-8;

int n;
Point data[300];

int calc(Point a, Point b){
  int res = 0;
  double d = abs(b - a) / 2.0;
  Point ab = (b - a) / (2.0 * d);
  if(d < 1){
    Point o = ab * d;
    d = sqrt(1.0 - d * d);
    o += Point(d * ab.imag() + a.real(), -d * ab.real() + a.imag());
    for(int i=0;i<n;i++){
      if(abs(o - data[i]) < 1.0 + EPS) res++;
    }
  }
  return res;
}

main(){
  while(cin >> n && n){
    for(int i=0;i<n;i++){
      cin >> data[i].imag() >> data[i].real();
    }
    int ans = 1;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        ans = max(ans, calc(data[i], data[j]));
        ans = max(ans, calc(data[j], data[i]));
      }
    }
    cout << ans << endl;
  }
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

#define MAX_N 310

long double x[MAX_N], y[MAX_N];
int n, maxn;

int main() {
	while (true) {
		cin >> n;
		if (n == 0) { break; }
		for (int i = 0; i < n; i++) {
			cin >> x[i] >> y[i];
		}
		maxn = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				int sum = 0;
				long double X = (x[i] + x[j]) / 2.0;
				long double Y = (y[i] + y[j]) / 2.0;
				for (int k = 0; k < n; k++) {
					if (((x[k] - X)*(x[k] - X) + (y[k] - Y)*(y[k] - Y)) <= 1) {
						sum++;
					}
				}
				maxn = max(maxn, sum);
				long double X1, Y1, X2, Y2, X3, Y3, VX2, VY2, Dist, Dist2;
				Dist = sqrt((x[j] - x[i])*(x[j] - x[i]) + (y[j] - y[i])*(y[j] - y[i]));
				Dist2 = sqrt(4 - Dist*Dist);
				X2 = x[j] - x[i]; Y2 = y[j] - y[i];
				VX2 = (X2 / Dist)*Dist2 / 2; VY2 = (Y2 / Dist)*Dist2 / 2;
				X1 = X + VY2; Y1 = Y - VX2;
				X3 = X - VY2; Y3 = Y + VX2;

				sum = 0;
				for (int k = 0; k < n; k++) {
					if (((x[k] - X1)*(x[k] - X1) + (y[k] - Y1)*(y[k] - Y1)) <= 1) {
						sum++;
					}
				}
				maxn = max(maxn, sum);
				sum = 0;
				for (int k = 0; k < n; k++) {
					if (((x[k] - X3)*(x[k] - X3) + (y[k] - Y3)*(y[k] - Y3)) <= 1) {
						sum++;
					}
				}
				maxn = max(maxn, sum);
			}
		}
		for (int i = 0; i < n; i++) {
			int sum = 0;
			long double X = x[i];
			long double Y = y[i];
			for (int k = 0; k < n; k++) {
				if (((x[k] - X)*(x[k] - X) + (y[k] - Y)*(y[k] - Y)) <= 1) {
					sum++;
				}
			}
			maxn = max(maxn, sum);
		}
		cout << maxn << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:40: error: 'sqrt' was not declared in this scope
   30 |                                 Dist = sqrt((x[j] - x[i])*(x[j] - x[i]) + (y[j] - y[i])*(y[j] - y[i]));
      |                                        ^~~~
Language: C++

#include <complex>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;

#define X real()
#define Y imag()

// ----- debug macro -----
#define DMPPT(p,stream) stream << (p).X << "," << (p).Y
// ----- ----- ----- -----

// ???????§???????????§????????????£°????£°?????????????????????§???????????\?????¶????????????????????¶????????????????¨????????§???????????£???
typedef complex<double> PT;
typedef complex<double> VC;

// ??¶??´??±???or ??±?£?????????????????????´??????????£??????§???????????????????????VC get_vc_normal(VC a) {
	a = a * PT(0,-1);
	return a / abs(a);
}

int N;
const double EPS = 1e-9;

// rest code
int main() {
	while(cin >> N, N) {
		vector<PT> p;
		for(int i = 0; i < N; i++) {
			double x, y;
			cin >> x >> y;
			p.push_back(PT(x,y));
		}

		int res = 1;
		for(int i = 0; i < p.size(); i++) {
			for(int j = 0; j < p.size(); j++) {
				if(i == j) continue;
				VC a, b;
				PT c[2];
				double len;
				a = (p[j] - p[i]) / 2.0;
				if(abs(a) > 1.0) continue;
				b = get_vc_normal(a);
				len = sqrt(1.0 - norm(a));
				c[0] = p[i] + a + len*b;
				c[1] = p[i] + a - len*b;

				for(int k = 0; k < 2; k++) {
					int tmp = 0;
					for(int l = 0; l < p.size(); l++) {
						if(abs(c[k] - p[l]) < 1.0 + EPS) tmp++;
					}
					res = max(res, tmp);
				}
			}
		}
		cout << res << endl;
	}
}

Compiler output:
a.cc:19:9: error: 'a' does not name a type
   19 |         a = a * PT(0,-1);
      |         ^
a.cc:20:9: error: expected unqualified-id before 'return'
   20 |         return a / abs(a);
      |         ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
a.cc: In function 'int main()':
a.cc:45:37: error: 'get_vc_normal' was not declared in this scope
   45 |                                 b = get_vc_normal(a);
      |                                     ^~~~~~~~~~~~~
Language: C++

3
1 0
0 0
0 1
3
6.47634 7.69628
5.16828 4.79915
6.69533 6.20378
6
7.15296 4.08328
6.50827 2.69466
5.91219 3.86661
5.29853 4.16097
6.10838 3.46039
6.34060 2.41599
8
7.90650 4.01746
4.10998 4.18354
4.67289 4.01887
6.33885 4.28388
4.98106 3.82728
5.12379 5.16473
7.84664 4.67693
4.02776 3.87990
20
6.65128 5.47490
6.42743 6.26189
6.35864 4.61611
6.59020 4.54228
4.43967 5.70059
4.38226 5.70536
5.50755 6.18163
7.41971 6.13668
6.71936 3.04496
5.61832 4.23857
5.99424 4.29328
5.60961 4.32998
6.82242 5.79683
5.44693 3.82724
6.70906 3.65736
7.89087 5.68000
6.23300 4.59530
5.92401 4.92329
6.24168 3.81389
6.22671 3.62210
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int N;
pair<double,double> dots[300];

int main(){

	while(cin >> N && N != 0){
		for(int i = 0; i < N; i++){
			pair<double,double> p;
			cin >> dots[i].second >> dots[i].first;
		}
		int maxCnt = 1;
		// ~ðìé½ßÌQ_ðßé
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
				pair<double,double> dot1,dot2;
				dot1 = dots[i];
				dot2 = dots[j];

				double v = sqrt((dot1.first - dot2.first)*(dot1.first - dot2.first)
					+(dot1.second - dot2.second)*(dot1.second - dot2.second));
				// ñ_Ô£ª2æè¨¨«¯êÎÂ­êÈ¢
				if(v > 2){
					continue;
				}

				double x = sqrt(1 - (v/2)*(v/2));

				// ñgÌPÊ@üxNg
				pair<double,double> hose[2];
				hose[0].first = -1.0/(dots[i].first - dots[j].first);
				hose[0].second = 1.0/(dots[i].second - dots[j].second);
				hose[1].first = 1.0/(dots[i].first - dots[j].first);
				hose[1].second = -1.0/(dots[i].second - dots[j].second);

				double dd1 = sqrt((hose[0].second)*(hose[0].second)+(hose[0].first)*(hose[0].first));
				double dd2 = sqrt((hose[1].second)*(hose[1].second)+(hose[1].first)*(hose[1].first));
				hose[0].first /= dd1; hose[0].second /= dd1;
				hose[1].first /= dd2; hose[1].second /= dd2;

				// x{·é
				hose[0].first *= x;hose[1].first *= x;
				hose[0].second *= x;hose[1].second *= x;

				// mð«·
				hose[0].first += (dot1.first + dot2.first)/2;
				hose[0].second += (dot1.second + dot2.second)/2;
				hose[1].first += (dot1.first + dot2.first)/2;
				hose[1].second += (dot1.second + dot2.second)/2;

				// hose[0]Æhose[1]Í~ÌSÀW
				// e_ÉÖµÄ~ÌÉ¶Ý·é©Ç¤©ðßé
				for(int k = 0; k < 2; k++){
					int cnt = 0;
					for(int l = 0; l < N; l++){
						double dist = sqrt((dots[l].first -hose[k].first)*(dots[l].first -hose[k].first)
							+ (dots[l].second -hose[k].second)*(dots[l].second -hose[k].second));
						if(dist <= 1){
							cnt++;
						}
					}
					maxCnt = max(maxCnt,cnt);
				}
			}
		}
		cout << maxCnt << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:44: error: 'sqrt' was not declared in this scope
   25 |                                 double v = sqrt((dot1.first - dot2.first)*(dot1.first - dot2.first)
      |                                            ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<complex>
#include<algorithm>
#include<math>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

typedef complex<double> Point;

const double EPS = 0.000001;

int main(){
	
	A:;
	
	int n;
	cin>>n;
	
	if(n==0)return 0;
	
	vector<Point> point;
	rep(i,n){
		double a,b;
		cin>>a>>b;
		point.push_back(Point(a,b));
	}
	
	int ans = 1;
	rep(i,n){
		rep(j,n){
			if(i==j)continue;
			
			Point p1 = point[j];
			Point p0 = point[i];
			
			Point diff = p1-p0;
			Point d2 = diff/Point(2,0);
			
			double dlen = abs(d2);
			if(dlen>1.0)continue;
			
			double clen = sqrt(1-dlen*dlen);
			Point e = d2*Point(0,1);
			e = e/Point(abs(e),0)*Point(clen,0);
			
			Point t = p0 + d2 + e;
			
			int count = 0;
			rep(k,n){
				if(abs(t-point[k])<=1.0+EPS)count++;
			}
			ans = max(ans,count);
		}
	}
	
	printf("%d\n",ans);
	
	goto A;
}
/*
3
6.47634 7.69628
5.16828 4.79915
6.69533 6.20378

2
0 0
0.8 0

2
0 0
0.5 0.5

2
0 0
0 2

6
7.15296 4.08328
6.50827 2.69466
5.91219 3.86661
5.29853 4.16097
6.10838 3.46039
6.34060 2.41599

*/

Compiler output:
a.cc:6:9: fatal error: math: No such file or directory
    6 | #include<math>
      |         ^~~~~~
compilation terminated.
Language: C++

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

double Dis(double x1, double y1, double x2, double y2);
int main(void){
	while(1){
		int n;
		int ans = 1;
		vector< pair<double, double> > p;

		cin >> n;
		if(n == 0) break;

		for(int i=0; i<n; i++){
			pair<double, double> t;
			cin >> t.first >> t.second;
			p.push_back(t);
		}

		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				//中点
				double mpx = (p[i].first + p[j].first) / 2.0;
				double mpy = (p[i].second + p[j].second) / 2.0;
				//2点間の距離
				double d1 = Dis(p[i].first, p[i].second, p[j].first, p[j].second);
				//p[i]からp[j]へ向かうベクトル
				double v1x = (p[i].first - p[j].first) / d1;
				double v1y = (p[i].second - p[j].second) / d1;
				//中点から円の中心へ向かう単位ベクトル
				double v2x = -v1y;
				double v2y = v1x;
				//中心から円の中心へ向かうベクトルの長さ
				double d2 = sqrt(1.0 - (d1*d1/4.0)));

				//円の中心の座標
				double cx = mpx + v2x * d2;
				double cy = mpy + v2y * d2;

				int cnt = 0;
				for(int k=0; k<n; k++){
					if(k == i || k == j || Dis(cx, cy, p[k].first, p[k].second) <= 1.0)	cnt++;
				}
				if(cnt > ans){
					ans = cnt;
				}

				cx = mpx - v2x * d2;
				cy = mpy - v2y * d2;

				cnt = 0;
				for(int k=0; k<n; k++){
					if(Dis(cx, cy, p[k].first, p[k].second) <= 1.0)	cnt++;
				}
				if(cnt > ans){
					ans = cnt;
				}
			}
		}

		cout << ans << endl;


	}
	
	return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:34:68: error: expected ',' or ';' before ')' token
   34 |                                 double d2 = sqrt(1.0 - (d1*d1/4.0)));
      |                                                                    ^
Language: C++

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

double Dis(double x1, double y1, double x2, double y2);
int main(void){
	while(1){
		int n;
		int ans = 1;
		vector< pair<double, double> > p;

		cin >> n;
		if(n == 0) break;

		for(int i=0; i<n; i++){
			pair<double, double> t;
			cin >> t.first >> t.second;
			p.push_back(t);
		}

		for(int i=0; i<n; i++){
			for(int j=i+1; j<n; j++){
				//中点
				double mpx = (p[i].first + p[j].first) / 2.0;
				double mpy = (p[i].second + p[j].second) / 2.0;
				//2点間の距離
				double d1 = Dis(p[i].first, p[i].second, p[j].first, p[j].second);
				//p[i]からp[j]へ向かうベクトル
				double v1x = (p[j].first - p[i].first) / d1;
				double v1y = (p[j].second - p[i].second) / d1;
				//中点から円の中心へ向かう単位ベクトル
				double v2x = -v1y;
				double v2y = v1x;
				//中心から円の中心へ向かうベクトルの長さ
				double d2 = sqrt(1.0 - (d1*d1/4.0));

				//円の中心の座標
				double cx = mpx + v2x * d2;
				double cy = mpy + v2y * d2;

				int cnt = 0;
				for(int k=0; k<n; k++){
					if(k == i || k == j || (cx-p[k].first)*(cx-p[k].first) + (cy-p[k].second)*(cy-p[k].second) <= 1.0)	cnt++;
				}
				if(cnt > ans){
					ans = cnt;
				}

				cx = mpx - v2x * d2;
				cy = mpy - v2y * d2;

				cnt = 0;
				for(int k=0; k<n; k++){
				}
				if(cnt > ans){
					if(k == i || k == j || (cx-p[k].first)*(cx-p[k].first) + (cy-p[k].second)*(cy-p[k].second) <= 1.0)	cnt++;
					ans = cnt;
				}
			}
		}

		cout << ans << endl;


	}
	
	return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:55:44: error: 'k' was not declared in this scope
   55 |                                         if(k == i || k == j || (cx-p[k].first)*(cx-p[k].first) + (cy-p[k].second)*(cy-p[k].second) <= 1.0)      cnt++;
      |                                            ^
Language: C++

#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int N,M,L;

int B[10],H[10],P[10],T[10];

int flow[11]; //BÌÉ]¤Ê B,F,AÉË¶A±êÈ~FAÍgíêÈ¢
double ht[11]; //tbãÌAæØçê½Ì³h

void Fill(int l,int r,int in,int &water)
{
	if(water == 0) return ; //ªÈ¢
	if(l != r){
		int ci = l,ch = 0; //ÌCfbNXÆ³
		for(int i = l; i < r; i++){
			if(ch < H[i]){
				ci = i; ch = H[i];
			}
		}
		if(ci >= in){
			Fill(l,ci,in,water);
			Fill(ci+1,r,in,water);
		} else {
			Fill(ci+1,r,in,water);
			Fill(l,ci,in,water);
		}
	}

	int s = ((r == N) ? 100 : B[r]) - ((l == 0) ? 0 : B[l - 1]); //êÊÏ
	double h = ht[l]; //³
	//if(h >= 50.0) return ; //±êÈ~ÇÁÍsÂ\
	double max_h = min((r == N) ? 50 * 30 : H[r],(l == 0) ? 50 * 30 : H[l - 1]);

	////ÇÁ³êé³
	double add_h = (water > s * (max_h - h)) ? (max_h - h) : (water / (double)s);
	water -= (int)(add_h * s); //ð¸çµ
	for(int i = l; i <= r; i++) ht[i] += add_h; //Êðã°é

}

void solve()
{
	cin >> N;
	flow[0] = 0;
	for(int i = 0; i < N; i++){
		cin >> B[i] >> H[i];
		H[i] *= 30;
		flow[i+1] = 0;
	}

	int F[10],A[10];
	cin >> M;
	for(int i = 0; i < M; i++){
		cin >> F[i] >> A[i];
		for(int j = 0; j <= N; j++){
			if(j == N || F[i] < B[j]){
				flow[j] += A[i];
				break;
			}
		}
	}

	cin >> L;
	for(int i = 0; i < L; i++)
		cin >> P[i] >> T[i];
	
	for(int i = 0; i < L; i++){
		for(int j = 0; j <= N; j++){
			ht[j] = 0.0; // ³NA
		}

		//Ìã©ç¬ü
		for(int j = 0; j <= N; j++){
			if(flow[j] == 0) continue; //¬üÈµ
			int water = flow[j]*T[i];
			Fill(0,N,j,water);
		}

		int p = 0;
		while(p < N && P[i] > B[p]) p++;
		//ÅãÉ30ÅÁÄ³ðàÆÉß·
		printf("%.4lf\n",ht[p] / 30.0);
	}

}

int main()
{
	int D;
	cin >> D;
	for(int i = 0; i < D; i++)
	{
		solve();
	}

	return 0;
}

Compiler output:
a.cc: In function 'void Fill(int, int, int, int&)':
a.cc:39:38: error: 'max_h' was not declared in this scope
   39 |         double add_h = (water > s * (max_h - h)) ? (max_h - h) : (water / (double)s);
      |                                      ^~~~~