package com.pavlovasylchenko;

import java.util.*;

public class Main {

    /*
        Result:

     */
    // javac -d out src/com/**/*.java
    // java -cp out/ com.pavlovasylchenko.Main
//    public static void main(String[] args) {
//
//        Engine engine = new Engine(7, 7, Arrays.asList(
//                Figure.QUEEN,
//                Figure.QUEEN,
//                Figure.BISHOP,
//                Figure.BISHOP,
//                Figure.KNIGHT,
//                Figure.KING,
//                Figure.KING
//        ));
//
//        long first = System.currentTimeMillis();
//        List<Field> results = engine.getResult(true);
//        long last = System.currentTimeMillis();
//        System.out.println(((last - first)) / 1000d + " секунды");
//        System.out.println("Найдено количество: " + results.size());
//    }

    public static void main(String[] args) {

        ReadInput readInput = new ReadInput().invoke();

        int width = readInput.getWidth();
        int height = readInput.getHeight();
        List<Figure> figures = readInput.getFigures();

        Engine engine = new Engine(width, height, figures);
        long first = System.currentTimeMillis();
        List<Field> results = engine.getResult(true);
        long last = System.currentTimeMillis();
        System.out.println(((last - first)) / 1000d + " секунды");
        //System.out.println("Найдено количество: " + results.size());
        //for (Field resultField : results) {
            //printField(resultField.getFieldArray());
        //}
    }

    public static void printField(Figure[][] field) {
        System.out.println("-------------------------");
        for (Figure[] aField : field) {
            System.out.print("|");
            for (Figure anAField : aField) {
                if (anAField == Figure.KING) System.out.print("♚|");
                if (anAField == Figure.QUEEN) System.out.print("♛|");
                if (anAField == Figure.ROOK) System.out.print("♜|");
                if (anAField == Figure.KNIGHT) System.out.print("♞|");
                if (anAField == Figure.BISHOP) System.out.print("♝|");
                if (anAField == Figure.NONE) System.out.print("-|");
                if (anAField == null) System.out.print(" |");
            }
            System.out.println();
        }
        System.out.println("-------------------------");
    }

    private static class ReadInput {
        private int width;
        private int height;
        private List<Figure> figures;

        public int getWidth() {
            return width;
        }

        public int getHeight() {
            return height;
        }

        public List<Figure> getFigures() {
            return figures;
        }

        public ReadInput invoke() {
            Scanner s = new Scanner(System.in);
            System.out.println("Введите ширину поля: ");
            width = s.nextInt();
            System.out.println("Введите высоту поля: ");
            height = s.nextInt();

            System.out.println("Введите количество ферзей: ");
            int queenCount = s.nextInt();

            System.out.println("Введите количество ладей: ");
            int rookCount = s.nextInt();

            System.out.println("Введите количество офицеров: ");
            int bishopCount = s.nextInt();

            System.out.println("Введите количество коней: ");
            int knightCount = s.nextInt();

            System.out.println("Введите количество королей: ");
            int kingCount = s.nextInt();

            figures = new ArrayList<>();

            for (int i = 0; i < queenCount; i++) {
                figures.add(Figure.QUEEN);
            }
            for (int i = 0; i < rookCount; i++) {
                figures.add(Figure.ROOK);
            }
            for (int i = 0; i < bishopCount; i++) {
                figures.add(Figure.BISHOP);
            }
            for (int i = 0; i < knightCount; i++) {
                figures.add(Figure.KNIGHT);
            }
            for (int i = 0; i < kingCount; i++) {
                figures.add(Figure.KING);
            }
            return this;
        }
    }
}

@@ -89,16 +89,69 @@
 Result:%0A
+        %D0%92%D1%81%D0%B5%D0%B3%D0%BE %D0%B2%D0%B0%D1%80%D0%B8%D0%B0%D0%BD%D1%82%D0%BE%D0%B2: 3063828%0A        3.17 %D1%81%D0%B5%D0%BA%D1%83%D0%BD%D0%B4%D1%8B
 %0A     */

Update Main.java