QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#18888. A ועוד שווה B

Statistics

$A+B$ היא בעיה המשמשת לבדיקת הידע הבסיסי בתכנות תחרותי. הנה עוד גרסה משעממת שלה.

יש לך שני מספרים שלמים, $A$ ו־$B$. ברצונך להפוך אותם לשווים. לשם כך אפשר לבצע כמה צעדים, כאשר כל צעד הוא אחת מהפעולות הבאות:

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

לרוע המזל, $A+B$ היא בעיה קשה עבורנו, ולכן מותר לך לבצע לכל היותר 5000 צעדים.

קלט

נתונים שני מספרים שלמים $A, B$. ($1 \le A, B \le 10^{18}$).

פלט

בשורה הראשונה יש להדפיס מספר שלם יחיד $n$ ($0 \le n \le 5000$) המציין את מספר הצעדים.

ב־$n$ השורות הבאות יש להדפיס אחת מהמחרוזות הבאות כדי לציין את הפעולה הרצויה: "A+=A", "A+=B", "B+=A" או "B+=B".

כל סדרת צעדים שמניבה את התוצאה הרצויה תיחשב נכונה.

דוגמאות

קלט 1

2 3

פלט 1

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

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.