#B4060. Basic Bitwise Operations

    ID: 11717 Type: Default 1000ms 256MiB

Basic Bitwise Operations

Basic Bitwise Operations

This problem involves the 6 basic bitwise operations: bitwise AND, bitwise OR, bitwise XOR, bitwise NOT, left shift, and right shift. You are given three positive integers \(a\), \(b\), and \(k\). Your task is to compute and output 6 lines, where each line corresponds to the following operations respectively:

  • \(a \& b\)
  • \(a | b\)
  • \(a \oplus b\)
  • \(\sim a\)
  • \(a \ll k\)
  • \(a \gg k\)

Note: The bitwise NOT operation \(\sim a\) produces the two's complement result.

inputFormat

The input consists of a single line containing three positive integers \(a\), \(b\) and \(k\), separated by spaces.

outputFormat

Output 6 lines. Each line should contain an integer representing the result of the corresponding bitwise operation as described in the problem statement.

sample

5 3 1
1

7 6 -6 10 2

</p>