Monday, February 21, 2022

Guess the bottom face

 It is known that in regular dice, the sum of opposite faces is 

7.

A regular dice is rolled and you are given the value X showing on the top face. Determine the value on the bottom face.

Input Format

  • The first line will contain T - the number of test cases. Then the test cases follow.
  • The first and only of each test case contains a single integer X - the value on the top face.

Output Format

For each test case, output the value on the bottom face.

Constraints

  • 1T6
  • 1X6

Sample Input 1 

3
3
1
6

Sample Output 1 

4
6
1

Explanation

Test case-1: The value on the top face is 3. Therefore, the value on the bottom face is 4 because 3+4=7.

Test case-2: The value on the top face is 1. Therefore, the value on the bottom face is 6 because 1+6=7.

Test case-3: The value on the top face is 6. Therefore, the value on the bottom face is 1 because 6+1=7.

No comments:

Post a Comment

मुझे दिल में बसाना आसान नहीं....

पता है Recently i realised की मुझे दिल में बसाना आसान नहीं है बात-बात पे चिढ़ जाती हूं मैं दिल लगा लूं एक बार तो फिर ज़िद पे अड़...