TSILSEA - Editorial

PROBLEM LINK:

Practice
Contest

Author: Riddhish Lichade
Tester: Riddhish Lichade
Editorialist: Riddhish Lichade

DIFFICULTY:

SIMPLE

PREREQUISITES:

Math

PROBLEM:

Meena recently watched the series ‘The silent sea’.

He wonders how much lunar water will be there if the water molecules expand every second forming another molecule, i.e. the number of water molecules gets doubled every second.

Given N, the number of lunar water molecules and S, the time in seconds, find the number of Lunar water molecules after time S.

EXPLANATION:

The number of molecules doubles after every second, i.e. after a fixed interval. So the number of molecules after time T can be found by the formula of Geometric Progression, i.e.
ans=N*2^t

SOLUTIONS:

Setter's Solution
from sys import stdin
import math
for _ in range(int(stdin.readline())):
    n, t = map(int, stdin.readline().strip().split())
    ans=n*int(math.pow(2,t))
    print(ans)