public static void main(String[] args) throws Exception {
        BufferedReader brA = new BufferedReader(new FileReader("./input/coefficient/coefficient.txt"));
        BufferedReader brX = new BufferedReader(new FileReader("./input/unknownNum/unknownNum.txt"));
        BufferedReader brB = new BufferedReader(new FileReader("./input/bvector/bvector.txt"));

        ArrayList<ArrayList<Float>> A = new ArrayList<ArrayList<Float>>();
        List<Float> X = new ArrayList<Float>();
        List<Float> B = new ArrayList<Float>();
        List<Float> newX = new ArrayList<Float>();

        String line;
        while ((line = brA.readLine()) != null) {
            String[] tmp = line.split("\\s+");
            String[] num = tmp[1].split(",");
            ArrayList<Float> inter = new ArrayList<Float>();
            for (int i = 0; i < num.length; i++)
                inter.add(Float.parseFloat(num[i]));
            A.add(inter);
        }

        while ((line = brB.readLine()) != null) {
            B.add(Float.parseFloat(line));
        }

        while ((line = brX.readLine()) != null) {
            X.add(Float.parseFloat(line));
        }

        brA.close();
        brB.close();
        brX.close();


        while (true) {
            for (int i = 0; i < A.size(); i++) {
                float sum = 0;
                for (int j = 0; j < A.size(); j++) {
                    if (i == j)
                        continue;
                    sum += A.get(i).get(j) * X.get(j);
                }
                newX.add((B.get(i) - sum) / A.get(i).get(i));
            }

            float tmpsum = 0;
            if (CheckError(X, newX, 0.5f))
                break;
            else {
                X.clear();
                X.addAll(newX);
                newX.clear();
            }
        }

        System.out.println(newX.toString());
    }