|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||0||0||0||0.000%|
Mr. Chou is the flatworld diamond dealer. It is important that he knows the value of his (two dimensional) diamonds in order to be a successful businessman. Mr. Chou is tired of calculating the values by hand and you have to write a program that makes the calculation for him.
The value of a diamond is determined by smoothness of its surface. This depends on the amount of faces on the surface, more faces means a smoother surface. If there are dents (marked red in figure 2) in the surface of the diamond, the value of the diamond decreases. Counting the number of dents in the surface (a) and the number of faces on the surface that are not in dents (b), the value of the diamond is determined by the following formula: v = −a · p + b · q. When v is negative, the diamond has no value (ie. zero value).
No combination of three vertices within one diamond will be linearly aligned.
For each test case, the output contains one line with one number: the value of the diamond.
1 10 5 7 0 10 8 4 10 -7 6 -9 -5 -4 -5 7 -2 6