## DMOPC '18 Contest 5 P1 - A Painting Problem

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Mimi is taking both art and computer science this semester! Inspired, she decides to make an art piece based on the binary representation of two positive integers, and .

Mimi takes a strip of paper, and draws stripes on it. The stripe is blue if appears in the binary representation of either or , but not both. Otherwise, it is painted purple.

Can you tell Mimi how many blue and purple stripes there are?

#### Input Specification

The first and only line of input will contain 3 space separated integers: , , and .

#### Output Specification

The output should contain two space-separated integers: the number of stripes that are painted blue, and the number of stripes that are painted purple, respectively.

#### Sample Input

3 1 2

#### Sample Output

1 1

#### Explanation for Sample Output

The binary representation of is , and the binary representation of is .
Both representations have , so the first stripe is painted purple.
Since only has in its binary representation, the second stripe is painted blue.