Wars 2...
sakshi.verma6360@g...
End test
01:51:21
You are given we cost per un recorrect prot
-20
ving
deadlocks
Note
• The total cost of the plots is equal to Area.cost per unit area.
- 4.0
etermine
es a
. It is profitable to merge all the plots if the cost to merge the plots is less than the total cost of the plots.
Input format
- 40
given a
e following
• The first line contains N denoting the number of plots.
The next line contains N space-separated integers that denote the areas of each plot.
a &
- 20
ing
constructor
• The next line contains N space-separated integers denoting the cost per unit area of each plot.
ollowing
-20
Output format
In the first line, print the minimum cost to achieve one plot of the area after merging all the plots
In the second line, print YES if it is profitable to merge the plots. Otherwise, print NO
Constraints
- 100.0
ISN < 104
154; < 104
Answers
Answer:
Wars 2...
sakshi.verma6360@g...
End test
01:51:21
You are given we cost per un recorrect prot
-20
ving
deadlocks
Note
• The total cost of the plots is equal to Area.cost per unit area.
- 4.0
etermine
es a
. It is profitable to merge all the plots if the cost to merge the plots is less than the total cost of the plots.
Input format
- 40
given a
e following
• The first line contains N denoting the number of plots.
The next line contains N space-separated integers that denote the areas of each plot.
a &
- 20
ing
constructor
• The next line contains N space-separated integers denoting the cost per unit area of each plot.
ollowing
-20
Output format
In the first line, print the minimum cost to achieve one plot of the area after merging all the plots
In the second line, print YES if it is profitable to merge the plots. Otherwise, print NO
Constraints
- 100.0
ISN < 104
154; < 104