Charles is in his last year of engineering college and is still scared of maths, so he passed on
his assignment to you.
nnection
He believes that any integer of the form A^x + Bay makes him angry. So, he gives you an
integer array X of size N.
For each XD). You have to find count of angry integers less than XD)
on
е
as a
ге
System.
Input Format:
the
е
set
The first line of input contains an integer N which denotes the size of array,
en
1, ans[
The second line of input contains an integer A.
The third line of input contains an integer B.
node
rage
Close
Answers
Answered by
5
Answer:
Yaar mujhe Nahi pata Tu hi bta de
Answered by
4
PYHTON CODE
n=int(input())
a=int(input())
b=int(input())
l=[int(x) for x in input().split()]
for i in l:
cnt=0
for x in range(i):
for y in range(i):
if a**x+b**y<i:
cnt=cnt+1
print(cnt)
- The range() function returns a series of numbers that, by default, starts at 0 and increments by 1 before stopping before a given number.
- start: The number that will serve as the starting point for the returned sequence of integers. stop: The number that must come before the sequence of integers is returned. Step: An integer value that establishes the increment between each integer in the sequence. The range of integers terminates at stop – 1.
- A string is divided into a list using the split() method. The separator can be specified; however, any white space is used by default. The list will have the specified number of components plus one when maxsplit is specified.
#SPJ2
Similar questions