claud.qualityinfo
BAN USER- 0of 0 votes
AnswersGiven an array of integers where size of array can be large. Find if it is possible to make all elements of given array equal by multiplying elements with one or more input prime numbers.
- claud.qualityinfo in India
e.g.
arr = 50, 200
primes to use = 2, 3
so possible by multiplying 50 by 2 * 2
e.g.
arr = 3, 5
primes to use = 7
not possible| Report Duplicate | Flag | PURGE
Adobe Backend Developer - 0of 0 votes
AnswersMilly and Pranjul are playing a game in which Pranjul will give an index of a chocolate.
- claud.qualityinfo in India
Then, Milly has to tell him the box number in which that chocolate is in. There are N
such boxes and Ci chocolates are there in ith the box. Description of index is given below
:
Suppose there are A1, A2 … AN chocolates in 1st, 2nd… Nth boxes respectively. So,
indexing of chocolates in 1st box will be from 1 to A1, similarly in 2nd box indexing will be
A1 + 1 to A2 … and indexing in Nth box will be from AN-1 + 1 to AN.
Milly is blind folded so she can’t see the boxes. You are required to help her.
Input
First line will contain N (No. of boxes). Next line will contain N space separated
integers denoting Ci, the number of chocolates in ith box.
Next line will contain Q (No. of times Pranjul will ask her). Then each next Q lines
will contain the asked index I.
Output
For every query, print in a new line : the box number in which that index of
chocolate is in.
Constraints
1 ≤ N, Q ≤ 105
1 ≤ Ci ≤ 10
1 ≤ Σ Ci ≤ 106
1 ≤ I ≤ Σ Ci| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswerIn a race track, N runners participate. They may have different time of completion of track.
- claud.qualityinfo in United States
Calculate how many times will they meet after a certain time time period.
If track completion time is same, do not consider meet.
E.g.
Time: 8
Participants time: 1 2 4
Total meets: 12| Report Duplicate | Flag | PURGE