Array Transformation
Practice
5 (1 votes)
Medium
Problem
15% Success 525 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given an array A of size N . Generate an array B of size N . Find the sum of array B.
Array B has a definite property. For every i where 1<=i<=n
1. \(B[i]=A[i]/X\)
2. \(A[i]%X==0\)%X==0
2. X is a perfect square.
X can be varied.
Find the minimum possible sum of array B.
INPUT
First line of input contains a single integer N denoting size of array A.
Next line contains N seperated integers of array A.
OUTPUT
Output the sum of new array B.
CONSTRAINTS
1<=N<=1000000
1<=A[i]<=1000000
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
3 votes
Tags:
C++Basic MathObservationMath
2.LCM^k
Points:30
69 votes
Tags:
Basic MathAlgorithmsMath
Points:30
8 votes
Tags:
Basic MathPrefixMathObservationC++
Editorial
No editorial available for this problem.