luogu#P4928. [MtOI2018] 衣服?身外之物!
[MtOI2018] 衣服?身外之物!
Background
gcd has many pieces of clothing, and each piece has a different color.
Problem Description
gcd has a total of pieces of clothing, numbered .
Each piece of clothing has a color value and a washing time. After wearing a piece of clothing, he will send it to be washed. The comfort value of that day depends on the product of the day's weather value and the clothing's color value, and the weather value can be negative.
Given the weather for days, find the maximum total comfort value.
If it is certain that there exists a day when gcd has no clothes to wear, output "gcd loves her clothes!" (without quotes).
Input Format
The input consists of lines.
Line contains .
Line contains , representing the color values of the clothes.
Line contains , representing the washing times of the clothes.
Line contains , representing the weather value of each day.
Output Format
Output line: the maximum total comfort value over days of wearing clothes, or output "gcd loves her clothes!".
2 5
5 10
1 1
2 4 3 5 2
125
Hint
Sample Explanation
Subtasks
For of the testdata, , .
For of the testdata, , .
For of the testdata, , , , , , .
Source
Problem setter: b2019dy
78488
Translated by ChatGPT 5