-
Notifications
You must be signed in to change notification settings - Fork 0
/
solver.py
37 lines (27 loc) · 912 Bytes
/
solver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from sys import argv
from typing import Dict
from input_tasks_getter import InputTasksGetter
from task_solver_B import TaskSolverB
from task_solver_X import TaskSolverX
from task_solver_Y import TaskSolverY
from task_summator import TaskSummator
def main():
variant = 3 if len(argv) != 2 else int(argv[1])
input_tasks_getter = InputTasksGetter()
input_task = input_tasks_getter.get_input_task(variant)
print(f'Variant #{variant}; Input Numbers: {input_task}')
task_solver_x = TaskSolverX()
task_solver_x.solve_task(input_task)
x: Dict = task_solver_x.get_x()
print()
task_solver_b = TaskSolverB()
task_solver_b.solve_task(x)
b: Dict = task_solver_b.get_b()
print()
task_solver_y = TaskSolverY()
task_solver_y.solve_task(x, b)
print()
task_summator = TaskSummator()
task_summator.solve_task(x, b)
if __name__ == '__main__':
main()