#K82287. Dose Production Problem

    ID: 35942 Type: Default 1000ms 256MiB

Dose Production Problem

Dose Production Problem

You are given two integers, X and Y, representing the available quantities (in milliliters) of Chemical A and Chemical B respectively. A complete dose requires 2 milliliters of Chemical A and 3 milliliters of Chemical B. The task is to determine the maximum number of complete doses that can be produced given the available chemicals.

The number of doses produced from Chemical A is \(\left\lfloor \frac{X}{2} \right\rfloor\) and from Chemical B is \(\left\lfloor \frac{Y}{3} \right\rfloor\). The maximum number of complete doses is equal to the minimum of these two values:

[ \text{doses} = \min \left(\left\lfloor \frac{X}{2} \right\rfloor, ; \left\lfloor \frac{Y}{3} \right\rfloor\right) ]

inputFormat

The input consists of a single line containing two space-separated integers:

  • X: the number of milliliters of Chemical A.
  • Y: the number of milliliters of Chemical B.

You may assume that X and Y are non-negative integers.

outputFormat

Output a single integer, the maximum number of complete doses that can be produced.

## sample
10 15
5