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

17167번 - A Plus Equals B 서브태스크스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB84237030647.442%

문제

$A+B$ is a problem used to test one's basic knowledge for competitive programming. Here is yet another boring variation of it.

You have two integers, $A$ and $B$. You want to make them equal. To do so, you can perform several steps, where each step is one of the following:

  • $A$ += $A$
  • $A$ += $B$
  • $B$ += $A$
  • $B$ += $B$

Unfortunately, $A+B$ is a hard problem for us, so you are allowed to make at most 5000 steps.

입력

In the first line, two space-separated integers $A$ and $B$ are given. These are the initial values of the variables $A$ and $B$.

출력

In the first line, print a single integer $n$ (0ドル \le n \le 5,000円$) denoting the number of steps.

In the next $n$ lines, print one of the following strings to denote your desired operation: A+=A, A+=B, B+=A, B+=B.

Any sequence of steps that yields the desired result will be judged correct.

제한

  • 1ドル \le A,\ B \le 10^{18}$

서브태스크 1 (36점)

This subtask has an additional constraint:

  • $A = 1$

서브태스크 2 (64점)

This subtask has no additional constraints.

예제 입력 1

2 3

예제 출력 1

4
B+=B
B+=A
A+=A
A+=A

힌트

출처

University > KAIST > KAIST RUN Spring Contest > 2019 KAIST RUN Spring Contest D번

Contest > Open Cup > 2018/2019 Season > Stage 19: Grand Prix of Daejeon A번

  • 문제를 만든 사람: ainta

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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