Table of contents
Question description
A certain company department needs to send employees to work on projects abroad.
Now, country code-named x and country code-named y require cntx and cnty employees respectively.
Each employee in the department has an employee number (1, 2, 3,...), and the employee numbers are consecutive, starting from 1.
Rules for ministers dispatching employees:
Rule 1: Select employees from [1, k] to dispatch.
Rule 2: Employees numbered as multiples of x cannot go to country x, and employees numbered as multiples of y cannot go to country y.
question:
Find the smallest k so that employees numbered in [1, k] can be assigned to country x and country y, and satisfy country x and country y