buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> #include <cmath> #include <iomanip> using namespace std; int main() { int A, B, H, M; double d, C; cin >> A >> B >> H >> M; d = (30 * H + M / 2) - (6 * M); d *= 3.1415926535897932 / 180; C = sqrt(A * A + B * B - 2 * A * B * cos(d)); cout << fixed << setprecision(10) << C << endl;...
#include <bits/stdc++.h> #include <cmath> #include <iomanip> using namespace std; int main() { double A, B, H, M; double d, C; cin >> A >> B >> H >> M; d = (30 * H + M / 2) - (6 * M); d *= 3.1415926535897932 / 180; C = sqrt(A * A + B * B - 2 * A * B * cos(d)); cout << fixed << setprecision(15) << C << en...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
101
import numpy as np A,B,H,M = (int(x) for x in input().split()) argA = 30*H + 0.5*M argB = 6*M if argA>argB: arg = argA-argB else: arg = argB-argA if arg > 180: arg -= 180 cc = A**2 + B**2 -2*A*B*np.cos((arg/180)*np.pi) c = np.sqrt(cc) print(c)
import numpy as np A,B,H,M = (int(x) for x in input().split()) argA = 30*H + 0.5*M argB = 6*M if argA>argB: arg = argA-argB else: arg = argB-argA if arg > 180: arg = 360 - arg cc = A**2 + B**2 -2*A*B*np.cos((arg/180)*np.pi) c = np.sqrt(cc) print(c)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
109
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; long double deg2rad(long double degree) { return degree * M_PI / 180.0; } int main() { int a, b, h, m; cin >> a >> b >> h >> m; long double ans; long double rl = m * ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; long double deg2rad(long double degree) { return degree * M_PI / 180.0; } int main() { int a, b, h, m; cin >> a >> b >> h >> m; long double ans; long double rl = m * ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
178
a,b,h,m = gets.chomp.split(/ /).map {|i| i.to_i} hrad = (h*30.0+m/2)*Math::PI/180.0 mrad = m*6.0*Math::PI/180.0 hx = Math.sin(hrad)*a hy = Math.cos(hrad)*a mx = Math.sin(mrad)*b my = Math.cos(mrad)*b d = Math.sqrt(((hx-mx)**2) + ((hy-my)**2)) puts d
a,b,h,m = gets.chomp.split(/ /).map {|i| i.to_i} hrad = (h*30.0+m/2.0)*Math::PI/180.0 mrad = m*6.0*Math::PI/180.0 hx = Math.sin(hrad)*a hy = Math.cos(hrad)*a mx = Math.sin(mrad)*b my = Math.cos(mrad)*b d = Math.sqrt(((hx-mx)**2) + ((hy-my)**2)) puts d
[["-", 31, 738, 31, 739, 0, 738, 12, 738, 12, 612], ["+", 31, 738, 31, 739, 0, 738, 12, 738, 12, 531]]
4
124
import sys import math A, B, H, M = map(int, input().split()) mnt = 60 * H + M arg_A = (mnt % 720) * 0.5 arg_B = (mnt % 60) * 6 #print(arg_A, arg_B) if arg_A == arg_B: print(B-A) sys.exit() elif abs(arg_A-arg_B) == 180: print(A+B) sys.exit() big = max(arg_A, arg_B) small = min(arg_A, arg_B) w = big - small...
import sys import math A, B, H, M = map(int, input().split()) mnt = 60 * H + M arg_A = (mnt % 720) * 0.5 arg_B = (mnt % 60) * 6 #print(arg_A, arg_B) if arg_A == arg_B: print(abs(B-A)) sys.exit() elif abs(arg_A-arg_B) == 180: print(A+B) sys.exit() big = max(arg_A, arg_B) small = min(arg_A, arg_B) w = big - ...
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
153
import math A, B, H, M = map(int, input().split()) theta_A = math.pi / 6 * H theta_B = math.pi / 30 * M theta = abs(theta_A - theta_B) if theta > math.pi: theta = 2 * math.pi - theta L = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(theta)) print(L)
import math A, B, H, M = map(int, input().split()) theta_A = math.pi / 6 * (H + M / 60) theta_B = math.pi / 30 * M theta = abs(theta_A - theta_B) if theta > math.pi: theta = 2 * math.pi - theta L = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(theta)) print(L)
[["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 12, 657, 12, 23, 0, 657, 12, 657, 31, 22], ["+", 12, 657, 12, 23, 0, 657, 12, 657, 17, 85], ["+", 12, 657, 12, 23, 0, 657, 12, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
95
#include <math.h> #include <stdio.h> int main(void) { int A, B, H, M; long double c, Ha, Ma, answer, t; scanf("%d", &A); scanf("%d", &B); scanf("%d", &H); scanf("%d", &M); Ma = (double)M * 360 / 60; Ha = (double)H * 360 / 12 + Ma / 12; if (Ha > Ma) c = (double)(Ha - Ma) * 3.14159265359 / 180; e...
#include <math.h> #include <stdio.h> int main(void) { int A, B, H, M; double c, Ha, Ma, answer, t; scanf("%d", &A); scanf("%d", &B); scanf("%d", &H); scanf("%d", &M); Ma = (double)M * 360 / 60; Ha = (double)H * 360 / 12 + Ma / 12; if (Ha > Ma) c = (double)(Ha - Ma) * 3.14159265359 / 180; else ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
178
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; const long long INF = 1LL << 60; typedef pair<ll, bool> Pair; int main() { double A, B, H, M; doub...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; const long long INF = 1LL << 60; typedef pair<ll, bool> Pair; int main() { double A, B, H, M; doub...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
217
#include "cmath" #include <bits/stdc++.h> #define ll long long int #define ull unsigned long long #define mod 1000000007; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, h, m; cin >> a >> b >> h >> m; ll hour = 30 * h + (m / (60.0)) * 30; double ang = abs(6 * m - ...
#include "cmath" #include <bits/stdc++.h> #define ll long long int #define ull unsigned long long #define mod 1000000007; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, h, m; cin >> a >> b >> h >> m; double hour = 30 * h + (m / (60.0)) * 30; double ang = abs(6 * ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
142
import math import sys def calc_clock_angle(h, m): m_angle = (360 / 60) * m h_angle = (360 / 12) * h + ((360 / 12) / 60 ) * m angle = abs(m_angle - h_angle) if angle > 180: return angle - 180 else: return angle pass a, b, h, m = map(int, input().split()) if h == 12 and m == 0: ...
import math import sys def calc_clock_angle(h, m): m_angle = (360 / 60) * m h_angle = (360 / 12) * h + ((360 / 12) / 60 ) * m angle = abs(m_angle - h_angle) if angle > 180: return 360 - angle else: return angle pass a, b, h, m = map(int, input().split()) if h == 12 and m == 0: ...
[["-", 0, 57, 64, 196, 0, 37, 0, 657, 31, 22], ["+", 0, 57, 64, 196, 0, 37, 0, 657, 31, 612], ["-", 0, 57, 64, 196, 0, 37, 0, 657, 12, 612], ["+", 0, 57, 64, 196, 0, 37, 0, 657, 12, 22]]
5
153
// Author: pankaj_m05 // Problem: C // Created: 17.05.2020 17:39:13 #include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define f_in(file) freopen(file, "r", stdin) #d...
// Author: pankaj_m05 // Problem: C // Created: 17.05.2020 17:39:13 #include <bits/stdc++.h> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define f_in(file) freopen(file, "r", stdin) #d...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13]]
1
246
#include <bits/stdc++.h> using namespace std; int main() { int A, B, H, M; cin >> A >> B >> H >> M; double pi = 3.141592653589793; double Arad = -pi / 30 * M; int x = H * 60 + M; double Hrad = -(pi / 360 * x); double a = pow((B * cos(Arad) - A * cos(Hrad)), 2); double b = pow((B * sin(Arad) - A * sin(H...
#include <bits/stdc++.h> using namespace std; int main() { int A, B, H, M; cin >> A >> B >> H >> M; double pi = 3.141592653589793; double Arad = -pi / 30 * M; int x = H * 60 + M; double Hrad = -(pi / 360 * x); double a = pow((B * cos(Arad) - A * cos(Hrad)), 2); double b = pow((B * sin(Arad) - A * sin(H...
[["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
133
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979 int main() { int a, b, h, m; scanf("%d%d%d%d", &a, &b, &h, &m); double deg = abs(0.5 * (60 * h - 11 * m)) * PI / 180.0; double dist = pow(a * a + b * b - 2 * (double)a * (double)b * cos(deg), 0.5); printf("%f", dist); return 0; }
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846264338327950288 int main() { int a, b, h, m; scanf("%d%d%d%d", &a, &b, &h, &m); double deg = abs(0.5 * (60 * h - 11 * m)) * PI / 180.0; double dist = pow(a * a + b * b - 2 * (double)a * (double)b * cos(deg), 0.5); printf("%.15f",...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
110
import math a, b, h, m = map(int, input().split()) t_a = 0.5*(h*60+m) t_b = 6*m t = (t_a - t_b) if t > 180: t -= 180 c = math.cos(t*2*math.pi/360.0) print(math.sqrt(a ** 2 + b ** 2 - 2 * a * b * c), end="")
import math a, b, h, m = map(int, input().split()) t_a = 0.5*(h*60+m) t_b = 6*m t = (t_a - t_b) if t > 180: t = 360 - t c = math.cos(t*2*math.pi/360.0) print(math.sqrt(a ** 2 + b ** 2 - 2 * a * b * c), end="")
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
97
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int a, b; int h, m; const double PI = 3.1415926535897932384626; int main() { scanf("%d%d%d%d", &a,...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int a, b; int h, m; const double PI = 3.1415926535897932384626; int main() { scanf("%d%d%d%d", &a,...
[["-", 0, 11, 12, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 16, 12, 16, 31, 16, 12, 13]]
1
217
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; // intじゃ扱えないことに注意! #define mod 1000000007 #define rep(i, n) \ for (int i = 0; i < (int)(n); i++) //範囲外参照とループの初期化に注意! const double pi = 3.14159265359; int m...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const long long INF = 1LL << 60; // intじゃ扱えないことに注意! #define mod 1000000007 #define rep(i, n) \ for (int i = 0; i < (int)(n); i++) //範囲外参照とループの初期化に注意! const double pi = 3.14159265359; int m...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
151
import math a, b, h, m = map(int, input().split()) # 分針の角度 perm = (m / 60) * 360 # 時針の角度 rh = (h / 12) * 360 + (m / 60) * 12 / 360 # print((perm) * 12 / 360) # print(rh, perm) deg = min(abs(perm - rh), 360 - abs(perm - rh)) # print(deg) rdeg = math.pi / 180 * deg # print(rdeg) ans = math.sqrt(a * a + b * b - 2 * a ...
import math a, b, h, m = map(int, input().split()) # 分針の角度 perm = (m / 60) * 360 # 時針の角度 rh = (h / 12) * 360 + (m / 60) * 360 / 12 # print(rh, perm) deg = min(abs(perm - rh), 360 - abs(perm - rh)) # print(deg) rdeg = math.pi / 180 * deg # print(rdeg) ans = math.sqrt(a * a + b * b - 2 * a * b * math.cos(rdeg)) pri...
[["-", 0, 662, 12, 657, 12, 657, 31, 657, 12, 612], ["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 612]]
5
116
import sys, math, itertools, collections, bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') inf = float('inf') ;mod = 10**9+7 mans = inf ;ans = 0 ;count = 0 ;pro = 1 n,m,a,b = map(int,input().split()) ab = a * 60 + b A = ab/2 B = b*60 AB = abs(-B+A) theta = min(360-AB,AB) # print(theta,math....
import sys, math, itertools, collections, bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') inf = float('inf') ;mod = 10**9+7 mans = inf ;ans = 0 ;count = 0 ;pro = 1 n,m,a,b = map(int,input().split()) ab = a * 60 + b A = ab/2 B = b*6 AB = abs(-B+A) theta = min(360-AB,AB) # print(theta,math.r...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
158
import math A, B, H, M = map(int, input().split()) m = M * 60 h = H * 30 + M / 2 ms = B * math.sin(math.radians(m)) mc = B * math.cos(math.radians(m)) hs = A * math.sin(math.radians(h)) hc = A * math.cos(math.radians(h)) ans = ((ms - hs) ** 2 + (mc - hc) ** 2) ** 0.5 print(ans)
import math A, B, H, M = map(int, input().split()) m = M * 6 h = H * 30 + M / 2 ms = B * math.sin(math.radians(m)) mc = B * math.cos(math.radians(m)) hs = A * math.sin(math.radians(h)) hc = A * math.cos(math.radians(h)) ans = ((ms - hs) ** 2 + (mc - hc) ** 2) ** 0.5 print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
121
#include <bits/stdc++.h> using namespace std; typedef unsigned uint; typedef long long INT; typedef unsigned long long UINT; const int INF = 1001001001; const INT INFLL = 1001001001001001001LL; int in() { int x; scanf("%d", &x); return x; } double fin() { double x; scanf("%lf", &x); return x; } INT lin() ...
#include <bits/stdc++.h> using namespace std; typedef unsigned uint; typedef long long INT; typedef unsigned long long UINT; const int INF = 1001001001; const INT INFLL = 1001001001001001001LL; int in() { int x; scanf("%d", &x); return x; } double fin() { double x; scanf("%lf", &x); return x; } INT lin() ...
[["-", 3, 4, 0, 16, 12, 16, 12, 2, 63, 22], ["-", 0, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
279
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ff first #define ss second #define file_se_input \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define pp long ...
#include <bits/stdc++.h> using namespace std; #define vi vector<int> #define ff first #define ss second #define file_se_input \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define pp long ...
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
559
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int h, m; double ja, jb; double jiao; double a, b, c; cin >> a >> b >> h >> m; ja = h * 30 + 30 * (m / 60.0); jb = 360 * (m / 60.0); // cout<<ja<<jb<<endl; jiao = fabs(ja - jb); if (jiao > 180) jiao = 360...
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int h, m; double ja, jb; double jiao; double a, b, c; cin >> a >> b >> h >> m; ja = h * 30 + 30 * (m / 60.0); jb = 360 * (m / 60.0); // cout<<ja<<jb<<endl; jiao = fabs(ja - jb); if (jiao > 180) jiao = 360...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
134
import math a, b, h, m = map(int, input().split()) l = m * 6 s = m * 0.5 + h * 30 th = abs(l - s) print(th) if th == 0: print('{:.20f}'.format(abs(a - b))) exit() elif th == 180: print('{:.20f}'.format(a + b)) exit() if th >= 180: th = 360 - th cos = math.cos(math.radians(th)) ans = a**2 + b**2 - 2...
import math a, b, h, m = map(int, input().split()) l = m * 6 s = m * 0.5 + h * 30 th = abs(l - s) if th == 0: print('{:.20f}'.format(abs(a - b))) exit() elif th == 180: print('{:.20f}'.format(a + b)) exit() if th >= 180: th = 360 - th cos = math.cos(math.radians(th)) ans = a**2 + b**2 - 2 * a * b *...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
149
#C import math a, b, h, m = map(int, input().split()) def yo(a, b, c): #辺a,b 角c # print(pow(a, 2), pow(b, 2), 2 * a * b * math.cos(c)) tmp = pow(a, 2) + pow(b, 2) - 2 * a * b * math.cos(c) return pow(tmp, 0.5) ss = (h / 12 + m / 120) * 2 * math.pi ls = m / 60 * 2 * math.pi # print(ss, ls, min(abs(ls - ...
#C import math a, b, h, m = map(int, input().split()) def yo(a, b, c): #辺a,b 角c # print(pow(a, 2), pow(b, 2), 2 * a * b * math.cos(c)) tmp = pow(a, 2) + pow(b, 2) - 2 * a * b * math.cos(c) return pow(tmp, 0.5) ss = (h / 12 + m / 720) * 2 * math.pi ls = m / 60 * 2 * math.pi # print(ss, ls, min(abs(ls - ...
[["-", 31, 657, 31, 23, 0, 657, 12, 657, 12, 612], ["+", 31, 657, 31, 23, 0, 657, 12, 657, 12, 612]]
5
134
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define mod 1000000007 #define pi 3.141592653589793 typedef vector<ll> vcl; ll gcd(ll a, ll b) { if (b > a) swap(a, b); if (b == 0) return a; return gcd(b, a % b)...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define mod 1000000007 #define pi 3.141592653589793 typedef vector<ll> vcl; ll gcd(ll a, ll b) { if (b > a) swap(a, b); if (b == 0) return a; return gcd(b, a % b)...
[["-", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]]
1
328
import math a, b, h, m = map(int, input().split()) p1 = 30 * h + m // 2 p2 = 6 * m s = min(abs(p1 - p2), abs(abs(p1 - p2) - 360)) ans = pow(a * math.sin(math.radians(s)), 2) + pow((b - a * math.cos(math.radians(s))), 2) print((ans) ** (1 / 2))
import math a, b, h, m = map(int, input().split()) p1 = 30 * h + m / 2 p2 = 6 * m s = min(abs(p1 - p2), abs(abs(p1 - p2) - 360)) ans = pow(a * math.sin(math.radians(s)), 2) + pow((b - a * math.cos(math.radians(s))), 2) print((ans) ** (1 / 2))
[["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85]]
5
114
#include <cmath> #include <cstdio> int A, B, H, M; const double pi = 3.141592653589793; int main() { scanf("%d%d%d%d", &A, &B, &H, &M); double Mx, My; double Mangle = 2.0 * pi * (double)M / (double)60; Mx = B * sin(Mangle), My = B * cos(Mangle); double Hangle = 2.0 * pi * (double)(M + 60 * H) / (double)720...
#include <cmath> #include <cstdio> int A, B, H, M; const double pi = 3.141592653589793; int main() { scanf("%d%d%d%d", &A, &B, &H, &M); double Mx, My; double Mangle = 2.0 * pi * (double)M / (double)60; Mx = B * sin(Mangle), My = B * cos(Mangle); double Hangle = 2.0 * pi * (double)(M + 60 * H) / (double)72...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
173
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265359 int main() { ios::sync_with_stdio(false); cin.tie(0); double a, b, h, m; cin >> a >> b >> h >> m; double u1 = m * 6.0; while (u1 > 360) u1 -= 360; double u2 = h * 30.0; u2 += m * 0.5; while (u2 > 360) u2 -= 360; ...
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265359 int main() { ios::sync_with_stdio(false); cin.tie(0); double a, b, h, m; cin >> a >> b >> h >> m; double u1 = m * 6.0; while (u1 > 360) u1 -= 360; double u2 = h * 30.0; u2 += m * 0.5; while (u2 > 360) u2 -= 360; ...
[["-", 8, 9, 0, 57, 75, 76, 0, 42, 0, 40]]
1
166
import math a, b, h, m = map(float, input().split()) mm = (m % 60.0) * 6.0 hh = h * 30.0 + m * 0.5 print(hh, mm) rad = (mm - hh) * math.pi / 180.0 c = math.sqrt(math.pow(a, 2) + math.pow(b, 2) - 2 * a * b * math.cos(rad)) print(c)
import math a, b, h, m = map(float, input().split()) mm = (m % 60.0) * 6.0 hh = h * 30.0 + m * 0.5 rad = (mm - hh) * math.pi / 180.0 c = math.sqrt(math.pow(a, 2) + math.pow(b, 2) - 2 * a * b * math.cos(rad)) print(c)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
100
import math li = list(map(int,input().split())) A=li[0] B=li[1] H=li[2] M=li[3] long = M/60 * 360 short = H/12 * 360 + M/60 * 30 def f(a,b,angle): c2 = a*a + b*b -2*a*b*math.cos(math.radians(angle)) return math.sqrt(c2) angle = 0 ans = 0 if(short==long): ans = abs(A-B) elif(abs(short-long) == 180): ...
import math li = list(map(int,input().split())) A=li[0] B=li[1] H=li[2] M=li[3] long = M/60 * 360 short = H/12 * 360 + M/60 * 30 def f(a,b,angle): c2 = a*a + b*b -2*a*b*math.cos(math.radians(angle)) return math.sqrt(c2) angle = 0 ans = 0 if(short==long): ans = abs(A-B) elif(abs(short-long) == 180): ...
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612]]
5
181
import math a, b, h, m = map(int,input().split()) ha = 360/12*h+0.5*m ma = 360/60*m s = abs(ha-ma) print(s) if s >180: s=360-s ans = (a**2 + b**2 -2*a*b*math.cos(math.radians(s)))**(1/2) print(ans)
import math a, b, h, m = map(int,input().split()) ha = 360/12*h+0.5*m ma = 360/60*m s = abs(ha-ma) if s >180: s=360-s ans = (a**2 + b**2 -2*a*b*math.cos(math.radians(s)))**(1/2) print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
101
#include <bits/stdc++.h> using namespace std; int main() { double a, b, h, m, min; long double aang, bang, delta, deltacos, ans; cin >> a >> b >> h >> m; min = 60 * h + m; aang = 0.5 * min; bang = 6 * m; if (aang > bang) delta = aang - bang; else delta = bang - aang; deltacos = cos(delta * M_...
#include <bits/stdc++.h> using namespace std; int main() { double a, b, h, m, min; long double aang, bang, delta, deltacos, ans; cin >> a >> b >> h >> m; min = 60 * h + m; aang = 0.5 * min; bang = 6 * m; if (aang > bang) delta = aang - bang; else delta = bang - aang; deltacos = cos(delta * M_...
[["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
125
import math a, b, h, m = map(int, input().split()) lk = 6 * m sk = 30 * h + 0.5 * m theta = max(lk, sk) - min(lk, sk) if theta > 180: theta -= 180 ans = math.sqrt(a*a + b*b - 2 * a * b * math.cos(math.radians(theta))) print(ans)
import math a, b, h, m = map(int, input().split()) lk = 6 * m sk = 30 * h + 0.5 * m theta = max(lk, sk) - min(lk, sk) if theta > 180: theta = 360 - theta ans = math.sqrt(a*a + b*b - 2 * a * b * math.cos(math.radians(theta))) print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
95
# -*- coding: utf-8 -*- import math a, b, h, m = map(int, input().split()) theta_a = math.pi * float(h + m / 60) / float(6) theta_b = math.pi * float(m) / float(30) theta = theta_a - theta_b print(theta) if theta > math.pi or theta < 0: theta = theta_b - theta_a square_l = - float(2) * math.cos(theta) * float(a*...
# -*- coding: utf-8 -*- import math a, b, h, m = map(int, input().split()) theta_a = math.pi * float(h + m / 60) / float(6) theta_b = math.pi * float(m) / float(30) theta = theta_a - theta_b if theta > math.pi or theta < 0: theta = theta_b - theta_a square_l = - float(2) * math.cos(theta) * float(a*b) + a * a + ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
120
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long; const int INF = 1001001001; const ll LLINF = 1001001001001001001; const int MOD = 1000000007; #defi...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; using ll = long long; const int INF = 1001001001; const ll LLINF = 1001001001001001001; const int MOD = 1000000007; #defi...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
180
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long double #define PI 3.1415926535897932 int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, h, m; cin >> a >> b >> h >> m; ll hr = h * 5; // cout<<m<<" "<<hr<<endl; ll ang = 6 * abs(hr - m); ang = min(360 ...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long double #define PI 3.1415926535897932 int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll a, b, h, m; cin >> a >> b >> h >> m; ll hr = h * 5 + 5 * m / 60; // cout<<m<<" "<<hr<<endl; ll ang = 6 * abs(hr - m); a...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 49, 50, 51, 16, 12, 16, 31, 16, 31, 13], ["+", 49, 50, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 49, 50, 51, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
134
#include <algorithm> #include <cmath> #include <cstdio> #include <errno.h> #include <fenv.h> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace ...
#include <algorithm> #include <cmath> #include <cstdio> #include <errno.h> #include <fenv.h> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
159
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m, i, j, k; cin >> a >> b >> h >> m; h = h * 60; h = h + m; double r1 = (3.141592654) / 360, r2 = (3.141592654) / 30; double r = h * r1, r3 = (h * r2); r1 = sqrt(a * a + b * b - 2 * a * b * cos(abs(r - r3))); printf("%.20f", r1); }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m, i, j, k; cin >> a >> b >> h >> m; h = h * 60; h = h + m; double r1 = (3.14159265359) / 360, r2 = (3.14159265359) / 30; double r = h * r1, r3 = (h * r2); r1 = sqrt(a * a + b * b - 2 * a * b * cos(abs(r - r3))); printf("%.20f", r1)...
[["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 13]]
1
119
import math a, b, h, m = map(int, input().split()) angle = abs(30*h - 6*m) dangle = angle if angle <= 180 else 360 - angle d = math.sqrt(a**2 + b**2 - 2*a*b * math.cos(math.radians(dangle))) print(d)
import math a, b, h, m = map(int, input().split()) angle = abs(30*h + 0.5*m - 6*m) dangle = angle if angle <= 180 else 360 - angle d = math.sqrt(a**2 + b**2 - 2*a*b * math.cos(math.radians(dangle))) print(d)
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 657, 12, 657, 31, 531], ["+", 3, 4, 0, 657, 31, 657, 12, 657, 17, 48], ["+", 3, 4, 0, 657, 31, 657, 12, 657, 12, 22]]
5
81
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() double calc(int A, int B, double h, double m) { static const double pi = 3.141592653589793; double t, c; t = A * A + B * B - 2 * A * B * abs(cos((h - m) / 180...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() double calc(int A, int B, double h, double m) { static const double pi = 3.141592653589793; double t, c; t = A * A + B * B - 2 * A * B * cos(abs((h - m) / 180...
[["-", 0, 11, 12, 16, 12, 16, 12, 2, 63, 22], ["-", 12, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 31, 2, 63, 22], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 25], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
177
# 標準入力 A,B,H,M=map(int,input().split()) # 角度の差が出る A_RAD = float((H*60+M)/720*2*math.pi) B_RAD = float(M/60*2*math.pi) AB_RAD = A_RAD - B_RAD C = math.sqrt(A**2+B**2-2*A*B*math.cos(AB_RAD)) print(C)
import math # 標準入力 A,B,H,M=map(int,input().split()) # 角度の差が出る A_RAD = float((H*60+M)/720*2*math.pi) B_RAD = float(M/60*2*math.pi) AB_RAD = A_RAD - B_RAD C = math.sqrt(A**2+B**2-2*A*B*math.cos(AB_RAD)) print(C)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
92
import math A, B, H, M = map(int, input().split()) a = (H / 6 + M / 360) * 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 = (H / 6 + M / 360) * 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 + (ay - by)**2))
[["-", 0, 657, 12, 657, 31, 23, 0, 657, 31, 22], ["+", 0, 657, 12, 657, 31, 23, 0, 657, 31, 22], ["-", 0, 657, 12, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 657, 12, 657, 31, 23, 0, 657, 12, 22]]
5
109
import math A,B,H,M = map(int, input().split()) a = H*30 + M*0.5 b = M*60 ab = abs(a-b) ans = A**2 + B**2 - 2*A*B*math.cos(math.radians(ab)) print(ans**0.5)
import math A,B,H,M = map(int, input().split()) a = H*30 + M*0.5 b = M*6 ab = abs(a-b) ans = A**2 + B**2 - 2*A*B*math.cos(math.radians(ab)) print(ans**0.5)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
77
#include <math.h> #include <stdio.h> int main(void) { int a, b, h, m; double h_num, m_num, arg, rad, ans; scanf("%d %d %d %d", &a, &b, &h, &m); h_num = h / 12.0 * 360; m_num = m / 60.0 * 360; h_num += m / 60.0 * 30; // printf("h : %f\n m : %f\n", h_num, m_num); arg = fabs(h_num - m_num); if (arg >= 1...
#include <math.h> #include <stdio.h> int main(void) { int a, b, h, m; double h_num, m_num, arg, rad, ans; scanf("%d %d %d %d", &a, &b, &h, &m); h_num = h / 12.0 * 360; m_num = m / 60.0 * 360; h_num += m / 60.0 * 30; // printf("h : %f\n m : %f\n", h_num, m_num); arg = fabs(h_num - m_num); if (arg >= 1...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
0
158
a,b,h,m = map(int,input().split()) import math sitah = 30 * h + 0.5 * m sitam = 6 * m sitax = abs(sitah - sitam) if sitax > 180: sitax = sitax % 180 kosain = (math.cos((math.radians(sitax)))) x2 = a**2 + b**2 - 2*a*b*kosain ans = math.sqrt(x2) print(ans)
a,b,h,m = map(int,input().split()) import math sitah = 30 * h + 0.5 * m sitam = 6 * m sitax = abs(sitah - sitam) if sitax > 180: sitax = 360-sitax kosain = (math.cos((math.radians(sitax)))) x2 = a**2 + b**2 - 2*a*b*kosain ans = math.sqrt(x2) print(ans)
[["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
100
import math A,B,H,M = map(int,input().split()) Minute = 60*H+M pi = math.pi long=2*pi*Minute/720 short=2*pi*M/60 if -pi<=long-short<=pi: cos = math.cos(long-short) else: cos =math.cos(2*pi - long-short) ans = (A**2 + B**2 - 2*A*B*cos)**0.5 print(ans)
import math A,B,H,M = map(int,input().split()) Minute = 60*H+M pi = math.pi long=2*pi*Minute/720 short=2*pi*M/60 if -pi<=long-short<=pi: cos = math.cos(long-short) else: cos =math.cos(2*pi - (long-short)) ans = (A**2 + B**2 - 2*A*B*cos)**0.5 print(ans)
[["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
113
""" import random import functools import copy import bisect import array import re import collections import heapq import itertools import string import math from operator import itemgetter as ig from bisect import bisect_left, bisect_right, insort_left, insort_right from itertools import permutations, combinations, p...
""" import random import functools import copy import bisect import array import re import collections import heapq import itertools import string import math from operator import itemgetter as ig from bisect import bisect_left, bisect_right, insort_left, insort_right from itertools import permutations, combinations, p...
[["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 12, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 25]]
5
474
#include <assert.h> /*確認*/ #include <ctype.h> /*文字操作*/ #include <limits.h> /*限界*/ #include <math.h> /*計算*/ #include <stdbool.h>/*bool型*/ #include <stdio.h> /*入出力*/ #include <stdlib.h> /*標準ライブラリ*/ #include <string.h> /*文字列*/ //--------------------------------------------------- #define rep(i, n) for (int i = 0; i < ...
#include <assert.h> /*確認*/ #include <ctype.h> /*文字操作*/ #include <limits.h> /*限界*/ #include <math.h> /*計算*/ #include <stdbool.h>/*bool型*/ #include <stdio.h> /*入出力*/ #include <stdlib.h> /*標準ライブラリ*/ #include <string.h> /*文字列*/ //--------------------------------------------------- #define rep(i, n) for (int i = 0; i < ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
234
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(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(sita))))
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(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(sita))))
[["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85]]
5
89
from math import sin, cos, sqrt, radians A, B, H, M = map(int, input().split()) tan = [0, A] tyou = [0, B] tan_angle = H * 30 + 0.5 * M tyou_angle = M * 6 tan = [A*sin(radians(tan_angle)), A*cos(radians(tan_angle))] tyou = [B*sin(radians(tyou_angle)), B*cos(radians(tyou_angle))] print(tan, tyou) print(sqrt((tan[0]-tyou...
from math import sin, cos, sqrt, radians A, B, H, M = map(int, input().split()) tan = [0, A] tyou = [0, B] tan_angle = H * 30 + 0.5 * M tyou_angle = M * 6 tan = [A*sin(radians(tan_angle)), A*cos(radians(tan_angle))] tyou = [B*sin(radians(tyou_angle)), B*cos(radians(tyou_angle))] print(sqrt((tan[0]-tyou[0])**2 + (tan[1]...
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
143
import sys import math readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 a,b,h,m = map(int,readline().split()) degree = abs(h*30+30*(m/60) - m*6) degree = min(degree,180-degree) print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(degree))))
import sys import math readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 a,b,h,m = map(int,readline().split()) degree = abs(h*30+30*(m/60) - m*6) degree = min(degree,360-degree) print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(degree))))
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612]]
5
112
import math def main(): A, B, H, M = map(int, input().split()) print(A) A_angle_from_12 = 30*H + M/2 A_angle = 90 + A_angle_from_12 B_angle_from_12 = 6*M B_angle = 90 + B_angle_from_12 A_x = A * math.cos(math.radians(A_angle)) A_y = A * math.sin(math.radians(A_angle)) B_x = B * math.cos(math.radia...
import math def main(): A, B, H, M = map(int, input().split()) A_angle_from_12 = 30*H + M/2 A_angle = 90 + A_angle_from_12 B_angle_from_12 = 6*M B_angle = 90 + B_angle_from_12 A_x = A * math.cos(math.radians(A_angle)) A_y = A * math.sin(math.radians(A_angle)) B_x = B * math.cos(math.radians(B_angle)...
[["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
151
A, B, H, M = map(int, input().split()) import math deg_m_hand = 360*(H/12) + 30*(M/60) deg_h_hand = 360*(M/60) theta = deg_m_hand - deg_h_hand AB = math.sqrt( A**2 + B**2 - 2*A*B*math.cos(theta) ) print(AB)
A, B, H, M = map(int, input().split()) import math deg_m_hand = 360*(H/12) + 30*(M/60) deg_h_hand = 360*(M/60) theta = deg_m_hand - deg_h_hand AB = math.sqrt( A**2 + B**2 - 2*A*B*math.cos(math.radians(theta) ) ) print(AB)
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
84
import math A,B,H,M=map(int,input().split()) a=((H+M/60)/12)*2 b=(M/60)*2 if a-b<=1: omega=a-b else: omega=2-(a-b) print(omega) print((A**2+B**2-2*A*B*math.cos(omega*math.pi))**(1/2))
import math A,B,H,M=map(int,input().split()) a=((H+M/60)/12)*2 b=(M/60)*2 if a-b<=1: omega=a-b else: omega=2-(a-b) print((A**2+B**2-2*A*B*math.cos(omega*math.pi))**(1/2))
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24]]
5
108
#include <bits/stdc++.h> using namespace std; int main(void) { int A, B, H, M; std::cin >> A >> B >> H >> M; double a_A, a_B; a_A = (double)(30 * H) + 0.5 * (double)M; a_B = 6 * M; double theta = max(a_A, a_B) - min(a_A, a_B); if (theta >= 180.0) { theta -= 180.0; } theta = theta * M_PI / 180.0;...
#include <bits/stdc++.h> using namespace std; int main(void) { int A, B, H, M; std::cin >> A >> B >> H >> M; double a_A, a_B; a_A = (double)(30 * H) + 0.5 * (double)M; a_B = 6 * M; double theta = max(a_A, a_B) - min(a_A, a_B); if (theta >= 180.0) { theta = 360 - theta; } theta = theta * M_PI / 1...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
158
import math A,B,H,M = map(int,input().split()) h = 0.5*(H*60+M) m = 6*M t = abs(h-m) if t > 180: t = 360 - t if t <= 90: p = math.cos(math.radians(t))*B - A q = math.sin(math.radians(t))*B print(p,q) print((p**2+q**2)**0.5) else: p = math.cos(math.radians(180-t))*B+A q = math.sin(math.radi...
import math A,B,H,M = map(int,input().split()) h = 0.5*(H*60+M) m = 6*M t = abs(h-m) if t > 180: t = 360 - t if t <= 90: p = math.cos(math.radians(t))*B - A q = math.sin(math.radians(t))*B print((p**2+q**2)**0.5) else: p = math.cos(math.radians(180-t))*B+A q = math.sin(math.radians(180-t))*B ...
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24]]
5
165
import math def main(): a,b,h,m = map(int, input().split()) l_hand = 6 * m s_hand = 30 * h + m / 2 theta = abs(l_hand - s_hand) if theta > 180: theta = 360 - theta print(theta) cos_theta = math.cos(math.radians(theta)) ans = a ** 2 + b ** 2 - 2 * a * b * cos_theta ...
import math def main(): a,b,h,m = map(int, input().split()) l_hand = 6 * m s_hand = 30 * h + m / 2 theta = abs(l_hand - s_hand) if theta > 180: theta = 360 - theta cos_theta = math.cos(math.radians(theta)) ans = a ** 2 + b ** 2 - 2 * a * b * cos_theta print(math.sqrt(...
[["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
112
process.stdin.resume(); process.stdin.setEncoding('utf8'); var lines = []; var reader = require('readline').createInterface({ input : process.stdin, output : process.stdout, terminal : false }); reader.on('line', (line) => { lines.push(line); }); reader.on('close', () => { const [A, B, H, M] = lines[0].split(" ...
process.stdin.resume(); process.stdin.setEncoding('utf8'); var lines = []; var reader = require('readline').createInterface({ input : process.stdin, output : process.stdout, terminal : false }); reader.on('line', (line) => { lines.push(line); }); reader.on('close', () => { const [A, B, H, M] = lines[0].split(" ...
[["-", 0, 570, 0, 200, 51, 510, 64, 16, 31, 22], ["+", 0, 570, 0, 200, 51, 510, 64, 16, 31, 555], ["-", 0, 570, 0, 200, 51, 510, 64, 16, 12, 555], ["+", 0, 570, 0, 200, 51, 510, 64, 16, 12, 22]]
2
229
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { const double pi = 3.141592653589793; double a, b, c, d; cin >> a >> b >> c >> d; //長針 double x1 = sin(pi * d / 3) * b; double y1 = cos(pi * d / 3) * b; //短針 double x2 = sin(pi * (c * 30 + d / 2)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { const double pi = 3.141592653589793; double a, b, c, d; cin >> a >> b >> c >> d; //長針 double x1 = sin(pi * d / 30) * b; double y1 = cos(pi * d / 30) * b; //短針 double x2 = sin(pi * (c * 30 + d / ...
[["-", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
164
t = list(map(int, input().split())) a = t[0] b = t[1] h = t[2] m = t[3] import math h_c = 30*h + 0.5*m m_c = 6*m z = abs(h_c - m_c) if z > 180: z -= 180 if z == 180: print(t[0]+t[1]) elif z == 0: print(abs(t[0]-t[1])) else: a = a**2 b = b**2 k = round(math.cos(math.radians(z)),30) print(math.sqrt(a + b ...
t = list(map(int, input().split())) a = t[0] b = t[1] h = t[2] m = t[3] import math h_c = 30*h + 0.5*m m_c = 6*m z = abs(h_c - m_c) if z > 180: z = 360 - z if z == 180: print(t[0]+t[1]) elif z == 0: print(abs(t[0]-t[1])) else: a = a**2 b = b**2 k = round(math.cos(math.radians(z)),30) print(math.sqrt(a +...
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
165
import sys import math def II(): return int(input()) def MI(): return map(int,input().split()) def LI(): return list(map(int,input().split())) def TI(): return tuple(map(int,input().split())) def RN(N): return [input().strip() for i in range(N)] def main(): A, B, H, M = MI() th_h = H / 12 * 360 th_m = M...
import sys import math def II(): return int(input()) def MI(): return map(int,input().split()) def LI(): return list(map(int,input().split())) def TI(): return tuple(map(int,input().split())) def RN(N): return [input().strip() for i in range(N)] def main(): A, B, H, M = MI() th_h = (H / 12+ M / 720) * 360 ...
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 72], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 31, 22], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 17, 85], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
193
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 1e9 #define All(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { double a, b, h, m; cin >> a >> b >> h >> m; double kh = (h + m / 60.0) * 30, km = m * 6; double kaku = ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 1e9 #define All(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main() { double a, b, h, m; cin >> a >> b >> h >> m; double kh = (h + m / 60.0) * 30, km = m * 6; double kaku = ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
140
#include <bits/stdc++.h> int main(void) { int a, b, h, m; scanf("%d", &a); scanf("%d", &b); scanf("%d", &h); scanf("%d", &m); // r.theta座標変換 double theta_a, theta_b, theta_diff; theta_a = (double)h * 2.f * M_PI / 12.f + (double)m * 2.f * M_PI / 60.f / 12.f; theta_b = (double)m * 2.f * M_PI ...
#include <bits/stdc++.h> int main(void) { int a, b, h, m; scanf("%d", &a); scanf("%d", &b); scanf("%d", &h); scanf("%d", &m); // r.theta座標変換 long double theta_a, theta_b, theta_diff; theta_a = (double)h * 2.f * M_PI / 12.f + (double)m * 2.f * M_PI / 60.f / 12.f; theta_b = (double)m * 2.f * ...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
157
#include <bits/stdc++.h> using namespace std; #define M_PI 3.14159265358979323846 #define ll long long int main() { float a, b, h, m, i, j, cnt = 0; string s; cin >> a >> b >> h >> m; float min_d = m * 6; float hor_d = (h * 30) + (m / 2); float angle = abs(min_d - hor_d); if (angle > 180) { angle =...
#include <bits/stdc++.h> using namespace std; #define M_PI 3.14159265358979323846 #define ll long long int main() { double a, b, h, m, i, j, cnt = 0; string s; cin >> a >> b >> h >> m; double min_d = m * 6; double hor_d = (h * 30) + (m / 2); double angle = abs(min_d - hor_d); if (angle > 180) { ang...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
149
import math a, b, h,m = map(int, input().split()) # 角度を求める a_angle = (h/12 + m/(60*12)) *360 b_angle = m/60*360 #print(a_angle) #print(b_angle) line = 0 if a_angle > b_angle: angle = a_angle - b_angle elif a_angle < n_angle: angle = b_angle - a_angle else: angle = 0 if angle >=180: angle = ...
import math a, b, h,m = map(int, input().split()) # 角度を求める a_angle = (h/12 + m/(60*12)) *360 b_angle = m/60*360 #print(a_angle) #print(b_angle) line = 0 if a_angle > b_angle: angle = a_angle - b_angle elif a_angle < b_angle: angle = b_angle - a_angle else: angle = 0 if angle >=180: angle = ...
[["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22]]
5
135
import math a, b, h, m = list(map(int, input().split())) a_angle = 30 * h + 30 * m // 60 b_angle = 6 * m angle = abs(a_angle - b_angle) angle = min(360 - angle, angle) c = a**2 + b**2 - 2 * a * b * math.cos(math.radians(angle)) print(c**0.5)
import math a, b, h, m = list(map(int, input().split())) a_angle = 30 * h + 30 * m / 60 b_angle = 6 * m angle = abs(a_angle - b_angle) angle = min(360 - angle, angle) c = a**2 + b**2 - 2 * a * b * math.cos(math.radians(angle)) print(c**0.5)
[["-", 0, 1, 0, 662, 12, 657, 12, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85]]
5
92
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> using namespace std; int main() { long double a, b, h, m; cin >> a >> b >> h >> m; long double h_ = h * 30 + m * 0.5, m_ = m * 6; long double ans = a * a + b * b - 2 * a * b * cosl(M_PI * abs(h_ - m_) / 180.0); printf("%.10f\n", sqrtl(an...
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> using namespace std; int main() { long double a, b, h, m; cin >> a >> b >> h >> m; long double h_ = h * 30 + m * 0.5, m_ = m * 6; long double ans = a * a + b * b - 2 * a * b * cosl(M_PI * abs(h_ - m_) / 180.0); printf("%.15Lf\n", sqrtl(a...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
102
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i...
#include <algorithm> #include <array> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["-", ...
1
363
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(v) v.rbegin(), v.rend() #define ones(x) __builtin_popcount(x) #define sz(v) ((int)((v).size()) #define debug(x) cout << '>' << #x << ':' << x << endl; #define clr(v, d) memset(v, d, sizeof(v)); #define rep(i, a, b) for (ll i = a; i <...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(v) v.rbegin(), v.rend() #define ones(x) __builtin_popcount(x) #define sz(v) ((int)((v).size()) #define debug(x) cout << '>' << #x << ':' << x << endl; #define clr(v, d) memset(v, d, sizeof(v)); #define rep(i, a, b) for (ll i = a; i <...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 39, 40], ["-", 0, 1, 0, 11, 12, 16, 31, 23, 0, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 13], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
460
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> using namespace std; using i64 = int64_t; using P = pair<i64, i64>; i64 mod = ...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> using namespace std; using i64 = int64_t; using P = pair<i64, i64>; i64 mod = ...
[["-", 49, 50, 51, 16, 12, 16, 12, 2, 63, 22], ["-", 51, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["-", 51, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
201
import math A,B,H,M = map(int,input().split()) degree = abs(H - M*11/60)*math.pi/6 cosC = abs(math.cos(degree)) ans = (A**2 + B**2 - 2*A*B*cosC)**(0.5) print(ans)
import math A,B,H,M = map(int,input().split()) degree = abs(H - M*11/60)*math.pi/6 cosC = math.cos(degree) ans = (A**2 + B**2 - 2*A*B*cosC)**(0.5) print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
78
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++) #define rep(i, n) reps(i, 0, n) using namespace std; using ll = long long; int main() { long double a, b; l...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++) #define rep(i, n) reps(i, 0, n) using namespace std; using ll = long long; int main() { long double a, b; l...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
223
#include <bits/stdc++.h> #define vsort(v) sort(v.begin(), v.end()) #define rvsort(v) sort(v.begin(), v.end(), greater<ll>()) #define vfind(v, target) find(v.begin(), v.end(), target) #define notFound(v, target) (vfind(v, target) == v.end()) #define ll long long #define rep(i, s, g) for (ll i = (s); i < (g); i++) #defin...
#include <bits/stdc++.h> #define vsort(v) sort(v.begin(), v.end()) #define rvsort(v) sort(v.begin(), v.end(), greater<ll>()) #define vfind(v, target) find(v.begin(), v.end(), target) #define notFound(v, target) (vfind(v, target) == v.end()) #define ll long long #define rep(i, s, g) for (ll i = (s); i < (g); i++) #defin...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 11, 12, 16, 31, 74, 39, 77, 39, 40], ["-", 12, 16, 31, 16, 31, 74, 39, 77, 39, 40], ["+", ...
1
180
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double A = scan.nextInt(); double B = scan.nextInt(); double H = scan.nextInt(); double M = scan.nextInt(); double L = Math.sqrt( Math.pow(A, 2) + Math.pow(B...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double A = scan.nextInt(); double B = scan.nextInt(); double H = scan.nextInt(); double M = scan.nextInt(); double L = Math.sqrt(Math.pow(A, 2) + Math.pow(B,...
[["-", 3, 4, 0, 492, 3, 4, 0, 492, 500, 22], ["-", 3, 4, 0, 492, 3, 4, 0, 492, 0, 131], ["-", 3, 4, 0, 492, 3, 4, 0, 492, 141, 22], ["-", 0, 492, 3, 4, 0, 492, 3, 4, 0, 24], ["-", 0, 492, 3, 4, 0, 16, 31, 16, 12, 515], ["+", 0, 492, 3, 4, 0, 16, 31, 16, 12, 515], ["-", 0, 492, 3, 4, 0, 492, 3, 4, 0, 25]]
3
135
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define endl '\n' #define ll long long #...
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <tuple> #include <unordered_map> #include <unordered_set> #include <vector> #define endl '\n' #define ll long long #...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
192
a, b, h, m = [int(x) for x in input().split()] #a, b, h, m = 3, 4, 11, 0 h_dig = 360 * (float(h) / 12) + 30 * (float(m) / 60) m_dig = 360 * (float(m) / 60) #print(str(h_dig) + " " + str(m_dig)) abs_dig = abs(h_dig - m_dig) if(abs_dig > 180): abs_dig = 360 - abs_dig #print(abs_dig) c = math.sqrt(a ** 2 + b **...
import math a, b, h, m = [int(x) for x in input().split()] #a, b, h, m = 3, 4, 11, 0 h_dig = 360 * (float(h) / 12) + 30 * (float(m) / 60) m_dig = 360 * (float(m) / 60) #print(str(h_dig) + " " + str(m_dig)) abs_dig = abs(h_dig - m_dig) if(abs_dig > 180): abs_dig = 360 - abs_dig #print(abs_dig) c = math.sqrt(...
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
128
from math import * def a(m, h): return abs(h/ 6 - m / 30) * pi a, b, h, m = map(int, input().split()) # print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 + 1/(6*m) - m / 30) * pi))) print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 - m / 30) * pi)))
from math import * def a(m, h): return abs(h/ 6 - m / 30) * pi a, b, h, m = map(int, input().split()) # print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 + 1/(6*m) - m / 30) * pi))) print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 + m/(360) - m / 30) * pi)))
[["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 72], ["+", 31, 23, 0, 657, 31, 657, 12, 657, 31, 22], ["+", 31, 23, 0, 657, 31, 657, 12, 657, 17, 85], ["+", 0, 657, 31, 657, 12, 657, 12, 23, 0, 24], ["+", 0, 657, 31, 657, 12, 657, 12, 23, 0, 612], ["+", 0, 657, 31, 657, 12, 657, 12, 23, 0, 25]]
5
80
#include <bits/stdc++.h> // #define int ll typedef long long ll; typedef long double ldb; using namespace std; ldb a, b; int h, m; inline int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) { x = x * 10 + c - ...
#include <bits/stdc++.h> // #define int ll typedef long long ll; typedef long double ldb; using namespace std; ldb a, b; int h, m; inline int read() { int x = 0, f = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) { x = x * 10 + c - ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
239
#include <bits/stdc++.h> using namespace std; int main() { double A, B, H, M; cin >> A >> B >> H >> M; double pi = 3.141592653589793; double hour_rad = (H * 60 + M) * pi / 360.0; double min_rad = M * pi / 30.0; double rad = abs(hour_rad - min_rad); if (rad > pi) rad -= pi; double A_x = A * cos(ra...
#include <bits/stdc++.h> using namespace std; int main() { double A, B, H, M; cin >> A >> B >> H >> M; double pi = 3.141592653589793; double hour_rad = (H * 60 + M) * pi / 360.0; double min_rad = M * pi / 30.0; double rad = abs(hour_rad - min_rad); if (rad > pi) rad = 2 * pi - rad; double A_x = A...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]]
1
137
import math A,B,H,M = map(int,input().split()) # long 0.25rad/m short 6rad/m deg = abs(6*M-0.5*(60*H+M)) ans = (A**2 + B**2 - 2*A*B*math.cos(math.radians(deg))) ** (1/2) print(ans,deg)
import math A,B,H,M = map(int,input().split()) # long 0.25rad/m short 6rad/m deg = abs(6*M-0.5*(60*H+M)) ans = (A**2 + B**2 - 2*A*B*math.cos(math.radians(deg))) ** (1/2) print(ans)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
82
#include <bits/stdc++.h> using namespace std; #define ll long long double pi = 3.14159265358; int main() { int t = 1; // cin>>t; while (t--) { double a, b, h, m; cin >> a >> b >> h >> m; double t = 60 * h + m; double a1 = 0.5 * t; double a2 = 6 * t; double theta = (abs(a2 - a1)); do...
#include <bits/stdc++.h> using namespace std; #define ll long long double pi = 3.14159265358979323846; int main() { int t = 1; // cin>>t; while (t--) { double a, b, h, m; cin >> a >> b >> h >> m; double t = 60 * h + m; double a1 = 0.5 * t; double a2 = 6 * t; double theta = (abs(a2 - a1)...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
127
import math a,b,h,m = list(map(int,input().split())) h = h*30+0.5*m m = m*6 d = max(h,m)-min(h,m) print(math.sqrt(a**2+b**2-math.cos(math.radians(d))))
import math a,b,h,m = list(map(int,input().split())) h = h*30+0.5*m m = m*6 d = max(h,m)-min(h,m) print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(d))))
[["+", 0, 657, 12, 657, 31, 657, 31, 657, 31, 612], ["+", 0, 657, 12, 657, 31, 657, 31, 657, 17, 48], ["+", 0, 657, 12, 657, 31, 657, 31, 657, 12, 22], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 48]]
5
81
#include <math.h> #include <stdio.h> const double pi = 3.141592653589793; int main() { double hourlong, minutelong, hour, minute; scanf("%lf %lf %lf %lf", &hourlong, &minutelong, &hour, &minute); double hourangle, minuteangle; hourangle = hour * 30 + minute / 2; minuteangle = minute * 60; double delta; ...
#include <math.h> #include <stdio.h> const double pi = 3.141592653589793; int main() { double hourlong, minutelong, hour, minute; scanf("%lf %lf %lf %lf", &hourlong, &minutelong, &hour, &minute); double hourangle, minuteangle; hourangle = hour * 30 + minute / 2; minuteangle = minute * 6; double delta; d...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
138
import math def colon(a, b, h, m): hour = 0.5 * (h * 60 + m) minute = 6 * m angle = abs(hour - minute) angle = min(360 - angle, angle) rad = angle*0.0174533 #print(angle, rad) ans = math.sqrt(a**2+b**2-(2*a*b*(math.cos(rad)))) return ans a, b, h, m = map(int, input().split()) print(colon(a,b,h, m))...
import math def colon(a, b, h, m): hour = 0.5 * (h * 60 + m) minute = 6 * m angle = abs(hour - minute) angle = min(360 - angle, angle) rad = angle*(3.141592653589793238/180) #print(angle, rad) ans = math.sqrt(a**2+b**2-(2*a*b*(math.cos(rad)))) return ans a, b, h, m = map(int, input().split()) print...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 531], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 531], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 85], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
120
import math a, b, h, m = map(int, input().split()) H_kakudo = (30 * h) + (m * 0.5) M_kakudo = 6 * m kakudo = abs(H_kakudo - M_kakudo) if kakudo > 180: kakudo = 360 - kakudo print(kakudo) result = (a ** 2) + (b ** 2) - (2 * a * b * math.cos(math.radians(kakudo))) print(math.sqrt(result))
import math a, b, h, m = map(int, input().split()) H_kakudo = (30 * h) + (m * 0.5) M_kakudo = 6 * m kakudo = abs(H_kakudo - M_kakudo) if kakudo > 180: kakudo = 360 - kakudo result = (a ** 2) + (b ** 2) - (2 * a * b * math.cos(math.radians(kakudo))) print(math.sqrt(result))
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
104
a,b,h,m = gets.split.map(&:to_i) d = (h * 30 - m * 6).abs s = [d, 360-d].min puts Math.sqrt(a**2 + b**2 + (-2 * a * b * Math.cos(s * (Math::PI / 180))))
a,b,h,m = gets.split.map(&:to_i) d = (h * 30 + 0.5 * m - m * 6).abs s = [d, 360-d].min puts Math.sqrt(a**2 + b**2 + (-2 * a * b * Math.cos(s * (Math::PI / 180))))
[["+", 12, 652, 486, 739, 0, 738, 31, 738, 17, 72], ["+", 486, 739, 0, 738, 31, 738, 12, 738, 31, 531], ["+", 486, 739, 0, 738, 31, 738, 12, 738, 17, 48], ["+", 486, 739, 0, 738, 31, 738, 12, 738, 12, 22]]
4
78
import math A, B, H, M = list(map(int, input().split())) a = abs((H + M/60) / 12 * 360 - (M / 60) * 360) if a > 180: a -= 180 ans = A*A + B*B - 2 * A*B * math.cos(math.radians(a)) print(math.sqrt(ans))
import sys import math A, B, H, M = list(map(int, input().split())) a = abs((H + M/60) / 12 * 360 - (M / 60) * 360) if a > 180: a = 360 - a ans = A*A + B*B - 2 * A*B * math.cos(math.radians(a)) print(math.sqrt(ans))
[["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17...
5
93
#include <algorithm> // count_ifに必要 #include <array> // sizeはコンパイル時定数で固定 #include <cmath> #include <iomanip> // cout << setprecision(15) << x で小数の出力精度を指定 #include <iostream> #include <map> #include <numeric> // accumulate, gcd #include <queue> // priority_queue も入ってる #include <set> // 要素数は size() で取得 multiset...
#include <algorithm> // count_ifに必要 #include <array> // sizeはコンパイル時定数で固定 #include <cmath> #include <iomanip> // cout << setprecision(15) << x で小数の出力精度を指定 #include <iostream> #include <map> #include <numeric> // accumulate, gcd #include <queue> // priority_queue も入ってる #include <set> // 要素数は size() で取得 multiset...
[["+", 31, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]]
1
321
A, B, H, M = map(int, input().split()) import numpy as np hour = 30*H + M/2 t = abs(hour-60*M) if t >= 180: t = 360 - t t = np.pi/180*t ans2 = A**2 + B**2 - 2*A*B*np.cos(t) print(np.sqrt(ans2))
A, B, H, M = map(int, input().split()) import numpy as np hour = 30*H + M/2 t = abs(hour-6*M) if t >= 180: t = 360 - t t = np.pi/180*t ans2 = A**2 + B**2 - 2*A*B*np.cos(t) print(np.sqrt(ans2))
[["-", 12, 652, 3, 4, 0, 657, 12, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 31, 612]]
5
93
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <set> #include <string> #include <vector> #define ll long long #define MAX 25 * 1e13 #define N 200010 #define SIZE(A) ((int)A.size()) #define LEN(A) ((int)A.length()) #define MP(A, B) make_pair(A, B) #define PB(X) p...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <set> #include <string> #include <vector> #define ll long long #define MAX 25 * 1e13 #define N 200010 #define SIZE(A) ((int)A.size()) #define LEN(A) ((int)A.length()) #define MP(A, B) make_pair(A, B) #define PB(X) p...
[["-", 36, 36, 0, 30, 0, 43, 0, 153, 0, 154], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
262
import math A,B,H,M = map(int, input().split()) m = abs(6*M-30*(H+M/60)) if m>180: m = 360-m print((A**2+B**2-2*A*B*math.cos(m))**(1/2))
import math A,B,H,M = map(int, input().split()) m = abs(6*M-30*(H+M/60)) if m>180: m = 360-m print((A**2+B**2-2*A*B*math.cos(math.radians(m)))**(1/2))
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
81
import math a, b, h, m = map(int, input().split()) h = h*30 + m*0.5 m = m*6 rad = abs(h-m) if rad > 180: rad = rad-180 c2 = a*a + b*b - 2*a*b*math.cos(math.radians(rad)) print(math.sqrt(c2))
import math a, b, h, m = map(int, input().split()) h = h*30 + m*0.5 m = m*6 rad = abs(h-m) if rad > 180: rad = 360-rad c2 = a*a + b*b - 2*a*b*math.cos(math.radians(rad)) #print(rad) print(math.sqrt(c2))
[["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
90
import math a,b,h,m = map(float, input().split()) rot = 5.5 * (60.0*h + m) rad = ang * math.pi / 180 cal = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad) ans = math.sqrt(cal) print(ans)
import math a,b,h,m = map(float, input().split()) rot = 5.5 * (60.0*h + m) ang = rot%360 rad = ang * math.pi / 180 cal = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad) ans = math.sqrt(cal) print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
76
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; void read(); template <typename First, typename... Rest> void read(First &f...
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; void read(); template <typename First, typename... Rest> void read(First &f...
[["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 24], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 0, 96], ["+", 31, 16, 31, 74, 39, 77, 39, 86, 39, 40], ["+", 0, 16, 12, 16, 31, 16, 31, 74, 0, 25]]
1
335
#include <math.h> #include <stdio.h> int main(void) { int a, b, h, m; scanf("%d %d %d %d", &a, &b, &h, &m); printf("%lf\n", sqrt(a * a + b * b - 2 * a * b * cos(2 * M_PI * fabs(60 * h - 11 * m) / 720))); return 0; }
#include <math.h> #include <stdio.h> int main(void) { int a, b, h, m; scanf("%d %d %d %d", &a, &b, &h, &m); printf("%.20lf\n", sqrt(a * a + b * b - 2 * a * b * cos(2 * M_PI * fabs(60 * h - 11 * m) / 720))); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
87
import sys import math def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) A,B,H,M = LI() tanshin = H * 30 + M * 0.5; shouhshin = M * 6; diff =...
import sys import math def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) A,B,H,M = LI() tanshin = H * 30 + M * 0.5; shouhshin = M * 6; diff =...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
181
#include <bits/stdc++.h> using namespace std; int main(void) { int A, B, H, M; cin >> A >> B >> H >> M; double short_angle = (360 / 12) * H + (360 / 12) * ((double)M / 60); double long_angle = (360 / 60) * M; double angle = max(long_angle, short_angle) - min(long_angle, short_angle); if (angle == 180) { ...
#include <bits/stdc++.h> using namespace std; int main(void) { int A, B, H, M; cin >> A >> B >> H >> M; double short_angle = (360 / 12) * H + (360 / 12) * ((double)M / 60); double long_angle = (360 / 60) * M; double angle = max(long_angle, short_angle) - min(long_angle, short_angle); if (angle == 180) { ...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 13], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]]
1
190
#include <bits/stdc++.h> using namespace std; #define int long long double calcAngle(double h, double m) { if (h == 12) h = 0; if (m == 60) m = 0; double hour_angle = 0.5 * (h * 60 + m); double minute_angle = 6 * m; double angle = abs(hour_angle - minute_angle); angle = min(360 - angle, angle);...
#include <bits/stdc++.h> using namespace std; #define int long long double calcAngle(double h, double m) { if (h == 12) h = 0; if (m == 60) m = 0; double hour_angle = 0.5 * (h * 60 + m); double minute_angle = 6 * m; double angle = abs(hour_angle - minute_angle); angle = min(360 - angle, angle);...
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13]]
1
232
// ABC168C - #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; int main() { int A, B, H, M; cin >> A >> B >> H >> M; double Ax, Ay, Bx, By; double PI = acos(-1); Ax = A * cos((H * 30.0 + M / 2.0) / 180.0 * PI); Ay = A * sin((H * 30.0 + M / 2.0) ...
// ABC168C - #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; int main() { int A, B, H, M; cin >> A >> B >> H >> M; double Ax, Ay, Bx, By; double PI = acos(-1); Ax = A * cos((H * 30.0 + M / 2.0) / 180.0 * PI); Ay = A * sin((H * 30.0 + M / 2.0) ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
176
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}')
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 - 5.5*m)) rad=math.radians(deg) c = math.sqrt(a**2 + b**2 -2*a*b*math.cos(rad)) print(f'{c:.9f}')
[["-", 12, 652, 3, 4, 0, 657, 12, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 31, 531]]
5
105