Fisherman's Mantra:-
Input Format:
A fisherman usually gets F number of fish from the sea. The fisherman requested a sage to yield more fishes from the sea. So he got a special boon from the sage. The sage allowed him to chant a mantra for N times. For each time he chants the mantra, the number of fish captured doubles. Given the number of first day fish F and number of times N he chants the mantra, find the final increased count of fish he gets from the sea.
A fisherman usually gets F number of fish from the sea. The fisherman requested a sage to yield more fishes from the sea. So he got a special boon from the sage. The sage allowed him to chant a mantra for N times. For each time he chants the mantra, the number of fish captured doubles. Given the number of first day fish F and number of times N he chants the mantra, find the final increased count of fish he gets from the sea.
The first line contains the value of fishes F and number of chants N separated by a space.
Output Format
The first line contains the value of final number of fish T
Example Input/Output 1:
Input:
5 2
Output: 20
Example Input/Output 2:
Input:
6 1
Output: 12
|
Arithmetic Progression:-
Accept three values related to an arithmetic progression - number of terms T. initial value I and the difference between the terms D. Print the values of the T terms.
Input Format :
The first line contains the number of terms T.
The second line contains the initial value I.
The third line contains the difference between the terms D.
Output Format :
The first line contains the values of T terms in the progression.
Example Input/Output 1:
Input:
5
1
2
Output:
1 3 5 7 9
Example Input/Output 2:
Input:
6 5 20
Output:
5 25 45 65 85
105
Pattern-001:-
Given the number of rows N. print the numbers from
1 to N'N . such that N elements are printed in each row.
Input Format :
The first line contains the
number of rows N.
Output Format :
First N•
N numberssuch
that each row contains N numbers.
Example Input/Output 1:
Input:
3
Output:
1 2 3
4 5 6
7 8 9
Example Input/Output 2: Input:
6
Output:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
31 32 33 34 35 36