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

30887번 - Basic Math 스페셜 저지다국어

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

문제

Example exam by Ellen.

Ellen is teaching elementary math to her students and the time for the final exam has come. The exam consists of $n$ questions. In each question, the students have to add ('+'), subtract ('-') or multiply ('*') a pair of numbers.

Ellen has already chosen the $n$ pairs of numbers. All that remains is to decide for each pair which of the three possible operations the students should perform. To avoid students getting bored, Ellen wants to make sure that the $n$ correct answers to her exam are all different.

Please help Ellen finish constructing the exam by automating this task.

입력

The input consists of:

  • One line with an integer $n$ (1ドル\leq n \leq 2,500円$), the number of pairs of numbers.
  • $n$ lines with two integers $a$ and $b$ ($\left|a\right|, \left|b\right| \leq 10^6$), a pair of numbers used.

출력

If there is no way to construct the exam such that the $n$ correct answers are all different, output "impossible".

Else, for each pair of numbers $(a,b)$ in the same order as in the input, output a valid equation. Each equation should consist of five parts: $a,ドル one of the three operators, $b,ドル an equals sign ('='), and the result of the expression. All the $n$ expression results must be different.

If there are multiple valid solutions, you may output any one of them.

제한

예제 입력 1

4
1 5
3 3
4 5
-1 -6

예제 출력 1

1 + 5 = 6
3 * 3 = 9
4 -ひく 5 = -ひく1
-ひく1 -ひく -ひく6 = 5

예제 입력 2

4
-4 2
-4 2
-4 2
-4 2

예제 출력 2

impossible

노트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2023 연습 세션 PB번

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

출처

대학교 대회

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

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