#B3895. Determine the Number of Performance and Efficiency Cores

    ID: 11552 Type: Default 1000ms 256MiB

Determine the Number of Performance and Efficiency Cores

Determine the Number of Performance and Efficiency Cores

In modern mixed-architecture CPUs, there are two types of cores: Performance cores (P cores) and Efficiency cores (E cores). Each P core provides 2 threads, and every E core provides 1 thread. Note that every CPU must have at least one performance core, while it may have no efficiency cores.

Given a CPU with a total of (C) cores and (T) threads, you can determine the number of performance cores (p) and efficiency cores (e) using the formulas:

[ \begin{aligned} p &= T - C, \ e &= 2C - T. \end{aligned} ]

Your task is to compute (p) and (e) given the total number of cores and total number of threads.

inputFormat

The input consists of a single line with two integers separated by a space: (C) (the total number of cores) and (T) (the total number of threads). It is guaranteed that the input corresponds to a valid CPU configuration.

outputFormat

Output two integers separated by a space: the number of performance cores and the number of efficiency cores.

sample

14 20
6 8