22666_'BloodyMary'

2022-5-16 18:22| 发布者: Hocassian| 查看: 26| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506835412300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22666

Title

'Bloody Mary'

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22666

AC

0

Submit

8

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    There is a mixture of water, alcohol and tomato juice in three vessels. The volume ratio of components in the first, second and third vessels is equal a1 : a2 : a3, b1 : b2 : b3 and c1 : c2 : c3 correspondingly.

    In what volume ratio is it necessary to take liquids from these vessels in order to create a mixture with a component ratio d1 : d2 : d3?

    输入

    Input consists of four lines. The first line contains values of parameters a1, a2, a3, the others -- values of parameters b1, b2, b3; c1, c2, c3 and d1, d2, d3 correspondingly. All numbers are integers from 0 to 1000; each line contains at least one nonzero value. The values on each line are separated by colons (without spaces).

    输出

    Description

    There is a mixture of water, alcohol and tomato juice in three vessels. The volume ratio of components in the first, second and third vessels is equal a1 : a2 : a3, b1 : b2 : b3 and c1 : c2 : c3 correspondingly.

    In what volume ratio is it necessary to take liquids from these vessels in order to create a mixture with a component ratio d1 : d2 : d3?

    Input

    Input consists of four lines. The first line contains values of parameters a1, a2, a3, the others -- values of parameters b1, b2, b3; c1, c2, c3 and d1, d2, d3 correspondingly. All numbers are integers from 0 to 1000; each line contains at least one nonzero value. The values on each line are separated by colons (without spaces).

    Output

    Output a single line with the result. The result has the same format as the input data.

    If it is impossible to create necessary mixture, the output file should contain a single line with word 'impossible'.

    Sample Input

    1:0:0
    0:1:0
    0:0:1
    3:2:3

    Sample Output

    3:2:3

    Source

    样例输入

    1:0:0
    0:1:0
    0:0:1
    3:2:3

    样例输出

    3:2:3

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部