Ubisoft Interview Question

2-3 maths and logical que