Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com

Division of 4

Easy
0/40
0 upvote

Problem statement

Given an array, update each element of the array by the value obtained by dividing the element by 4 (take only integer part). If the value obtained by dividing element by 4 comes out to be 0, then update element with value -1.

Note : Do not return or print array and make changes in same array.
Detailed explanation ( Input/output format, Notes, Images )
Input Format :
Line 1 : An Integer N i.e. size of array
Line 2 : N integers which are elements of the array, separated by spaces
Output Format :
N elements of array, separated by space
Constraints :

1 <= N <= 10^6

Sample Input :
 2 
 3 8
Sample Output :
 -1 2
Division of 4
Full screen
Console