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
Submissions
Please login to view your submissions
Similar Problems
Points:30
2 votes
Tags:
MathsPrimesMedium
Points:30
10 votes
Tags:
MathPrefixBasic MathBasic ProgrammingDynamic Programming
Points:30
Tags:
Medium
Editorial
No editorial available for this problem.