Skip to content

Commit b9a3d0e

Browse files
Create task1.py
Signed-off-by: Ruslan Senatorov <55090151+ruslansenatorov@users.noreply.github.com>
1 parent 58bcbe9 commit b9a3d0e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

task/11_2/task1.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# FULL PYTHON SOLUTION
2+
3+
def main() -> None:
4+
g1, g2, s1, s2, y1, y2 = map(float, input().split())
5+
ys = y1 * s1 + y2 * s2
6+
rho = 1.0 / ys
7+
alpha = rho * (s1 * g1 + s2 * g2)
8+
q1 = g1 - alpha * y1
9+
q2 = g2 - alpha * y2
10+
gamma = ys / (y1 * y1 + y2 * y2)
11+
r1 = gamma * q1
12+
r2 = gamma * q2
13+
beta = rho * (y1 * r1 + y2 * r2)
14+
r1 = r1 + s1 * (alpha - beta)
15+
r2 = r2 + s2 * (alpha - beta)
16+
print(f"{-r1:.6f} {-r2:.6f}")
17+
18+
19+
if __name__ == '__main__':
20+
main()

0 commit comments

Comments
 (0)