Triple Sevens
Time limit1sMemory limit2048 MB
Given three wheels of digits, check whether every wheel contains the digit 7, then print 777 if so and 0 otherwise.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Eddy is overseeing the construction of some new slot machines. Each slot machine has three wheels, and each wheel can show one of several different digits. When the machine is activated, each wheel shows a random digit. The goal is for every wheel to be able to show the digit .
A slot machine is good if each wheel is capable of showing the digit , and bad otherwise. For a given slot machine, determine whether it is good or bad.
Input
The first line contains a single integer , the number of different digits on each wheel. Each wheel has the same number of digits.
Each of the next three lines contains distinct digits (in the range from to ). These are the digits on each of the three wheels.
Output
Output a single integer, which is if the slot machine is good, otherwise.