Language: C++

//6.12
import java.util.Scanner;
import java.io.*;
import java.math.*;
import java.util.Arrays;

class Main{
    long even[]=new long[1000];
    long gcd(long a,long b){
	return b==0?a:gcd(b,a%b);
    }
    void solve(int n,long oddmin){
	Arrays.sort(even,0,n);
	long ta=even[0];
	for(int i=0;i<n;i++){
	    ta=gcd(ta,even[i]);
	}
	long tx0=even[0]/ta,tx1=even[1]/ta;
	long g2=oddmin/tx0/tx1;
	long g=(long)(Math.sqrt(g2));

	//find A=A'/g
	long evenans=ta/g;
	//find all odd ans
	System.out.println(evenans);
	for(int i=0;i<n;i++){
	    if (i!=0)System.out.print(" ");
	    System.out.print(even[i]/evenans);
	}
	System.out.print("\n");
    }
    void run(){
	Scanner in = new Scanner(System.in);
	//System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
	int n;
	while(true){
	    n=in.nextInt();
	    if(n == 0)break;
	    int m=n*(n+1)/2;
	    int evenp=0;
	    long oddmin=9223372036854775807L;
	    for(int i=0;i<m;i++){
		long tmp;
		tmp=in.nextLong();
		if (tmp%2 == 0)even[evenp++]=tmp;
		else oddmin=(oddmin>tmp)?tmp:oddmin;
	    }
	    solve(n,oddmin);
	}
    }

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

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.math.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.Arrays;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:52:11: error: expected ':' before 'static'
   52 |     public static void main(String args[]){
      |           ^~~~~~~
      |           :
a.cc:52:29: error: 'String' has not been declared
   52 |     public static void main(String args[]){
      |                             ^~~~~~
a.cc:8:10: error: flexible array member 'Main::even' in an otherwise empty 'class Main'
    8 |     long even[]=new long[1000];
      |          ^~~~
a.cc:56:2: error: expected ';' after class definition
   56 | }
      |  ^
      |  ;
a.cc:8:10: error: initializer for flexible array member 'long int Main::even []'
    8 |     long even[]=new long[1000];
      |          ^~~~
a.cc: In member function 'void Main::solve(int, long int)':
a.cc:13:9: error: 'Arrays' was not declared in this scope
   13 |         Arrays.sort(even,0,n);
      |         ^~~~~~
a.cc:20:23: error: 'Math' was not declared in this scope
   20 |         long g=(long)(Math.sqrt(g2));
      |                       ^~~~
a.cc:25:9: error: 'System' was not declared in this scope
   25 |         System.out.println(evenans);
      |         ^~~~~~
a.cc: In member function 'void Main::run()':
a.cc:33:9: error: 'Scanner' was not declared in this scope
   33 |         Scanner in = new Scanner(System.in);
      |         ^~~~~~~
a.cc:37:15: error: 'in' was not declared in this scope; did you mean 'int'?
   37 |             n=in.nextInt();
      |               ^~
      |               int