Advertisement
nq1s788

14 52025 + 5400 – х

Mar 29th, 2025
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. #14 https://kpolyakov.spb.ru/school/ege/gen.php?action=viewVar&answers=on&varId=2
  2. n = 5 ** 8
  3. answ = (0, 0) #кол-во четверок, x
  4. for x in range(10, 70001):
  5.     r = n - x
  6.     cnt = 0
  7.     while r != 0:
  8.         if r % 5 == 4:
  9.             cnt += 1
  10.         r //= 5
  11.     answ = max(answ, (cnt, x))
  12. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement