peterverebics/CodeNet_Python_118 huggingface dataset:
import math

A, B, H, M = map(int, input().split())

cos = math.cos(math.radians((60*H + M)/2))
cos = round(cos, 3)

result = math.sqrt(A**2 + B**2 - 2*A*B*cos)

print(result)
import math
a, b, h, m = map(int, input().split())

a_angle = (60*h+m)/720 * 360
b_angle = m/60 * 360
angle = abs(a_angle - b_angle)
co = math.cos(angle)

x = a**2 + b**2 - 2*a*b*co
y = math.sqrt(x)
print(y)
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

a,b,h,m = map(int,input().split())
d1 = h*30 + m*0.5
d2 = m*6
kakudo = abs(d2-d1)
if kakudo>180:
    kakudo -= 180
ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(kakudo))
print(math.sqrt(ans))
import math
A, B, H, M = map(int, input().split())

H_deg = H*30 + M*0.5 if H < 6 else (H-12)*-1*30 - M*0.5
M_deg = M*6
if M <= H*5:
    degree = H_deg + M_deg
else:
    degree = H_deg - (360 - M_deg)

if degree == 180:
    print(A+B)
elif degree < 180:
    c = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(degree)))
    print(c)
else:
    c = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(360-degree)))
    print(c)
import math

A,B,H,M = map(int, input().split())
##Aは短針の長さ、Bは長針の長さ
##ARは短針の進んだ針の角度、BRは長針の進んだ針の角度
AR = 360*H/12+30*M/60
BR = 360*M/60

if abs(AR-BR)<180:
  X = abs(AR-BR)
elif abs(AR-BR)>180:
  X = abs(AR-BR)-180
else :
  X = 0

C = A*A+B*B-2*A*B*math.cos(math.radians(X))
print(C**0.5)
import math

a,b,h,m=map(int,input().split())

theta_h=float((math.pi * h) / 6)
theta_m=float((math.pi * m) / 30)

x_2=float(a**2+b**2-2*a*b*math.cos(abs(theta_h-theta_m)))
x=math.sqrt(x_2)
print(x)
import math
A,B,H,M=map(int,input().split())

rh = (H * 30) + (M * 0.6)
rm = M * 6
sita = abs(rh-rm)
if sita >= 180 :
    sita = 360 - sita

# X = ans ** 2
sin = math.sin(math.radians(sita))
cos = math.cos(math.radians(sita)) 
X = (A*sin)**2 + (B - A*cos)**2

#print('A=%d B=%d' % (A,B) )
#print('sin90 = %f ' % round(math.sin(math.radians(sita)), 12))
#print('cos90 = %f ' % math.cos(math.radians(sita)))
#print('X=%d' % X )
#print(sita)
print(math.sqrt(X))
import math

a, b, h, m = map(int, input().split())
l = m * 0.5 + h * 30
s = m * 6
th = abs(l - s)
if th > 180:
    th -= 180
cos = math.cos(math.radians(th))
ans = a**2 + b**2 - 2 * a * b * cos
print('{:.20f}'.format(math.sqrt(ans)))
# L = 360 / 12 = 30度 1時間
# L = 30 / 60 = 1/2度 1分
# S = 360 / 60 = 6度 1分

# L = 360 / H/M
# S = 360/M

import math
A, B, H, M = map(int, input().split())

L = (60 * H + M) / 2
S = (M * 6) % 360
dig = (max(L, S) - min(L, S)) % 180

print(math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(math.radians(dig))))
import math
a,b,h,m =map(int,input().split())
 
x =30*h+(m*0.5)%360
 
y=m*6
sa =abs(x-y)
if a>b:
    c=b
    b=a
    a=c
t =(math.sin(math.radians(sa)))*b
 
f=math.sqrt(b**2-t**2)
if sa >=90:
    a =-a
print(math.sqrt((f-a)**2+t**2))
import math
A, B, H, M = map(int, input().split())

dif = (30*H)-(5.5*M)
deg = dif%180
if dif==0:
    print(abs(A-B))
elif dif==180:
    print(A+B)
else:
    ans = math.sqrt((A**2)+(B**2)-(2*A*B*math.cos(math.radians(deg))))
    print(ans)
import math
A,B,H,M=map(int,input().split())

for i in range(10):
    if 0<=abs(360*i-abs(30*H+int(M/2)-6*M))<360:
        a=abs(360*i-abs(30*H+int(M/2)-6*M))
        c=abs(360-abs(360*i-abs(30*H+int(M/2)-6*M)))
        break
b=min(a,c)

print("{:.9f}".format(((A**2+B**2-2*A*B*(math.cos(b*(math.pi/180))))**(1/2))))
a,b,h,m=map(int,input().split())
h+=m/60
from math import radians,cos
r=30*h-6*m
if r>=180:
	r-=180
r=radians(r)
e=a**2+b**2-2*a*b*cos(r)
print(e**0.5)
A,B,H,M = (int(x) for x in input().split())
import math
Angle = H*30-M*6
if 180<Angle<=360:
    Angle = 360-Angle
Rad = math.radians(Angle)
Length = math.sqrt(A*A + B*B -2*A*B*math.cos(Rad))
print(Length)
import math

def main():
    a, b, h, m = map(int, input().split())
    hr = 360//12*(h%12)+30*(m%60)//60
    mr = 360//60*(m%60)
    ans = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(abs(hr-mr))))
    print(ans)

if __name__ == "__main__":
    main()
import math

Inp = input()
List = Inp.split(" ")
A = int(List[0])
B = int(List[1])
H = int(List[2])
M = int(List[3])

DegA = int(H*30 + M*0.5)
DegB = int(M*6)


if abs(DegA - DegB) <= 180:
    Deg = DegA - DegB

else:

    if DegA > DegB:
        Deg = 360 - DegA + DegB

    else:
        Deg = 360 - DegB + DegA
    
C = (A**2 + B**2 - 2*B*A*math.cos(math.radians(Deg)))**0.5

print(format(C,'.10f'))
# coding: utf-8
# Your code here!
import sys
import itertools
import math
import numpy

A, B, H, M = map(int, input().split())
h_ras = 30 * H + 0.5 * M
m_ras = 60 * M

cos_h = math.cos(math.radians(h_ras))
sin_h = math.sin(math.radians(h_ras))

cos_m = math.cos(math.radians(m_ras))
sin_m = math.sin(math.radians(m_ras))

hx = A * cos_h
hy = A * sin_h

mx = B * cos_m
my = B * sin_m

a = numpy.array([hx, hy])
b = numpy.array([mx, my])
u = b - a
print('{:.11f}'.format(numpy.linalg.norm(u)))
#C
A, B, H, M= map(int,input().split())
import math
theta_S=30*H+(1/10)*M
theta_L=6*M
S_x=A*math.sin(math.radians(theta_S))
S_y=A*math.cos(math.radians(theta_S))
L_x=B*math.sin(math.radians(theta_L))
L_y=B*math.cos(math.radians(theta_L))
distance=((S_x-L_x)**2+(S_y-L_y)**2)**0.5
print(distance)
import math
A,B,H,M = map(int,input().split())
h = 360/12*H
m = 360/60*M
if H == 0:
    h = 360
if M == 0:
    m = 360
C = abs(m-h)
print(math.sqrt(A**2+B**2-(2*A*B*math.cos(math.radians(C)))))
import math
a,b,h,m = map(int,input().split())

if h==0:
    hh = 0
else:
    hh = 360*(h/12)
if m==0:
    mm = 0
else:
    mm = 360*(m/60)
    
x = int(abs(mm-hh))
if x > 180:
    x = 360 - x

a2 = a**2
b2 = b**2

ans = math.sqrt((a2+b2)-(2*a*b*math.cos(math.radians(x))))
print(ans)
import math

a, b, h, m = [int(e) for e in input().split(" ")[:4]]

xa = a * math.cos(math.radians(30 * h))
ya = a * math.sin(math.radians(30 * h))
xb = b * math.cos(math.radians(6 * h))
yb = b * math.sin(math.radians(6 * h))


l = math.sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

print(l)
import math
from decimal import Decimal
A,B,H,M = (int(x) for x in input().split())
ang_H = Decimal(360*H/12)
ang_M = Decimal(360*M/60)
ang = abs(float(ang_H)-float(ang_M))
ang_pi = Decimal(ang)*Decimal(2)*Decimal(math.pi)/Decimal(360)
ABAB = Decimal(A)**Decimal(2)+Decimal(B)**Decimal(2)-Decimal(2)*Decimal(A)*Decimal(B)*Decimal(math.cos(float(ang_pi)))
AB = (Decimal(ABAB))**(Decimal(0.5))
print(AB)
import math
a, b, h, m = map(int, input().split())

diff = (h-m/60)*30
cos = math.cos(math.radians(diff))

dis = math.sqrt(a*a+b*b-2*a*b*cos)

print(dis)
a,b,c,d = map(int,input().split())
import math
rad = math.fabs((c/12 - d/60)*360)
rad = min(rad,360-rad)
cosine = math.cos(math.radians(rad))
print((a**2+b**2 - 2*a*b*cosine)**0.5)
import sys
readline = sys.stdin.buffer.readline

import math


a, b, h, m = map(int, readline().split())

theta_a = 360 * h / 12 + m / 2
theta_a = min(theta_a, 360 - theta_a)
theta_b = 360 * m / 60
theta_b = min(theta_b, 360 - theta_b)

theta = abs(theta_b - theta_a) * math.pi / 180
c = a ** 2 + b ** 2 - 2 * a * b * math.cos(theta)

print(c ** 0.5)
import math
a, b, h, m = map(int, input().split())

arad = (360 / 12) * h
brad = (360 / 60) * m
rad1 = abs(arad - brad)
if rad1 > 180:
    rad1 = 360 - rad1

cos = math.cos(math.radians(rad1))

ans = a**2 + b**2 - 2*a*b*cos

print(ans**0.5)
import math

A, B, H, M = map(int, input().split())
h = H * 30 + M / 2
m = M * 6
sita = min(abs(h - m), 360 - abs(h - m))
print(sita)
print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(sita))))
import math
a, b, h, m = map(int, input().split())
l = h
r = m / 5
y = abs(l - r)
if y > 6:
    y = 12 - y
x = m/60*30
print(math.sqrt(a**2 + b**2 - 2*a*b*(math.cos(math.radians(y * (30 + x))))))
# L = 360 / 12 = 30度 1時間
# L = 30 / 60 = 1/2度 1分
# S = 360 / 60 = 6度 1分

# L = 360 / H/M
# S = 360/M

import math
A, B, H, M = map(int, input().split())

L = (60 * H + M) / 2
S = (M * 6) % 360
dig = (max(L, S) - min(L, S)) % 180

if dig == 0 and L != S:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(math.radians(dig))))
import math
A,B,H,M=map(int,input().split())
if abs(H*30-M*6)>=180:
    c=360-abs(H*30-M*6)
else:
    c=abs(H*30-M*6)
b=math.radians(c)
a=math.sqrt(A**2+B**2-2*A*B*math.cos(b))
print(a)
import math

a, b, h, m = map(int, input().split())

c = (h/6 - m/360)*math.pi
x = math.sqrt(a * a + b * b - 2 * a * b * math.cos(c))
print(x)

#double c = (h/6 - m/360)*pi;
#x = sqrt(a * a + b * b - 2 * a * b * cos(c));
#cout << fixed << setprecision(15) << x << endl;
a,b,h,m = map(int,input().split())
import math
alp = 0.5*(h*60+m)
be = 6*m
if -180 <= alp-be <= 180: 
    l = (a**2+b**2 - 2*a*b*math.cos((alp - be)/180*math.pi))**(1/2)
    print(l)
else:
    l = (a**2+b**2 + 2*a*b*math.cos((alp - be)/180*math.pi))**(1/2)
    print(l)
import math
a, b, h, m = map(int, input().split())
b_arg = math.radians(60 * m)
b_pos = [b * math.cos(b_arg), b * math.sin(b_arg)]
a_arg = math.radians(h * 30 + m / 2)
a_pos = [a * math.cos(a_arg), a * math.sin(a_arg)]
x_marge = (a_pos[0] - b_pos[0])**2
y_marge = (a_pos[1] - b_pos[1])**2
dis = (x_marge + y_marge)**(1/2)
print(dis)
a, b, h, m = map(int, input().split())

import math
angle = abs((h * 5 - m) * 6)
if angle <= 180:
  c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(angle)))
  print(c)
else:
  c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(360 - angle)))
  print(c)
import math

A,B,H,M = map(int, input().split())
##Aは短針の長さ、Bは長針の長さ
##ARは短針の進んだ針の角度、BRは長針の進んだ針の角度
AR = 360*(H/12+M/60/12)
BR = 360*M/60

if abs(AR-BR)<180:
  X = abs(AR-BR)
elif abs(AR-BR)>180:
  X = float( 360-abs(AR-BR) )
else :
  X = 0

C = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(X)))


print(C)
import math
A, B, H, M = map(int, input().split())

a = H / 6 * math.pi
ax = math.cos(a) * A
ay = math.sin(a) * A

b = M / 30 * math.pi
bx = math.cos(b) * B 
by = math.sin(b) * B

print(math.sqrt((ax - bx)**2 + (ax - bx)**2))
import math
A,B,H,M = map(int,input().split())

a=[A*math.cos(math.radians((H+M/60)*360/12)),A*math.sin(math.radians((H+M/60)*360/12))]
b=[B*math.cos(math.radians(M*60)),B*math.sin(math.radians(M*360/60))]
print(a,b)
dir = ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
print(dir)
import math

A, B, H, M = list(map(int, input().split()))

theta = abs(60 * M - (60 * H + M) / 2)
if theta > 180:
    theta = 360 - theta
theta = math.radians(theta)

ans = A ** 2 + B ** 2 - 2 * A * B * math.cos(theta)
ans = math.sqrt(ans)
print(ans)
import math

a,b,h,m = map(int,input().split())

hangle = float((h/12)*360)
hangle += float((m/60)*30)
mangle = float((m/60)*360)

if hangle > 180 and mangle > 180:
    angle = abs(hangle-mangle)
elif hangle > 180:
    hangle = 360 - hangle
    angle = abs(hangle-mangle)
elif mangle > 180:
    mangle = 360 - mangle
    angle = abs(hangle-mangle)
else:
    angle = abs(hangle-mangle)

rad = math.radians(angle)

ans = float(math.sqrt(a*a + b*b - float(2*a*b*math.cos(rad))))
print(angle)
print('{:.10f}'.format(ans))
from math import *;
a, b, h, m = list(map(int, input().split()))
angle = abs(pi * 2 * h / 12 - pi * 2 * m / 60)
if angle >= pi:
    angle = 2 * pi - angle
ans = a * a + b * b - 2 * a * b * abs(cos(angle))
print(sqrt(abs(ans)))
import math

a, b, c, d = map(int, input().split())

c_deg = c * 30 + 30 * (d / 60)
d_deg = d * 6
deg = 0
if abs(c_deg - d_deg) < 180:
  deg = abs(c_deg - d_deg)
elif abs(d_deg - c_deg) < 180:
  deg = abs(d_deg - c_deg)
else:
  deg = 360 - max(c_deg, d_deg)
  
ans = a**2 + b**2 - (2 * a * b * math.cos(math.radians(deg)))

print(math.sqrt(ans))
import os
import math

def main():
    a,b,h,m = map(int, input().split())
    rand2 = 6 * m
    rand3 = (0.5 * m) + (30 * h)
    rand_result = 0.0

    if (abs(rand3 - rand2) < 180):
        rand_result = abs(rand3 - rand2)
    else:
        rand_result = abs(rand3 - rand2) - 180

    
    ans = math.sqrt(pow(a,2) + pow(b,2) - (2*a*b*math.cos(math.radians(rand_result))))
    print(format(ans,'.10f'))

if __name__ == "__main__":
    main()
a, b, h, m = map(int,input().split())
angle = 30*h + 5.5*m

import math
ans = (a*a + b*b - 2*a*b*math.cos(math.radians(angle)))**0.5
print(ans)
import math
a,b,h,m=map(int,input().split())
l=360/60*m
s=360/12*(h+m/60)
ans=(a**2+b**2-2*a*b*(math.cos(abs(l-s)%180*(math.pi)/180)))**(1/2)
print(ans)
import numpy as np

A, B, H, M = map(int, input().split())

w_h = 360/12*H + 30/60*M #時針の角度(angle)
w_m = 360/60*M #分針の角度(angle)

dif_angle = abs(w_h-w_m)
if dif_angle >= 180:
    dif_angle -= 180

rad = dif_angle/180*np.pi
C_2 = (A**2) + (B**2) - 2*A*B*np.cos(rad)
ans = np.sqrt(C_2)

print(ans)
import math
chou, tan, ji, hun = map(int,input().split())

kakudo = abs(((ji*30 + hun*.5) - (hun*6)))

if kakudo > 180:
    kakudo = 360 - kakudo

kakudo = abs(math.cos((math.radians(kakudo))))
ans =( chou**2 + tan**2 - 2*chou*tan*kakudo)**.5
print(ans)
import math

PI = math.pi

a, b, h, m = map(int, input().split())

rad = 2 * PI * (h / 12.0 + m / 60.0 / 12.0 - m / 60.0)

ans = math.sqrt(a * a + b * b - a * b * math.cos(rad))

print(ans)
def C():
    a,b,h,m = list(map(int, input().split()))
    import math
    a_d = 360*h/12
    b_d = 360*m/60
    d = min(abs(b_d-a_d), 360-b_d+a_d, 360-a_d+b_d)
    if d == 0:
        print(0)
    elif d == 180:
        print(a+b)
    else:
        r = math.radians(d)
        print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(r)))
C()
import math
a,b,h,m = map(int , input().split())
long_needle =(5 * m)/60.0 + h * 5.0  
sort_needle = m
ans = math.sqrt(a**2 + b **2 - 2*a*b*abs(math.cos(abs(long_needle-sort_needle)*(math.pi/30))))
print(ans)
import math

a, b, h, m = [int(i) for i in input().split()]

hangle = (h/6)*math.pi
mangle = (m/30)*math.pi

diff = abs(hangle - mangle)

dist_sq = a**2 + b**2 + 2*a*b*math.cos(diff)

print(math.sqrt(dist_sq))
import math
def yo(a,b,th):
    thr = math.radians(th)
    cosa = math.cos(thr)
    tmp = a**2 + b**2 - 2*b*a*cosa
    re = math.sqrt(tmp)
    return re
A,B,h,m = map(int, input().split())
longdig = m * 6
shortdig = h * 30
theta = abs(longdig - shortdig)
print(yo(A,B,theta))
a,b,h,m = map(int,input().split())
import math
alp = 0.5*(h*60+m)/180*math.pi
be = 6*m/180*math.pi
if abs(alp-be) < math.pi:
    s = abs(alp-be)
else:
    s = math.pi - abs(alp-be)
l = (a**2+b**2 - 2*a*b*math.cos(s))**(1/2)
print(l)
import math
import sys
a, b, h, m = map(int,sys.stdin.readline().rstrip().split())
deg = min(abs(30*h - 5.5*m),360-abs(30*h - 6*m))
rad=math.radians(deg)
c = math.sqrt(a**2 + b**2 -2*a*b*math.cos(rad))
print(f'{c:.9f}')
A, B, H, M = map(int, input().split())

import math

s = 30*(H+M/60)
t = 6*M

r = abs(s-t)

if r>180:
  r = 360-r

print(r)

a = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(r)))

print(a)
import math
a,b,h,m = map(int,input().split())

dh=math.radians(h*30)
dm=math.radians(m*6)

t=abs(dh-dm)
if t>180: t=360-t
cc = a**2 + b**2 -2*a*b*(math.cos(t))
print(cc**.5)
import math
a, b, H, M = map(int, input().rstrip().split())
H = H*5 + (float(M)/60*5)
# H = H*5
kakudo = abs(H-M)
kakudo = kakudo % 30
kakudo *= 6
print(math.sqrt(float(a*a) + float(b*b) - 2*a*b*math.cos(math.radians(kakudo))))
from math import sin, radians, cos, sqrt
lst = [int(i) for i in input().split()]
A, B, H, M = tuple(lst)
angle = M * 6 - (H * 30 + M * 0.5)
if abs(angle) > 180:
  angle = 360 - abs(angle)
  area = A * B * sin(radians(angle)) / 2
  co = sqrt(1 - sin(radians(angle)) ** 2)
  X = sqrt(A**2 + B**2 - 2*A*B*co)
  print(X)
elif abs(angle) == 180 or abs(angle) == 0:
  X = A + B
  print(X)
else:
  angle = abs(angle)
  area = A * B * sin(radians(angle)) / 2
  co = sqrt(1 - sin(radians(angle)) ** 2)
  X = sqrt(A**2 + B**2 - 2*A*B*co)
  print(X)
import math
A, B, H, M = [int(i) for i in input().split()]
C = abs(30*H + 0.5*M - 6*M)
if C > 180:
    C -= 180
c2 = A*A + B*B - 2*A*B*(math.cos((C/180)*math.pi))
c2 = math.sqrt(c2)
print(f'{c2:.{12}f}')
n=str(input())
n=n[-1]
if n=="2" or n=="4" or n=="5" or n=="7" or n=="9":
    print("hon")
    exit()
if n=="0" or n=="1" or n=="6" or n=="8":
    print("pon")
    exit()
if n=="3":
    print("bon")
    exit()
import math

a,b,h,m = map(int,input().split())

def clock_to_minutes(h, m):
  minutes = m
  minutes += h*60
  return minutes

angular_speed_A = 360/12/60
angular_speed_B = 6

angle = abs((angular_speed_A - angular_speed_B)*clock_to_minutes(h,m)%360)

ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(angle))

print(ans)
import numpy as np

a, b, h, m = map(int, input().split())

print((360 - (30 * h + m / 2)) + 90)
print((360 - (6 * m)) + 90)
ar = np.radians((360 - (30 * h + m / 2)) + 90)
br = np.radians((360 - (6 * m)) + 90)

xa = a * np.cos(ar)
ya = a * np.sin(ar)

xb = b * np.cos(br)
yb = b * np.sin(br)

al = np.array([xa, ya])
bl = np.array([xb, yb])
u = bl - al
print(np.linalg.norm(u))
import math

def resolve():
    a,b,h,m = map(int, input().split())
    a_deg = h*30 + m*0.5
    b_deg = m*6
    angle = abs(a_deg - b_deg)
    if angle == 180:
        print(a+b)
    elif angle > 180:
        angle = 360 - angle
    rad = math.radians(angle)
    sq_c = a*a + b*b - 2*a*b*math.cos(rad)
    print(math.sqrt(sq_c))

resolve()
A,B,H,M=map(int,input().split())
import math

HH=H*30
MM=M*6

ans=A*A+B*B-2*A*B*math.cos(math.radians(MM-HH))
print(ans**0.5)
from math import degrees, cos,sqrt ,radians

A, B, H, M = map(int, input().split())

if H == 6 and M == 0:
    print(A+B)
    exit()


kaku = abs((6*M-(0.5*M+H*30)))%180
# if kaku > 90:
#     kaku -= 90
# print(kaku)
# print(cos(radians(kaku)))
print(sqrt(A**2 + B**2 -2*A*B*abs(cos(radians(kaku)))))

# print(-A*B*cos(kaku))
import math
a,b,h,m=map(int,input().split())
x=m*6
y=(h*30)+(m*0.5)
result=a**2+b**2-2*a*b*math.cos(abs(x-y))
print(math.sqrt(result))
import math

def abs(x):
  return x if x >= 0 else x < 0 -x

a,b,h,m = (int(x) for x in input().split())

x = 30 * (h + m/60)
y = 6 * m

ang = abs(x - y)

if(ang > 180):
  ang = 360 - ang
  
print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(ang))))
import numpy as np
A, B, H, M = map(np.float32, input().split())

R = H/12 + M*0.5/360
print(R)
r = M/60
print(r)
Rad_c = np.cos((R-r)*2*np.pi)

C = np.sqrt(A*A + B*B -2*A*B*Rad_c)
print(C)
from math import cos, sqrt, radians
A, B, H, M = map(int, input().split())
long_deg = M*6
short_deg = H*30 + M*0.5
print(sqrt(A**2+B**2-2*A*B*cos(radians(abs(long_deg-short_deg)%180))))
s=input()
t=input()
if len(t)-len(s)==1 and s==t[:len(s)]:
    print("Yes")
else:
    print("No")
s = input()
t = input()


if len(s) > 10:
    print("No")
    exit()

if s != t[:-1] :
    print("No")
    exit()

alp = list('abcdefghijklmnopqrstuvwxyz')
for i in t:
    if i not in alp:
        print("No")
        exit()

print("Yes")
S = input()
T = input()

if S == T[:-1]:
    print('Yes')
else:
    print('No')
import sys, random
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def main():
    inf = 10 ** 20

#    t = int(input())
    # t, a, b = map(int, input().split())
    t = 1
    
    
    for _ in range(1, t+1):
        # print("Case #{}: ".format(_), end = '')
        
        a, b = [input().strip() for i in range(2)]
        
        if(a == b[:len(a)]):
            print("Yes")
        else:
            print("No")
        
        
main()
s = input()
t = input()
if len(t) == len(s) +1 and s[:] == t[:-1]:
  print("Yes")
else:
  print("No")
base_name=input()
new_name=input()

if new_name[:-1]==base_name:
    print("Yes")
else:
    print("No")
S = input().strip()
T = input().strip()

if S == T[:-1] and len(T) - 1 == len(S):
  print("Yes")
else:
  print("No")
s= input()
t=input()

if t[:-1]==s:
  print('Yes')
else:
  print('No')
s = input()
t = input()

if s == t[:-1]:
  print('Yes')
else:
  print('No')
s1=str(input())
s2=str(input())
if (len(s2)-len(s1)!=1):
  print('No')
Flag='Yes'
for val in range(len(s1)):
  if(s1[val]!=s2[val]):
    Flag='No'
print(Flag)
def t1():
    s=input()
    t=input()
    if s==t[0:len(t)-1]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    t1()
s = input()
t = input()

if s == t[:-1]:
    print("Yes")
else:
    print("No")
s = input(); t= input()
if(s == t[0:-1] and len(s)+1==len(t)):
  print("Yes")
else:
  print("No")
#!/usr/bin/env python3

s = str(input())
t = str(input())

if s == t[:-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if t[:len(t)-1] == s:
  print("Yes")
else:
  print("No")
N = input()
A = input()

if len(N) == len(A)-1:
  if N == A[:-1]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
S = input()
T = input()
print('Yes' if S == T[:-1] else 'No')
s = input()
t = input()
if s == t[:-1]:
  print("Yes")
else:
  print("No")
s = input()
t = input()
print('Yes' if len(s) + 1 == len(t) and s == t[:-1] else 'No')
t=input(" ")
k=input(" ")
temp=0
for i in range(len(t)):
    if(t[i]!=k[i]):
        temp=1
        break
if(temp):
    print("No")
else:
    print("Yes")
s=input()
t=input()
if s==t[:-1]:
  print("Yes")
else:
  print("No")
s = input()
t = input()

n = len(t)
if s == t[:n-1]:
    print('Yes')
else:
    print('No')
S = input()
T = input()

ans = "No"

if (len(S) == len(T) - 1) & (S == T[:-1]):
    ans = "Yes"

print(ans)
s = input()
t = input()
print(['No','Yes'][s == t[:-1]])
S = input()
T = input()
l = len(T)
if(S == T[0:l-1]):
  print("Yes")
else:
  print("No")
s = input()
t = input()

if s == t[:-1]:
    print('Yes')
else:
    print('No')
s = input()
t = input()
print('Yes' if s == t[:-1] else 'No')
s = input()
t = input()
print ("Yes") if s == t[0:len(s)] else print ("No")
s = input()
t = input()
ans = "No"
for x,y in zip(s,t):
    if x != y: break
else:
    ans = "Yes"
print(ans)
#!/usr/bin/env python3


def main():
    S = input()
    T = input()
    if S == T[:-1:]:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()
import sys
input = sys.stdin.readline
def main():
    S = input().rstrip("\r\n")
    T = input().rstrip("\r\n")
    if S == T[:-1] and len(S) + 1 == len(T):
        print("Yes")
    else:
        print("No")
if __name__ == "__main__":
    main()
s=input()
t=input()
sum=0
for i in range(len(s)):
  if s[i]==t[i]: 
    sum+=1
  
if sum==len(s):
  print('Yes')
else :
  print('No')
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    t=input()
    if t[:-1]==s:
        print('Yes')
    else:
        print('No')
resolve()
s = input()
t = input()
if s == t[:len(t)-1]:
    print("Yes")
else:
    print("No")
s=input()
t=input()
r=1
for i in range(len(s)):
  if s[i]!=t[i]:
    r=0
if r==0:
  print('No')
else:
  print('Yes')
s=input()
t=input()
print('Yes' if s==t[:-1] else 'No')
#atcoder template
def main():
    #import sys
    #imput = sys.stdin.readline
    #ここにコード
    #input
    S = str(input())
    T = str(input())

    #output
    end_word = T[-1]
    if S + end_word == T:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
s = input()
t = input()
if len(s)+1 == len(t) and s == t[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()
print("Yes" if S == T[:-1] else "No")
s = input()
t = input()
if t[:-1] == s:
    print("Yes")
else:
	print("No")
S = input()
T = input()
if T[0:len(S)] == S:
  print("Yes")
else:
  print("No")
S = input()
T = input()

print('Yes' if T.startswith(S) else 'No')
S = input()
T = input()

#TT = T[:len(S)]

if S == T[:len(S)]:
    print("Yes")
else:
    print("No")
s = input()
t=input()
if t[:-1] == s:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if S == T[:-1]:
  print('Yes')
else:
  print('No')
a=input()
b=input()
if a==b[:-1]:
  print('Yes')
else:
  print('No')
s = input()
t = input()
for i in range(len(s)):
    if s[i] != t[i]:
        print("No")
        exit()
print("Yes")
S=input()
T=input()


if len(S)+1==len(T):
    for i in range(len(S)): #回数の時は絶対range()
        if S[i]==T[i]:
            a='ok'
            continue
        else:
            a='no'
            break
else:
    print('no')

if a=='ok':
    print('Yes')
else:
    print('No')
S = input()
T = input()

judge = [False]*len(S)

if len(T) == len(S) + 1:
    for i in range(len(S)):
        judge[i] = S[i] == T[i]

if sum(judge) == len(S):
    print('Yes')
else:
    print('No')
#!/usr/bin/env python3

S = input()
T = input()
if S == T[:-1]:
    print("Yes")
else:
    print("No")
mae=str(input())
ato=str(input())
mcb=len(mae)
mca=len(ato)
if ato==mae+ato[mca-1]:
    print("Yes")

else:
    print("No")