K1 = int(input())
M = int(input())
K2 = int(input())
P2 = int(input())
N2 = int(input())
if M != 1:
for i in range(1,1000):
if i!=0 and N2==((K2-1)//i)+1:
P1 = (((K1-1)//i)//(M-1))+1
N1=(((K1-1)//i)%(M-1))
if M == 1:
N1 = 1
for i in range(1,1000):
if i!=0:
while K1 % i != 0:
K1 = K1 + 1
P1 = (K1//i)
if K2 < P2 * N2 or N2 > M or K2 // P2 < M:
P1 = -1
N1 = -1
if P2 == 1 and N2 == 1:
P1 = -1
print(P1, N1)
Объяснение:
K1 = int(input())
M = int(input())
K2 = int(input())
P2 = int(input())
N2 = int(input())
if M != 1:
for i in range(1,1000):
if i!=0 and N2==((K2-1)//i)+1:
P1 = (((K1-1)//i)//(M-1))+1
N1=(((K1-1)//i)%(M-1))
if M == 1:
N1 = 1
for i in range(1,1000):
if i!=0:
while K1 % i != 0:
K1 = K1 + 1
P1 = (K1//i)
if K2 < P2 * N2 or N2 > M or K2 // P2 < M:
P1 = -1
N1 = -1
if P2 == 1 and N2 == 1:
P1 = -1
print(P1, N1)
Объяснение:
1.
program tr;
uses drawman;
procedure t;
begin
PenDown;
OnVector (2,4);
OnVector (2,-4);
OnVector (-4,0);
OnVector (2,0);
PenUp
end;
var i:integer;
begin
Field(12,6);
ToPoint (1,1);
for i:=1 to 4 do t;
ToPoint (0,0);
end.
2.
program lod;
uses drawman;
procedure l;
begin
PenDown;
OnVector (0,2);
OnVector (-1,-2);
OnVector (2,0);
OnVector (-1,2);
OnVector (0,-2);
OnVector (-2,0);
OnVector (1,-1);
OnVector (2,0);
OnVector (1,1);
OnVector (-2,0);
PenUp
end;
begin
Field(12,9);
ToPoint (3,2);
l;
ToPoint (6,6);
l;
ToPoint (9,2);
l;
ToPoint (0,0)
end.
Объяснение:
Смотри картинки