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

33019번 - Evaluate It and Back Again 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 2048 MB73171744.737%

문제

Aidan and Nadia are long-time friends with a shared passion for mathematics. Each of them has a favorite number: Aidan's favorite number is $p,ドル and Nadia's is $q$.

To commemorate their friendship, their friends want to make a present: a plaque with an arithmetic expression whose value is equal to their favorite numbers. At first glance, it sounds impossible, but the answer is simple: Aidan reads left-to-right, while Nadia reads right-to-left, so the same expression can have different values for them.

For example, if 2023年12月13日 is written on the plaque, then Aidan would calculate the result as 2023ドル-12-13 = 1998,ドル and Nadia would calculate it as 31ドル-21-3202=-3192$.

Find an arithmetic expression that, when read left-to-right, evaluates to $p,ドル and, when read right-to-left, evaluates to $q$. Its length must be at most 1000ドル$ characters. It's guaranteed that such an expression exists for all valid inputs.

입력

The first line of the input contains two integers $p$ and $q$ ($-10^{18} \le p, q \le 10^{18}$).

출력

Print the expression without spaces or line breaks. It can only contain digits 0 through 9, '+', '-', and '*' characters.

The expression must contain at most 1000ドル$ characters. Leading zeros in numbers are not allowed (the only exception is the notation '0' representing the number 0ドル$) in both the expression and its reverse. Use of unary '+' or '-' is not allowed. The expression must be well-formed in both directions. The calculation uses the standard operator precedence.

제한

예제 입력 1

1998 -3192

예제 출력 1

2023年12月13日

예제 입력 2

413 908

예제 출력 2

12*34+5

힌트

출처

ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > Northern Eurasia Finals 2023 E번

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

출처

대학교 대회

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

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