#B4145. Maximizing Pizza Deliciousness

    ID: 11802 Type: Default 1000ms 256MiB

Maximizing Pizza Deliciousness

Maximizing Pizza Deliciousness

QianQ's pizza shop is now open! He uses tomatoes to create the crust base, bacon as the topping, and cheese for the edge roll.

To cater to every customer's taste, QianQ allows you to customize your pizza with the following choices:

  • Crust Base: Choose an integer tomato concentration \(b\) from \([0, X]\).
  • Topping: Choose an integer bacon quantity \(p\) from \([1, Y]\).
  • Edge Roll: Choose an integer cheese thickness \(z\) from \([0, K]\).

The deliciousness of a pizza is defined as \((b+p) \oplus z\), where \(\oplus\) denotes the bitwise XOR operation. Two selection plans are considered different if at least one of the values \(b, p, z\) differs.

Your task is to determine the maximum deliciousness achievable and the number of ways to achieve that maximum value given the selection ranges.

inputFormat

The input consists of three integers \(X\), \(Y\), \(K\) separated by spaces.

outputFormat

Output two integers: the maximum deliciousness and the number of selection plans that achieve it.

sample

1 1 1
3 1