Lucky Pairs Richie and Raechal are participating in a game called "Lucky pairs" at the Annual Game Fair in their Company. As per the rules of the contest, two members form a team and Richie initially has the number A and Raechal has the number B. There are a total of N turns in the game, and Richie and Raechal alternatively take turns. In each turn, the player's number is multiplied by 2. Richie has the first turn. Suppose after the entire N turns, Richie’s number has become C, and Raechal’s number has become D, the final score of the team will be the sum of the scores (C+D) of both the players after N turns. Write a program to facilitate the quiz organizers to find the final scores of the team. Input and Output Format: The only line of input contains 3 integers A, B, and N. Output a single line that contains the integer that gives the final score of the team which will be the sum of the scores of both the players after N turns. Refer sample input and output for formatting specifications. Sample Input 1: 1 2 1 Sample Output 1: 4 Sample Input 2: 3 7 2 Sample Output 2: 20
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Richie and Raechal are participating in a game called "Lucky pairs" at the Annual Game Fair in their Company. As per the rules of the contest, two members form a team and Richie initially has the number A and Raechal has the number B.
There are a total of N turns in the game, and Richie and Raechal alternatively take turns. In each turn, the player's number is multiplied by 2. Richie has the first turn. Suppose after the entire N turns, Richie’s number has become C, and Raechal’s number has become D, the final score of the team will be the sum of the scores (C+D) of both the players after N turns.
Write a
Input and Output Format:
The only line of input contains 3 integers A, B, and N.
Output a single line that contains the integer that gives the final score of the team which will be the sum of the scores of both the players after N turns.
Refer sample input and output for formatting specifications.
Sample Input 1:
1 2 1
Sample Output 1:
4
Sample Input 2:
3 7 2
Sample Output 2:
20
Step by step
Solved in 4 steps with 2 images