// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Split {
    public static void test(int n) {
        int ix = 1;
        for(int i = 0; i <= n; i++) {
            for(int j = 0; j <= n - i; j++) {
                int k = n - i - j;
                double aktie1 = i / (double)n;
                double aktie2 = j / (double)n;
                double aktie3 = k / (double)n;
                System.out.println(ix + " " + aktie1 + " " + aktie2 + " " + aktie3);
                ix++;
            }
            
        }
    }
    public static void main(String[] args) {
        test(20);
        test(100);
    }
}
