While local citizens are viewing an exhibition, they're very much
interested in the background and history of the paintings. They often ask
what a specific work is based on. The artists name other works that inspired
them to paint that particular painting. The work that borrows from other
great works a lot is considered to be great itself.
Your goal is to create art that lasts, so you can't risk to base your paintings on questionable works. Given a set of credits (which pictures are borrowed from which), you need to find the greatness of each work. |
|
The parameters required to calculate the greatness of a picture are carefully documented by art historians. According to the Academy of Numerical History of Art the greatness of a painting is strictly determined by the sum of two components: an intrinsic greatness (based on the size of the painting, the number of colors used and so on) and an inherited greatness: if P proportion of painting A is based on painting B then the greatness of A is increased by P times the greatness of B.
However if A and B are painted at the same time, they could be based on each other. This makes the calculations difficult, so the historians helpfully avoid mentioning such relations that may cause problems.
3 2 0.5 1.0 2.0 1 2 .5 1 3 .2
1.4 1 2