Posts

Showing posts from April 7, 2021

Extended Divisibility

 Extended Divisibility  PROBLEM STATEMENT : The program must accept two integer values N and K as the input. The program must form a list of integers. The first value in the list is N. If N is divisible by K, then the integer value N/K must be added to the list for K times. Then the program must repeat the process for all the newly added integers in the list. Finally, the program must print the integer values in the list as the output.  Boundary Condition(s):   2 <= N <= 10^5  2 <= K <= 100  Input Format:   The first line contains N and K separated by a space.  Output Format:   The first line contains the integer values in the list separated by a space.  Example Input/Output 1: Input: ( ) 4 2 Output: 4 2 2 1 1 1 1 Explanation:   Here N=4 and K=2  Initially, the list contains 4.  N is divisible by K, so 2 (4/2) is added to the list K times.  The newly added values are 2 2 and divisible by K=2.  H...