Logo
(追記) (追記ここまで)

26868번 - Focusing on Costs 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB127815066.667%

문제

In modern gadgets, it's crucial to trim down the fat and get rid of unnecessary features, like a headphone jack. The same trend applies to the calculator industry.

In their pursuit for minimalism, Cosio calculator company started to produce calculators that have a single display and can only compute trigonometric functions sin, cos, tan and their inverses asin, acos, atan.

Initially, the calculator's display shows the number 0ドル$. After that, for each of the functions listed above, you can press a button that applies that function to the displayed number. If the operation is inapplicable or produces infinity, then the calculator breaks and stops responding.

You took it as a challenge to figure out what you can achieve using this calculator. Find a way to compute $\frac {a}{b}$ using at most 1000ドル$ operations.

입력

The only line contains two integers $a$ and $b$ (1ドル \le a, b \le 10$).

출력

In the first line, print a single integer $k$ --- the number of button presses in your solution (1ドル \le k \le 1000$).

In the second line, print the applied operations in order, separated by spaces.

The solution will be checked with a program in C++ using the standard 64-bit floating-point type: double. Your answer will be considered correct if the sequence of actions does not cause an error, and in the end the calculator displays $\frac {a}{b}$ with an absolute error of at most 10ドル^{-9}$.

You do not have to find the shortest solution. Any solution satisfying the constraints will be accepted.

제한

예제 입력 1

1 1

예제 출력 1

4
atan cos sin asin

예제 입력 2

2 1

예제 출력 2

11
cos atan sin atan sin atan sin atan sin acos tan

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2022-2023 North-Western Russia Regional Contest F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /