The Multiply, Screen, and Overlay blend modes in image manipulation programs such as Photoshop are very useful when making digital art. If you apply one of these modes to a base colour and a top colour, a resulting colour is produced. Colours have three components:
If you apply the Multiply mode, the resulting component will be
If you apply the Screen mode, the resulting component will be
The Overlay mode produces different results depending on the base component. If this component is less than
Given a blend mode and each component of the base and top colours, please find the resulting colour.
Input Specification
The first line will contain one of the following strings: Multiply
, Screen
, or Overlay
, the blend mode.
The second line will contain 3 space-separated real numbers:
The third and final line will contain 3 space-separated real numbers:
Output Specification
Output 3 space-separated real numbers on one line: the
Your answer will be judged correct if it has an absolute or relative error less than or equal to
Sample Input
Multiply
0.30 0.22 0.90
0.52 0.12 0.03
Sample Output
0.156000 0.026400 0.027000
Comments