当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3403:"Bloody Mary"

Special Judge 特殊评判
题目描述

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?

输入解释

The 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).

输出解释

The output contains 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'.

输入样例
1:0:0
0:1:0
0:0:1
3:2:3
输出样例
3:2:3
提示
Your outputs must fit in 64bit integers.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3403

最后修改于 2020-10-29T07:00:48+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536