Skip to content

Commit

Permalink
Create 28.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirPaulb authored Jan 5, 2023
1 parent 039a8f5 commit b461f8b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 22_Math/28.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://codeforces.com/contest/727/problem/A


# Reverse approach

a,b = map(int, input().split())
arr = []
while b >= a:
arr.append(b)
if b%2 == 0:
b //= 2
elif b%10 == 1:
b -= 1
b //= 10
else:
break

if a in arr:
print("YES")
print(len(arr))
print(*arr[::-1])
else:
print("NO")

0 comments on commit b461f8b

Please sign in to comment.