Language: C++


import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;



public class Main {

	static PrintWriter out = new PrintWriter(System.out);
	static FastScanner sc = new FastScanner();
	static Scanner stdIn = new Scanner(System.in);
	static TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>();
	
	public static void main(String[] args) {
		while(true) {
			int k = sc.nextInt();
			if(k == 0) break;
			int count = 0;
			int tmp = k*(k-1)/2;
			for(int i = 0; i < tmp; i++) {
				count += sc.nextInt();
			}
			out.println(count /(k-1));
		}
		out.flush();
	}
}
//------------------------------//
//-----------//
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
    	 if (!hasNext()) throw new NoSuchElementException();
         int n = 0;
         boolean minus = false;
         int b = readByte();
         if (b == '-') {
             minus = true;
             b = readByte();
         }
         if (b < '0' || '9' < b) {
             throw new NumberFormatException();
         }
         while(true){
             if ('0' <= b && b <= '9') {
                 n *= 10;
                 n += b - '0';
             }else if(b == -1 || !isPrintableChar(b)){
                 return minus ? -n : n;
             }else{
                 throw new NumberFormatException();
             }
             b = readByte();
         }
    }
    
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
    

}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.awt.geom.Point2D;
      | ^~~~~~
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.BigInteger;
      | ^~~~~~
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.ArrayDeque;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.ArrayList;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.util.Arrays;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import java.util.Collections;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
    9 | import java.util.Comparator;
      | ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: 'import' does not name a type
   10 | import java.util.Deque;
      | ^~~~~~
a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: 'import' does not name a type
   11 | import java.util.HashMap;
      | ^~~~~~
a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:1: error: 'import' does not name a type
   12 | import java.util.HashSet;
      | ^~~~~~
a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:1: error: 'import' does not name a type
   13 | import java.util.List;
      | ^~~~~~
a.cc:13:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:1: error: 'import' does not name a type
   14 | import java.util.NoSuchElementException;
      | ^~~~~~
a.cc:14:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:1: error: 'import' does not name a type
   15 | import java.util.PriorityQueue;
      | ^~~~~~
a.cc:15:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:16:1: error: 'import' does not name a type
   16 | import java.util.Scanner;
      | ^~~~~~
a.cc:16:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:17:1: error: 'import' does not name a type
   17 | import java.util.Stack;
      | ^~~~~~
a.cc:17:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:18:1: error: 'import' does not name a type
   18 | import java.util.TreeMap;
      | ^~~~~~
a.cc:18:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:22:1: error: expected unqualified-id before 'public'
   22 | public class Main {
      | ^~~~~~
a.cc:46:12: error: expected ':' before 'final'
   46 |     private final InputStream in = System.in;
      |            ^~~~~~
      |            :
a.cc:46:13: error: 'final' does not name a type
   46 |     private final InputStream in = System.in;
      |             ^~~~~
a.cc:47:12: error: expected ':' before 'final'
   47 |     private final byte[] buffer = new byte[1024];
      |            ^~~~~~
      |            :
a.cc:47:13: error: 'final' does not name a type
   47 |     private final byte[] buffer = new byte[1024];
      |             ^~~~~
a.cc:48:12: error: expected ':' before 'int'
   48 |     private int ptr = 0;
      |            ^~~~
      |            :
a.cc:49:12: error: expected ':' before 'int'
   49 |     private int buflen = 0;
      |            ^~~~
      |            :
a.cc:50:12: error: expected ':' before 'boolean'
   50 |     private boolean hasNextByte() {
      |            ^~~~~~~~
      |            :
a.cc:50:13: error: 'boolean' does not name a type; did you mean 'bool'?
   50 |     private boolean hasNextByte() {
      |             ^~~~~~~
      |             bool
a.cc:66:12: error: expected ':' before 'int'
   66 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |            ^~~~
      |            :
a.cc:67:12: error: expected ':' before 'static'
   67 |     private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
      |            ^~~~~~~
      |            :
a.cc:67:20: error: 'boolean' does not name a type; did you mean 'bool'?
   67 |     private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
      |                    ^~~~~~~
      |                    bool
a.cc:68:12: error: expected ':' before 'void'
   68 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |            ^~~~~
      |            :
a.cc:69:11: error: expected ':' before 'boolean'
   69 |     public boolean hasNext() { skipUnprintable(); return hasNextByte();}
      |           ^~~~~~~~
      |           :
a.cc:69:12: error: 'boolean' does not name a type; did you mean 'bool'?
   69 |     public boolean hasNext() { skipUnprintable(); return hasNextByte();}
      |            ^~~~~~~
      |            bool
a.cc:70:11: error: expected ':' before 'String'
   70 |     public String next() {
      |           ^~~~~~~
      |           :
a.cc:70:12: error: 'String' does not name a type
   70 |     public String next() {
      |            ^~~~~~
a.cc:80:11: error: expected ':' before 'long'
   80 |     public long nextLong() {
      |           ^~~~~
      |           :
a.cc:105:11: error: expected ':' before 'int'
  105 |     public int nextInt() {
      |           ^~~~
      |           :
a.cc:130:11: error: expected ':' before 'double'
  130 |     public double nextDouble() {
      |           ^~~~~~~
      |           :
a.cc:135:2: error: expected ';' after class definition
  135 | }
      |  ^
      |  ;
a.cc: In member function 'int FastScanner::readByte()':
a.cc:66:34: error: 'hasNextByte' was not declared in this scope
   66 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |                                  ^~~~~~~~~~~
a.cc:66:56: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
   66 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |                                                        ^~~~~~
      |                                                        buflen
a.cc: In member function 'void FastScanner::skipUnprintable()':
a.cc:68:44: error: 'hasNextByte' was not declared in this scope
   68 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                            ^~~~~~~~~~~
a.cc:68:78: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
   68 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                                                              ^~~~~~
      |                                                                              buflen
a.cc:68:62: error: 'isPrintableChar' was not declared in this scope
   68 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                                              ^~~~~~~~~~~~~~~
a.cc: In member function 'long int FastScanner::nextLong()':
a.cc:81:14: error: 'hasNext' was not declared in this scope
   81 |         if (!hasNext()) throw new NoSuchElementException();
      |              ^~~~~~~
a.cc:81:35: error: expected type-specifier before 'NoSuchElementException'
   81 |         if (!hasNext()) throw new NoSuchElementException();
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
a.cc:83:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   83 |         boolean minus = false;
      |         ^~~~~~~
      |         bool
a.cc:86:13: error: 'minus' was not declared in this scope
   86 |             minus = true;
      |             ^~~~~
a.cc:90:23: error: expected type-specifier before 'NumberFormatException'
   90 |             throw new NumberFormatException();
      |                       ^~~~~~~~~~~~~~~~~~~~~
a.cc:96:34: error: 'isPrintableChar' was not declared in this scope
   96 |             }else if(b == -1 || !isPrintableChar(b)){
      |                                  ^~~~~~~~~~~~~~~
a.cc:97:24: error: 'minus' was not declared in this scope
   97 |                 return minus ? -n : n;
      |                        ^~~~~
a.cc:99:27: error: expected type-specifier before 'NumberFormatException'
   99 |                 throw new NumberFormatException();
      |                           ^~~~~~~~~~~~~~~~~~~~~
a.cc: In member function 'int FastScanner::nextInt()':
a.cc:106:15: error: 'hasNext' was not declared in this scope
  106 |          if (!hasNext()) throw new NoSuchElementException();
      |               ^~~~~~~
a.cc:106:36: error: expected type-specifier before 'NoSuchElementException'
  106 |          if (!hasNext()) throw new NoSuchElementException();
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
a.cc:108:10: error: 'boolean' was not declared in this scope; did you mean 'bool'?
  108 |          boolean minus = false;
      |          ^~~~~~~
      |          bool
a.cc:111:14: error: 'minus' was not declared in this scope
  111 |              minus = true;
      |              ^~~~~
a.cc:115:24: error: expected type-specifier before 'NumberFormatException'
  115 |              throw new NumberFormatException();
      |                        ^~~~~~~~~~~~~~~~~~~~~
a.cc:121:35: error: 'isPrintableChar' was not declared in this scope
  121 |              }else if(b == -1 || !isPrintableChar(b)){
      |                                   ^~~~~~~~~~~~~~~
a.cc:122:25: error: 'minus' was not declared in this scope
  122 |                  return minus ? -n : n;
      |                         ^~~~~
a.cc:124:28: error: expected type-specifier before 'NumberFormatException'
  124 |                  throw new NumberFormatException();
      |                            ^