아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Focusing on Costs

시간 제한2초메모리 제한1024 MB

요약
0에서 시작해 여섯 개의 삼각함수와 역삼각함수를 1000번 이하로 적용해 a/b (1부터 10)를 절대오차 1e-9 이내로 만드는 수열을 찾는다.
난이도

보통10점 중 5점

유형
수학, 기하, 구현
정답자
아직 제출이 없습니다

문제

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 00. 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 ab\frac {a}{b} using at most 10001000 operations.

입력

The only line contains two integers aa and bb (1≤a,b≤101 \le a, b \le 10).

출력

In the first line, print a single integer kk --- the number of button presses in your solution (1≤k≤10001 \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 ab\frac {a}{b} with an absolute error of at most 10−910^{-9}.

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

예제2

  1. 예제 1

    입력
    1 1
    
    예상 출력
    4
    atan cos sin asin
    
  2. 예제 2

    입력
    2 1
    
    예상 출력
    11
    cos atan sin atan sin atan sin atan sin acos tan