#B4175. Determining the Machine's Operation

    ID: 11832 Type: Default 1000ms 256MiB

Determining the Machine's Operation

Determining the Machine's Operation

Little Du discovered a strange machine that takes two punched paper tapes of fixed length and produces a punched tape of the same length. The output tape is computed digit by digit using an unknown bitwise operation. In particular, if the bits at the same position in the two input tapes are denoted by \(a\) and \(b\), then the corresponding output bit is given by one of the following formulas (applied to all positions):

  • \(a \land b\) (bitwise AND),
  • \(a \lor b\) (bitwise OR), or
  • \(a \oplus b\) (bitwise XOR).

The machine prints the output tape, but the printed tape cannot be reinserted into the machine. Using only tapes that you manufacture yourself, you are allowed to perform as many tests as you want. In each test you select two tapes from those you have made, insert them into the machine, and observe the printed output. Your goal is to determine with certainty which operation the machine applies. What is the minimum number of new punched paper tapes you need to manufacture in order to guarantee that you can determine the machine's exact operation?

inputFormat

This problem does not require any input. You only need to print the minimum number of tapes required on a single line.

outputFormat

Output the integer representing the minimum number of new punched paper tapes that must be manufactured to determine the machine's operation.

sample

3