Advertisement
stupid_pro

Untitled

Apr 20th, 2023 (edited)
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.58 KB | None | 0 0
  1. # print('e g k z')
  2. # for e in range(2):
  3. # for g in range(2):
  4. # for k in range(2):
  5. # for z in range(2):
  6. # f = ((not e) and g) or (k <= z)
  7. # if not f:
  8. # print(e, g, k, z)
  9.  
  10. # def f(n):
  11. # str_n = str(n)
  12. # s1 = str(int(str_n[0]) * int(str_n[1]))
  13. # s2 = str(int(str_n[1]) * int(str_n[2]))
  14. # res = s1 + s2
  15. # return int(res)
  16. #
  17. #
  18. # for i in range(100, 1000):
  19. # print(i, f(i))
  20.  
  21. # import turtle as t
  22. #
  23. # t.tracer(0, 0)
  24. # t.left(90)
  25. # k = 30
  26. #
  27. # t.forward(10 * k)
  28. # t.right(45)
  29. # for i in range(9):
  30. # t.forward(5 * k)
  31. # t.right(90)
  32. #
  33. # t.up()
  34. #
  35. # for x in range(-15, 15):
  36. # for y in range(-15, 15):
  37. # t.goto(x * k, y * k)
  38. # t.dot(3)
  39. #
  40. # t.update()
  41. # t.mainloop()
  42.  
  43. # s = 57 * "2"
  44. # while "22222" in s or "5555" in s:
  45. # if "22222" in s:
  46. # s = s.replace("22222", "55", 1)
  47. # else:
  48. # s = s.replace("5555", "2", 1)
  49. # print(s)
  50.  
  51. # n = 1024 ** 29 + 64 ** 47 + 3 * 512 - 32
  52. # a = []
  53. # while n > 0:
  54. # a.append(n % 4)
  55. # n //= 4
  56. # print(sum(a))
  57. # print(a)
  58.  
  59. # ((𝑦>𝐴)∨(𝑦≤150))∧(¬(𝑥2≥𝐴)∨¬(𝑥≤11))
  60. # for A in range(-100, 1000):
  61. # flag = 1
  62. # for x in range(0, 100):
  63. # for y in range(0, 100):
  64. # f = ((y > A) or (y <= 150)) and (not((x ** 2) >= A) or not(x <= 11))
  65. # if not f:
  66. # flag = 0
  67. # if flag:
  68. # print(A)
  69.  
  70. # def f(n):
  71. # if n <= 1:
  72. # return 1
  73. # elif n > 1 and n % 3 == 0:
  74. # return f(n - 1) + f(n - 3)
  75. # else:
  76. # return f(n - 2) + 3 * n
  77. #
  78. # print(f(65))
  79.  
  80. # a = []
  81. # with open('Задание 17.txt') as file:
  82. # for line in file:
  83. # a.append(int(line))
  84. # c = 0
  85. # max_res = -10 ** 10
  86. # for i in range(len(a) - 1):
  87. # if (a[i] + a[i + 1]) % 6 != 0 and (abs(a[i] * a[i + 1]) < 10000):
  88. # c += 1
  89. # if a[i] + a[i + 1] > max_res:
  90. # max_res = a[i] + a[i + 1]
  91. # print(c, max_res)
  92.  
  93. # def win(s):
  94. # return s >= 29
  95. #
  96. #
  97. # def first(s):
  98. # return (win(s + 3) or win(s * 2)) and (not (win(s)))
  99. #
  100. #
  101. # def second(s):
  102. # return first(s + 3) and first(s * 2) and not (win(s))
  103. #
  104. #
  105. # def third(s):
  106. # return (second(s + 3) or second(s * 2)) and (not (win(s)))
  107. #
  108. #
  109. # def fourth(s):
  110. # return (third(s + 3) or first(s + 3)) and (third(s * 2) or first(s * 2)) and not (win(s))
  111. #
  112. #
  113. # for i in range(1, 29):
  114. # if third(i) and not (second(i)):
  115. # print(i, end=' ')
  116. #
  117. # print('\n')
  118. # for i in range(1, 29):
  119. # if fourth(i) and not(second(i)):
  120. # print(i, end=' ')
  121.  
  122. # a = [0]
  123. # for line in open('maam.txt').readlines():
  124. # number, time, add = line.split('\t')
  125. # a.append(0)
  126. # for j in add.split(';'):
  127. # a[int(number)] = max(a[int(number)], a[int(j)])
  128. # a[int(number)] += int(time)
  129. # print(max(a))
  130.  
  131. # def f(x, y):
  132. # if x > y:
  133. # return 0
  134. # elif x == y:
  135. # return 1
  136. # else:
  137. # return f(x + 1, y) + f(x + 2, y)
  138. #
  139. #
  140. # print(f(3, 8) * f(8, 13))
  141.  
  142. # def f(n):
  143. # str_n = str(n)
  144. # s1 = (int(str_n[0]) * int(str_n[1]))
  145. # s2 = (int(str_n[1]) * int(str_n[2]))
  146. # return int(str(min(s1, s2)) + str(max(s1, s2)))
  147. #
  148. #
  149. # for i in range(100, 1000):
  150. # if f(i) == 832:
  151. # print(i)
  152.  
  153. # n = 1024 ** 29 - 64 ** 47 + 3 * 512 - 32
  154. # a = []
  155. # while n > 0:
  156. # a.append(n % 4)
  157. # n //= 4
  158. # print(sum(a))
  159.  
  160. # def f(n):
  161. # bin_n = bin(n).removeprefix('0b')
  162. # s = ""
  163. # for i in str(bin_n):
  164. # if i == "1":
  165. # s += "01"
  166. # elif i == "0":
  167. # s += "10"
  168. # return s
  169. #
  170. #
  171. # for i in range(1, 100):
  172. # print(int(f(i), 2), "--", f(i), i)
  173.  
  174.  
  175. # F = ¬((w ∨ ¬ y) ∧ x) ∨ (y ≡ z)
  176. # print('x y z w')
  177. # for x in range(2):
  178. # for y in range(2):
  179. # for z in range(2):
  180. # for w in range(2):
  181. # f = (not(((w or (not y))) and x)) or (y == z)
  182. # if not f:
  183. # print(x, y, z, w)
  184.  
  185. # def f(n):
  186. # str_n = bin(n).removeprefix('0b')
  187. # summax = 0
  188. # for i in str_n:
  189. # summax += int(i)
  190. # if summax % 2 == 0:
  191. #
  192. import math
  193. import turtle as t
  194.  
  195. # Повтори 2 [Вперёд 10 Направо 90 Вперёд 20 Направо 90]
  196. #
  197. # Поднять хвост
  198. #
  199. # Вперёд 3
  200. #
  201. # Направо 90
  202. #
  203. # Вперёд 7
  204. #
  205. # Налево 90
  206. #
  207. # Опустить хвост
  208. #
  209. # Повтори 2 [Вперёд 70 Направо 90 Вперёд 90 Направо 90].
  210.  
  211. # t.tracer(0, 0)
  212. # t.left(0)
  213. # k = 15
  214. #
  215. # for i in range(2):
  216. # t.forward(10 * k)
  217. # t.right(90)
  218. # t.forward(20 * k)
  219. # t.right(90)
  220. #
  221. # t.up()
  222. # t.forward(3 * k)
  223. # t.right(90)
  224. # t.forward(7 * k)
  225. # t.left(90)
  226. # t.down()
  227. # for i in range(2):
  228. # t.forward(70)
  229. # t.right(90)
  230. # t.forward(90 * k)
  231. # t.right(90)
  232. #
  233. # t.up()
  234. #
  235. # for x in range(-20, 20):
  236. # for y in range(-20, 20):
  237. # t.goto(x * k, y * k)
  238. # t.dot(4)
  239. #
  240. # t.update()
  241. # t.mainloop()
  242.  
  243. # with open('1-1.txt') as file:
  244. # s = file.readline()
  245. #
  246. # max_l = 0
  247. # cur_l = 1
  248. #
  249. # for i in range(len(s) - 1):
  250. # if s[i] != s[i + 1]:
  251. # cur_l += 1
  252. # max_l = max(max_l, cur_l)
  253. # else:
  254. # cur_l = 1
  255. # print(max_l)
  256.  
  257. # with open('1-2.txt') as file:
  258. # s = file.readline()
  259. #
  260. # max_l = 0
  261. # cur_l = 1
  262. #
  263. # for i in range(len(s) - 1):
  264. # if not(s[i] == 'I' and s[i + 1] == 'T') and not(s[i] == 'T' and s[i + 1] == 'I'):
  265. # cur_l += 1
  266. # max_l = max(cur_l, max_l)
  267. # else:
  268. # cur_l = 1
  269. # print(max_l)
  270.  
  271. # with open('1-3.txt') as f:
  272. # s = f.readline()
  273. #
  274. # cur_l = 0
  275. #
  276. # for i in range(len(s) - 2):
  277. # if (s[i] in 'AEF') and (s[i + 1] in 'ABC') and (s[i + 2] not in 'AE') and (s[i] != s[i + 1] and s[i] != s[i + 2] and s[i + 1] != s[i + 2]):
  278. # cur_l += 1
  279. # print(s[i], s[i + 1], s[i + 2], i, i + 1, i + 2)
  280. # print(cur_l)
  281.  
  282. # with open('1-4.txt') as f:
  283. # s = f.readline()
  284. #
  285. # c = 'CAT'
  286. # while c in s:
  287. # c += 'CAT'
  288. #
  289. # if c[:-1:] in s:
  290. # print(len(c) - 1)
  291. # elif c[:-2:] in s:
  292. # print(len(c) - 2)
  293. # elif c[:-3:] in s:
  294. # print(len(c) - 3, s.find(c))
  295.  
  296.  
  297. # with open ('1-3.txt') as f:
  298. # s = f.readline()
  299. #
  300. # cur = 0
  301. #
  302. # for i in range(len(s) - 4):
  303. # if (s[i] in 'AEC') and (s[i + 1] != s[i] and s[i + 1] != s[i + 2]) and (s[i + 2] in 'ADF') and (s[i + 3] == s[i]):
  304. # cur += 1
  305. # print(cur)
  306.  
  307. # with open('1-1.txt') as f:
  308. # s = f.readline()
  309. #
  310. # cur_l = 1
  311. # max_l = 0
  312. #
  313. # for i in range(len(s) - 1):
  314. # if (s[i] != s[i + 1]) or (s[i] == 'Z' and s[i + 1] == 'Z'):
  315. # cur_l += 1
  316. # max_l = max(max_l, cur_l)
  317. # else:
  318. # cur_l = 1
  319. # print(max_l)
  320.  
  321. # with open ('1-2.txt') as f:
  322. # s = f.readline()
  323. #
  324. # cur = 0
  325. #
  326. # for i in range(len(s) - 4):
  327. # res = s[i] + s[i + 1] + s[i + 2] + s[i + 3] + s[i + 4]
  328. # if res == res[::-1]:
  329. # cur += 1
  330. #
  331. # print(cur)
  332.  
  333. # with open('2-2.txt') as f:
  334. # s = f.readline()
  335. #
  336. # cur = 1
  337. # c = s[0]
  338. # max_l = 0
  339. #
  340. # a = []
  341. #
  342. # for i in range(len(s) - 1):
  343. # if s[i] <= s[i + 1]:
  344. # cur += 1
  345. # c += s[i + 1]
  346. # max_l = max(cur, max_l)
  347. # else:
  348. # a.append(c)
  349. # c = s[i + 1]
  350. # cur = 1
  351. # print(max_l, a)
  352. #
  353. # for j in a:
  354. # if len(j) == max_l:
  355. # print(j, max_l)
  356. # break
  357.  
  358. # with open('2-3.txt') as f:
  359. # s = f.readline()
  360. #
  361. # c = ''
  362. #
  363. # a = []
  364. #
  365. # print(s)
  366. #
  367. # for i in range(len(s)):
  368. # if s[i].isdigit():
  369. # c += s[i]
  370. # else:
  371. # a.append(c)
  372. # c = ''
  373. #
  374. # max_r = 0
  375. #
  376. # for x in a:
  377. # if x.isdigit() and int(x) % 2 == 1 and int(x) > max_r:
  378. # max_r = max(max_r, int(x))
  379. # print(max_r)
  380.  
  381. # with open('2-4.txt') as f:
  382. # s = f.readline()
  383. #
  384. # stringa = ''
  385. # a = []
  386. # flag = 'MOON'
  387. #
  388. # for i in range(len(s)):
  389. # if flag in stringa + s[i] or i == len(s) - 1:
  390. # a.append(stringa)
  391. # stringa = ''
  392. # else:
  393. # stringa += s[i]
  394. #
  395. # print(a)
  396. # max_ans = 0
  397. #
  398. # for x in range(len(a)):
  399. # max_ans = max(max_ans, len(a[x]))
  400. # print(max_ans)
  401. #
  402. # with open('2-4.txt') as file:
  403. # s = file.readline()
  404. #
  405. # s = s.replace('MOON', 'MOO OON')
  406. #
  407. # # print(s)
  408. #
  409. # stringa = ''
  410. # a = []
  411. #
  412. # for i in range(len(s)):
  413. # if s[i] != ' ':
  414. # stringa = stringa + s[i]
  415. # a.append(stringa)
  416. # else:
  417. # stringa = ''
  418. # print(a)
  419. # max_ans = 0
  420. #
  421. # for x in range(len(a)):
  422. # max_ans = max(max_ans, len(a[x]))
  423. # print(max_ans)
  424.  
  425. # c = 0
  426. # a = []
  427. #
  428. # with open('2-5.txt') as file:
  429. # for line in file:
  430. # line.replace('\n', '')
  431. # a.append(line)
  432. #
  433. # for i in a:
  434. # flag = 0
  435. # for j in range(len(i) - 4):
  436. # if i[j] == "M" and i[j + 2] == "H" and i[j + 3] == "P":
  437. # flag = 1
  438. # if flag:
  439. # c += 1
  440. # print(c)
  441.  
  442. # a = [] # массив строк
  443. # index_for_f = 0
  444. # c = 0
  445. # max_f = 10 ** 100
  446. # alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  447. # z = []
  448. #
  449. # with open('2-5.txt') as f:
  450. # for line in f:
  451. # line = line.replace('\n', '')
  452. # a.append(line)
  453. #
  454. # for i in a:
  455. # z.append(i.count('F'))
  456. #
  457. # print(z)
  458. # strtr = ''
  459. #
  460. # for i in range(len(a)):
  461. # if a[i].count('F') == min(z):
  462. # strtr = a[i]
  463. # # print(a[i])
  464. # break
  465. #
  466. #
  467. # for i in range(len(a)):
  468. # working_object = a[i]
  469. # if working_object.count('F') == max_f:
  470. # c += 1
  471. #
  472. #
  473. # cur = 0
  474. #
  475. # for line in a:
  476. # cur += line.count('R')
  477. #
  478. # print(cur)
  479.  
  480. # stR = a[index_for_f]
  481. #
  482. # print(stR)
  483. #
  484. #
  485. # for i in alphabet:
  486. # print(strtr.count(i), i)
  487. #
  488. # max_quantity = - 10 ** 10
  489. # letter_quantity = ''
  490. #
  491. # for i in range(len(stR)):
  492. # if stR.count(stR[i]) > max_quantity:
  493. # max_quantity = stR.count(stR[i])
  494. # letter_quantity = stR[i]
  495. # print()
  496.  
  497. # with open('2-2.txt') as file:
  498. # s = file.readline()
  499. #
  500. # a = []
  501. # cur = 0
  502. #
  503. # for i in range(len(s) - 9):
  504. # if s[i] <= s[i + 1] <= s[i + 2] <= s[i + 3] <= s[i + 4] <= s[i + 5] <= s[i + 6] <= s[i + 7] <= s[i + 8]:
  505. # a.append(s[i] + s[i + 1] + s[i + 2] + s[i + 3] + s[i + 4] + s[i + 5] + s[i + 6] + s[i + 7] + s[i + 8])
  506. # cur += 1
  507. #
  508. # print(a)
  509. #
  510. # print(a[0], cur)
  511.  
  512. # with open('2-3.txt') as file:
  513. # s = file.readline()
  514. # иди через строчки, а не через инты
  515. # number = []
  516. # numb = ''
  517. #
  518. # cur = 0
  519. # for i in range(len(s)):
  520. # if s[i].isdigit():
  521. # numb += s[i]
  522. # else:
  523. # if numb != '':
  524. # number.append(int(numb))
  525. # numb = ''
  526. #
  527. # print(number)
  528. #
  529. # for i in range(len(number)):
  530. # try:
  531. # if int(number[i]) % 3 == 0 and len(str(number[i]) == 5:
  532. # cur += 1
  533. # print(number[i])
  534. # except:
  535. # pass
  536. # print(cur)
  537.  
  538. # with open('2-6.txt') as f:
  539. # s = f.readline()
  540. #
  541. # s = s.replace('PEP8', 'PEP EP8')
  542. # cur = 0
  543. # a = []
  544. # add = ''
  545. #
  546. # for i in range(len(s)):
  547. # if s[i] != ' ':
  548. # add += s[i]
  549. # else:
  550. # a.append(add)
  551. # add = ''
  552. # print(a)
  553. #
  554. # max_ans = 0
  555. # for i in a:
  556. # max_ans = max(max_ans, len(i))
  557. # print(max_ans)
  558.  
  559.  
  560. # a = []
  561. # with open('2-5.txt') as f:
  562. # for line in f:
  563. # line = line.replace('\n', '')
  564. # a.append(line)
  565. #
  566. # max_spree = 0
  567. # letter = ''
  568. # index = 0
  569. # alphabet = 'ABCDEFGHIJKLMOPQRSTUVWXYZ'
  570. # alphabet = alphabet[::-1]
  571. #
  572. # for x in range(len(a)):
  573. # work_str = a[x]
  574. # cur = 1
  575. # for i in range(len(work_str) - 1):
  576. # if work_str[i] == work_str[i + 1]:
  577. # cur += 1
  578. # if cur > max_spree:
  579. # letter = work_str[i]
  580. # index = x
  581. # max_spree = max(cur, max_spree)
  582. # else:
  583. # cur = 1
  584. #
  585. # current_string = a[index]
  586. # minim = 10 ** 10
  587. # min_elem = ''
  588. #
  589. # for elem in alphabet:
  590. # if current_string.count(elem) < minim:
  591. # minim = current_string.count(elem)
  592. # min_elem = elem
  593. # # print(current_string.count(elem), elem)
  594. # print(minim, min_elem)
  595. #
  596. # summmma = 0
  597. #
  598. # for x in a:
  599. # summmma += x.count('U')
  600. # print(summmma)
  601. # # print(max_spree, letter, index)
  602.  
  603. # with open('1-1.txt') as f:
  604. # s = f.readline()
  605. #
  606. # cur = 1
  607. # max_cur = 0
  608. #
  609. # for i in range(len(s) - 1):
  610. # if s[i] == s[i + 1] and s[i] == 'X':
  611. # cur += 1
  612. # max_cur = max(max_cur, cur)
  613. # else:
  614. # cur = 1
  615. # print(max_cur)
  616.  
  617. # with open('1-5.txt') as file:
  618. # s = file.readline()
  619. #
  620. # flag = 'HA'
  621. #
  622. # while flag in s:
  623. # flag += 'HA'
  624. # print(flag)
  625. # print(s.count(flag))
  626. #
  627. # flag = flag[:len(flag) - 1:]
  628. #
  629. # print(s.count(flag))
  630. #
  631. # print(len(flag))
  632.  
  633. # with open('3-1.txt') as file:
  634. # s = file.readline()
  635. #
  636. # number = []
  637. # add = ''
  638. #
  639. # for i in range(len(s)):
  640. # if s[i].isdigit():
  641. # add += s[i]
  642. # else:
  643. # number.append(add)
  644. # add = ''
  645. #
  646. # cur = 0
  647. # max_res = 0
  648. #
  649. # for i in range(len(number)):
  650. # try:
  651. # if int(number[i]) % 3 == 0 and number[i][0] != '0':
  652. # max_res = max(max_res, int(number[i]))
  653. # except:
  654. # pass
  655. # print(max_res)
  656.  
  657. # with open('3-2.txt') as file:
  658. # s = file.readline()
  659. #
  660. # pair_count = 0
  661. # cur = 0
  662. # index = 0
  663. # sd = ''
  664. # a = []
  665. # max_res = 0
  666. #
  667. # while index < (len(s) - 1):
  668. # if (s[index] == 'H' and s[index + 1] == "I") or (s[index] == 'F' and s[index + 1] == "I"):
  669. # cur += 2
  670. # # print(index)
  671. # sd += s[index] + s[index + 1]
  672. # pair_count = max(cur, pair_count)
  673. # index += 2
  674. # else:
  675. # # print(index)
  676. # a.append(sd)
  677. # cur = 0
  678. # index += 1
  679. # sd = ''
  680. # # print(pair_count)
  681. # for i in a:
  682. # if len(i) > max_res:
  683. # max_res = len(i)
  684. # # print(max_res)
  685. # print(a)
  686.  
  687. # with open('3-1.txt') as f:
  688. # s = f.readline()
  689. #
  690. # word = ''
  691. # c = 0
  692. # dictionary = []
  693. #
  694. # for i in range(len(s)):
  695. # if not s[i].isdigit():
  696. # word += s[i]
  697. # else:
  698. # dictionary.append(word)
  699. # word = ''
  700. # for i in range(len(dictionary)):
  701. # if len(dictionary[i]) == 5:
  702. # c += 1
  703. # print(dictionary[i])
  704. # # print(c)
  705. # print(dictionary) #важно добавить циферку/буковку в конец файла, чтобы всё нужное попало в массив!!!!!!!!!
  706.  
  707. # a = []
  708. #
  709. # with open('3-3.txt') as f:
  710. # s = f.readline()
  711. # add = ''
  712. # # print(s.count('CAB') - s.count('CABDEF'))
  713. # for i in range(len(s)):
  714. # add = ''
  715. # if s[i] == 'B':
  716. # add += 'B'
  717. # for j in range(i + 1, len(s)):
  718. # add += s[j]
  719. # if s[j] == 'D':
  720. # break
  721. # a.append(add)
  722. # c = 0
  723. # for i in range(len(a)):
  724. # if 10 <= len(a[i]) <= 12:
  725. # c += 1
  726. # # print(c)
  727. # print(a)
  728.  
  729.  
  730. # with open('24_1302.txt') as file:
  731. # s = file.readline()
  732. #
  733. # s = s.replace('XZZY', 'XZZ ZZY')
  734. #
  735. # a = []
  736. # add = ''
  737. #
  738. # for i in range(len(s)):
  739. # if s[i] != ' ':
  740. # add += s[i]
  741. # else:
  742. # a.append(add)
  743. # add = ''
  744. #
  745. # max_ans = 0
  746. # for i in range(len(a)):
  747. # if len(a[i]) > max_ans:
  748. # max_ans = len(a[i])
  749. # print(max_ans)
  750.  
  751. # with open('24_1866.txt') as file:
  752. # s = file.readline()
  753. #
  754. # s = s.replace('ad', 'a d').replace('da', 'd a')
  755. #
  756. # a = []
  757. # add = ''
  758. #
  759. # for i in range(len(s)):
  760. # if s[i] != ' ':
  761. # add += s[i]
  762. # else:
  763. # a.append(add)
  764. # add = ''
  765. #
  766. # max_ans = 0
  767. # for i in range(len(a)):
  768. # if len(a[i]) > max_ans:
  769. # max_ans = len(a[i])
  770. # print(a, max_ans)
  771.  
  772. # a = []
  773. # for i in range(118811, 118973):
  774. # c = 0
  775. # for j in range(1, int(i ** 0.5) + 1):
  776. # if i % j == 0:
  777. # c += 1
  778. # if i // j != j:
  779. # c += 1
  780. # if c == 6:
  781. # a.append(i)
  782. # # delit = sort(delit)
  783. # # print(delit)
  784. # print(a)
  785. #
  786. # delit = []
  787. # for j in range(1, int(a[2] ** 0.5) + 1):
  788. # if a[2] % j == 0:
  789. # delit.append(j)
  790. # if a[2] // j != j:
  791. # c += 1
  792. # delit.append(a[2] // j)
  793. # delit.sort()
  794. # print(delit)
  795.  
  796. # res = []
  797. # for i in range(190201, 190281):
  798. # a = []
  799. # c = 0
  800. # for j in range(1, int(i ** 0.5) + 1):
  801. # if i % j == 0:
  802. # if j % 2 == 0:
  803. # c += 1
  804. # if i // j != j:
  805. # if (i // j) % 2 == 0:
  806. # c += 1
  807. # if c == 4:
  808. # res.append(i)
  809. # print(res)
  810. # z = []
  811. # for j in range(1, int(res[1] ** 0.5) + 1):
  812. # if res[1] % j == 0:
  813. # if j % 2 == 0:
  814. # z.append(j)
  815. # if res[1] // j != j:
  816. # if (res[1] // j) % 2 == 0:
  817. # z.append(res[1] // j)
  818. # z.sort(reverse=True)
  819. # print(z)
  820.  
  821. ans = []
  822.  
  823. # for i in range(2943444, 2943530):
  824. # c = 0
  825. # for j in range(1, int(i ** 0.5) + 1):
  826. # if i % j == 0:
  827. # c += 1
  828. # if i // j != j:
  829. # c += 1
  830. # if c == 2:
  831. # ans.append(i)
  832. # ans.sort()
  833. # for i in ans:
  834. # print(i, end=' ')
  835.  
  836. # ans = []
  837. # for i in range(2532000, 2532161):
  838. # c = 0
  839. # for j in range(1, int(i ** 0.5 ) + 1):
  840. # if i % j == 0:
  841. # c += 1
  842. # if i // j != j:
  843. # c += 1
  844. # if c == 2:
  845. # ans.append(i)
  846. # if len(ans) == 5:
  847. # ans.sort()
  848. # for q in ans:
  849. # print(q, end = ' ')
  850. # break
  851.  
  852. # ans = []
  853. # for i in range(2532000, 2532161):
  854. # c = 0
  855. # for j in range(1, int(i ** 0.5) + 1):
  856. # if i % j == 0:
  857. # c += 1
  858. # if i // j != j:
  859. # c += 1
  860. # if c == 2:
  861. # ans.append(i)
  862. # ans.sort()
  863. # print(ans)
  864. # for i in range(0, len(ans), 3):
  865. # print(ans[i], end=' ')
  866.  
  867. # ans = []
  868. # for i in range(2, 20000):
  869. # c = 0
  870. # for j in range(1, int(i ** 0.5) + 1):
  871. # if i % j == 0:
  872. # c += 1
  873. # if i // j != j:
  874. # c += 1
  875. # if c == 2:
  876. # ans.append(i)
  877. # print(len(ans))
  878.  
  879. # ans = []
  880. # for i in range(3661, 33625):
  881. # c = 0
  882. # for j in range(1, int(i ** 0.5) + 1):
  883. # if i % j == 0:
  884. # c += 1
  885. # if i // j != j:
  886. # c += 1
  887. # if c == 3:
  888. # ans.append(i)
  889. # print(len(ans))
  890.  
  891. # ans = []
  892. # for i in range(81234, 134689):
  893. # c = 0
  894. # for j in range(1, int(i ** 0.5) + 1):
  895. # if i % j == 0:
  896. # c += 1
  897. # if i // j != j:
  898. # c += 1
  899. # if c == 5:
  900. # ans.append(i)
  901. # print(ans)
  902. # for x in ans:
  903. # delit = []
  904. # for j in range(2, int(x ** 0.5) + 1):
  905. # if x % j == 0:
  906. # delit.append(j)
  907. # if x // j != j:
  908. # delit.append(x // j)
  909. # print(min(delit), max(delit))
  910.  
  911. # a = []
  912. # for i in range(394441, 394506):
  913. # c = 0
  914. # for j in range(1, int(i ** 0.5) + 1):
  915. # if i % j == 0:
  916. # c += 1
  917. # if i // j != j:
  918. # c += 1
  919. # a.append(c)
  920. # d = max(a)
  921. # print(d)
  922. # for i in range(394441, 394506):
  923. # c = 0
  924. # delit = []
  925. # for j in range(1, int(i ** 0.5) + 1):
  926. # if i % j == 0:
  927. # c += 1
  928. # delit.append(j)
  929. # if i // j != j:
  930. # c += 1
  931. # delit.append(i // j)
  932. # if c == 48:
  933. # delit.sort()
  934. # print(delit)
  935. # break
  936.  
  937. # ans = []
  938. # for i in range(194441, 196501):
  939. # c = 0
  940. # for j in range(1, int(i ** 0.5) + 1):
  941. # if i % j == 0:
  942. # c += 1
  943. # if i // j != j:
  944. # c += 1
  945. # if c % 2 == 1:
  946. # ans.append(i)
  947. #
  948. # w_num = ans[2]
  949. # c = 0
  950. # for j in range(1, int(w_num ** 0.5) + 1):
  951. # if w_num % j == 0:
  952. # c += 1
  953. # if w_num // j != j:
  954. # c += 1
  955. # if j ** 2 == w_num:
  956. # print(j)
  957. # print(c, w_num)
  958.  
  959. # ans = []
  960. # for i in range(1686, 13277):
  961. # flag = 1
  962. # num = i
  963. # while num > 0:
  964. # if num % 10 % 2 == 0:
  965. # flag = 0
  966. # num //= 10
  967. # if flag:
  968. # ans.append(i)
  969. #
  970. # print(ans)
  971. # summa = 0
  972. # for i in ans:
  973. # num = i
  974. # while num > 0:
  975. # summa += num % 10
  976. # num //= 10
  977. # print(summa)
  978.  
  979. # ans = []
  980. # for i in range(326496, 649633):
  981. # c_Nech = 0
  982. # c_Chet = 0
  983. # cntr = 0
  984. # for j in range(1, int(i ** 0.5) + 1):
  985. # if i % j == 0:
  986. # cntr += 1
  987. # if j % 2 == 0:
  988. # c_Chet += 1
  989. # if j % 2 == 1:
  990. # c_Nech += 1
  991. # if i // j != j:
  992. # cntr += 1
  993. # if (i // j) % 2 == 0:
  994. # c_Chet += 1
  995. # if (i // j) % 2 == 1:
  996. # c_Nech += 1
  997. # if c_Nech == c_Chet and c_Nech >= 70:
  998. # ans.append(i)
  999.  
  1000. # ans = [450450, 589050, 630630]
  1001. #
  1002. # for i in ans:
  1003. # for j in range(1000, i):
  1004. # if i % j == 0:
  1005. # print(i, j)
  1006. # break
  1007.  
  1008. # start, end = 326496, 649632
  1009. #
  1010. # def allDivs( x ):
  1011. # divs = [1, x]
  1012. # d = 2
  1013. # while d*d <= x:
  1014. # if x % d == 0:
  1015. # divs.append( d )
  1016. # if x // d > d:
  1017. # divs.append( x//d )
  1018. # d += 1
  1019. # return sorted(divs)
  1020. #
  1021. # for x in range( start, end+1 ):
  1022. # divs = allDivs(x)
  1023. # even = [d for d in divs if d % 2 == 0]
  1024. # odd = [d for d in divs if d % 2 == 1]
  1025. # if len(odd) == len(even) and len(even) >= 70:
  1026. # print( x, min( d for d in divs if d > 1000 ) )
  1027. # есть вот такой вариант, но он тоже не быстрый
  1028.  
  1029. ans = []
  1030.  
  1031. # def d(x):
  1032. # dels = set()
  1033. # for d in range(1, int(x ** 0.5) + 1):
  1034. # if x % d == 0:
  1035. # if d % 2 != 0:
  1036. # dels.add(d)
  1037. # if (x // d) % 2 != 0:
  1038. # dels.add(x // d)
  1039. # if (int(x ** 0.5) ** 2 == x):
  1040. # dels.add(int(x ** 0.5))
  1041. # dels = sorted(dels)
  1042. # return dels
  1043. #
  1044. #
  1045. # for i in range(326496, 649633):
  1046. # c = 0
  1047. # if i % 2 == 0 and i % 4 != 0:
  1048. # if len(d(i)) >= 70:
  1049. # for j in range(1000, i):
  1050. # if i % j == 0:
  1051. # print(i, j)
  1052. # break
  1053.  
  1054. # def is_prime(n): # для делителей
  1055. # c = 0
  1056. # for i in range(1, int(n ** 0.5) + 1):
  1057. # if n % i == 0:
  1058. # c += 1
  1059. # if n // i != i:
  1060. # c += 1
  1061. # if c == 2:
  1062. # return 1
  1063. # else:
  1064. # return 0
  1065. #
  1066. #
  1067. # # 1 - НЕ ПРОСТОЕ ЧИСЛО!!!!
  1068. # ans = []
  1069. # for i in range(125697, 190234):
  1070. # for j in range(2, int(i ** 0.5) + 1):
  1071. # if i % j == 0:
  1072. # if is_prime(j) and is_prime(i // j) and j != (i // j): #чел, они различные
  1073. # ans.append(i)
  1074. # print(ans, len(ans), max(ans))
  1075.  
  1076. # def check(n):
  1077. # flag = 1
  1078. # for i in range(2, n + 1):
  1079. # if i * i > n:
  1080. # break
  1081. # if n % (i * i) == 0:
  1082. # flag = 0
  1083. # break
  1084. # return flag
  1085. #
  1086. # ans = []
  1087. # summa = 0
  1088. # for i in range(2945, 18295):
  1089. # if check(i):
  1090. # ans.append(i)
  1091. #
  1092. # for i in ans:
  1093. # work = i
  1094. # while work > 0:
  1095. # summa += work % 10
  1096. # work //= 10
  1097. # print(summa)
  1098. #
  1099.  
  1100. # def is_prime(n):
  1101. # cntr = 0
  1102. # for j in range(1, int(n ** 0.5) + 1):
  1103. # if n % j == 0:
  1104. # cntr += 1
  1105. # if n // j != j:
  1106. # cntr += 1
  1107. # if cntr == 2:
  1108. # return 1
  1109. # else:
  1110. # return 0
  1111. #
  1112. #
  1113. # c = 1
  1114. # for i in range(194441, 196501):
  1115. # if is_prime(i) == 1 and i % 100 == 93:
  1116. # print(c, i)
  1117. # c += 1
  1118. # 1 195193
  1119. # 2 195493
  1120. # 3 195593
  1121. # 4 195893
  1122. # 5 196193
  1123.  
  1124. # def is_unique(n):
  1125. # work_str = str(n)
  1126. # if int(work_str[0]) % 2 == 1 and int(work_str[1]) % 2 == 1 and int(work_str[2]) % 2 == 0 \
  1127. # and int(work_str[3]) % 2 == 0 and int(work_str[4]) % 2 == 0:
  1128. # return 1
  1129. # else:
  1130. # return 0
  1131. #
  1132. #
  1133. # ans = []
  1134. # for i in range(57888, 74556):
  1135. # if is_unique(i):
  1136. # if i % 7 != 0 and i % 9 != 0 and i % 13 != 0:
  1137. # ans.append(i)
  1138. # print(len(ans), max(ans) - min(ans))
  1139.  
  1140. # dev = []
  1141. # for i in range(2, 50):
  1142. # dev.clear()
  1143. # for j in range(1, int(i ** 0.5) + 1):
  1144. # if i % j == 0:
  1145. # dev.append(j)
  1146. # if i // j != j:
  1147. # dev.append(i // j)
  1148. # dev.sort()
  1149. # print(dev, i)
  1150.  
  1151. # a = []
  1152. # for i in range(78920, 92431):
  1153. # c = 0
  1154. # for j in range(1, int(i ** 0.5) + 1):
  1155. # if i % j == 0:
  1156. # c += 1
  1157. # if i // j != j:
  1158. # c += 1
  1159. # if c == 5:
  1160. # a.append(i)
  1161. # print(a)
  1162. # for elem in a:
  1163. # dev = []
  1164. # for j in range(1, int(elem ** 0.5) + 1):
  1165. # if elem % j == 0:
  1166. # dev.append(j)
  1167. # if elem // j != j:
  1168. # dev.append(elem // j)
  1169. # dev.sort()
  1170. # for t in dev:
  1171. # print(t, end=' ')
  1172. # print()
  1173.  
  1174. # def is_prime(n):
  1175. # cntr = 0
  1176. # for j in range(1, int(n ** 0.5) + 1):
  1177. # if n % j == 0:
  1178. # cntr += 1
  1179. # if n // j != j:
  1180. # cntr += 1
  1181. # if cntr == 2:
  1182. # return 1
  1183. # else:
  1184. # return 0
  1185. #
  1186. # ans = []
  1187. # for i in range(3532000, 3532161):
  1188. # if is_prime(i):
  1189. # ans.append(i)
  1190. # ans.sort(reverse=True)
  1191. # for i in ans:
  1192. # print(i, end=' ')
  1193.  
  1194. # def is_prime(n):
  1195. # cntr = 0
  1196. # for j in range(1, int(n ** 0.5) + 1):
  1197. # if n % j == 0:
  1198. # cntr += 1
  1199. # if n // j != j:
  1200. # cntr += 1
  1201. # if cntr == 2:
  1202. # return 1
  1203. # else:
  1204. # return 0
  1205. #
  1206. # ans = []
  1207. # for i in range(2532000, 2532161):
  1208. # if is_prime(i) and i % 10 == 7:
  1209. # ans.append(i)
  1210. # ans.sort()
  1211. # print(ans)
  1212.  
  1213. # def check(n):
  1214. # flag = 1
  1215. # for i in range(2, n):
  1216. # if i * i > n:
  1217. # break
  1218. # if n % (i * i) == 0:
  1219. # flag = 0
  1220. # break
  1221. # return flag
  1222. #
  1223. # ans = []
  1224. # for i in range(2945, 18295):
  1225. # if check(i):
  1226. # ans.append(i)
  1227. # summa = 0
  1228. # for x in ans:
  1229. # work = x
  1230. # while work > 0:
  1231. # summa += work % 10
  1232. # work //= 10
  1233. # print(summa)
  1234.  
  1235. # def to_eleven(n):
  1236. # work = n
  1237. # s = ''
  1238. # while work > 0:
  1239. # s += str((work % 11))
  1240. # work //= 11
  1241. # s = s[::-1]
  1242. # if '2' in s:
  1243. # return 0
  1244. # else:
  1245. # return 1
  1246. #
  1247. # ans = []
  1248. # for i in range(2031, 14313):
  1249. # if to_eleven(i):
  1250. # ans.append(i)
  1251. # print(max(ans))
  1252.  
  1253. # def is_prime(n):
  1254. # cntr = 0
  1255. # for j in range(1, int(n ** 0.5) + 1):
  1256. # if n % j == 0:
  1257. # cntr += 1
  1258. # if n // j != j:
  1259. # cntr += 1
  1260. # if cntr == 2:
  1261. # return 1
  1262. # else:
  1263. # return 0
  1264. #
  1265. # ans = []
  1266. # for i in range(2948, 20195):
  1267. # if is_prime(i):
  1268. # ans.append(i)
  1269. # print(max(ans))
  1270.  
  1271. # ans = []
  1272. # for i in range(326496, 649633):
  1273. # even_c = 0
  1274. # odd_c = 0
  1275. # for j in range(1, int(i ** 0.5) + 1):
  1276. # if i % j == 0:
  1277. # if j % 2 == 0:
  1278. # even_c += 1
  1279. # else:
  1280. # odd_c += 1
  1281. # if i // j != j:
  1282. # if (i // j) % 2 == 0:
  1283. # even_c += 1
  1284. # else:
  1285. # odd_c += 1
  1286. # if even_c >= 70 and odd_c >= 70:
  1287. # ans.append(i)
  1288.  
  1289. # ans = [450450, 589050, 630630]
  1290. # delit = []
  1291. # work = ans[0]
  1292. # for j in range(1, int(work ** 0.5) + 1):
  1293. # if work % j == 0:
  1294. # delit.append(j)
  1295. # if work // j != j:
  1296. # delit.append(work // j)
  1297. # delit.sort()
  1298. # print(delit)
  1299.  
  1300. # def check(n):
  1301. # flag = 1
  1302. # work = n
  1303. # while work > 0:
  1304. # if work % 10 % 2 == 0:
  1305. # flag = 0
  1306. # break
  1307. # work //= 10
  1308. # return flag
  1309. #
  1310. # ans = []
  1311. # for i in range(1686, 13277):
  1312. # if check(i):
  1313. # ans.append(i)
  1314. #
  1315. # summa = 0
  1316. # for elem in ans:
  1317. # copy = elem
  1318. # while copy > 0:
  1319. # summa += copy % 10
  1320. # copy //= 10
  1321. # print(summa)
  1322.  
  1323. # absolute_maxx = 0
  1324. # maxx = 0
  1325. # flag = 0
  1326. # number_of_deviders = 0
  1327.  
  1328. # dev = []
  1329. # for i in range(394480, 394541):
  1330. # c = 0
  1331. # for j in range(1, int(i ** 0.5) + 1):
  1332. # if i % j == 0:
  1333. # c += 1
  1334. # if i // j != j:
  1335. # c += 1
  1336. # dev.append(c)
  1337. # cntr = 0
  1338. # for i in range(len(dev)):
  1339. # if dev[i] == max(dev):
  1340. # cntr += 1
  1341. # print(i)
  1342. # print(cntr)
  1343. #
  1344. # #индексы наших чисел - 5, 20, 26, 44
  1345. # cntr = 0
  1346. # for i in range(394480, 394541):
  1347. # if cntr == 26:
  1348. # print(i)
  1349. # break
  1350. # cntr += 1
  1351.  
  1352. # a = []
  1353. # for i in range(573213, 575341):
  1354. # c = 0
  1355. # for j in range(1, int(i ** 0.5) + 1):
  1356. # if i % j == 0:
  1357. # c += 1
  1358. # if i // j != j:
  1359. # c += 1
  1360. # if c == 4:
  1361. # a.append(i)
  1362. #
  1363. # summa_div = []
  1364. # print(a)
  1365. # min_summ = 10 ** 10
  1366. # min_i = 0
  1367. #
  1368. # for i in range(len(a)):
  1369. # c = 0
  1370. # summa = 0
  1371. # for j in range(1, int(a[i] ** 0.5) + 1):
  1372. # if a[i] % j == 0:
  1373. # summa += j
  1374. # if a[i] // j != j:
  1375. # summa += (a[i] // j)
  1376. # if summa < min_summ:
  1377. # min_summ = summa
  1378. # min_i = i
  1379. # summa_div.append(summa)
  1380. #
  1381. # print(min_i, a[50], summa_div[50])
  1382. # 573431 967 593 1
  1383.  
  1384. # ans = []
  1385. # for i in range(100715, 100743):
  1386. # c = 0
  1387. # for j in range(1, int(i ** 0.5) + 1):
  1388. # if i % j == 0:
  1389. # c += 1
  1390. # if i // j != j:
  1391. # c += 1
  1392. # if c == 4:
  1393. # ans.append(i)
  1394. # # print(ans)
  1395. # print(len(ans))
  1396. #
  1397. # for i in ans:
  1398. # print(i, end=' ')
  1399. # for j in range(2, int(i ** 0.5) + 1):
  1400. # if i % j == 0:
  1401. # if i // j != j:
  1402. # print(i // j, j)
  1403. # 100715 20143 5
  1404. # 100718 50359 2
  1405. # 100721 2143 47
  1406. # 100723 14389 7
  1407. # 100726 50363 2
  1408. # 100727 9157 11
  1409. # 100729 383 263
  1410. # 100731 33577 3
  1411. # 100735 20147 5
  1412. # 100739 769 131
  1413.  
  1414. # delit = []
  1415. # for i in range(244441, 244506):
  1416. # c = 0
  1417. # for j in range(1, int(i ** 0.5) + 1):
  1418. # if i % j == 0:
  1419. # c += 1
  1420. # if i // j != j:
  1421. # c += 1
  1422. # delit.append(c)
  1423. # print(delit, max(delit), sep='\n')
  1424. # t = 0
  1425. # for i in delit:
  1426. # if i == max(delit):
  1427. # break
  1428. # t += 1
  1429. # t = 59
  1430. # work = 244441 + 59
  1431. # for j in range(1, w)
  1432.  
  1433. # def f(n):
  1434. # c = 0
  1435. # for i in range(1, int(n ** 0.5) + 1):
  1436. # if n % i == 0:
  1437. # c += 1
  1438. # if n // i != i:
  1439. # c += 1
  1440. # return c
  1441. #
  1442. # ans = []
  1443. # for i in range(100715, 100743):
  1444. # if f(i) == 4:
  1445. # ans.append(i)
  1446. # # print(i, end=' ')
  1447. # for j in range(2, int(i ** 0.5) + 1):
  1448. # if i % j == 0:
  1449. # if i // j != j:
  1450. # print(i // j, j)
  1451. # print(ans)
  1452.  
  1453. # ans = []
  1454. # for i in range(620812, 622401):
  1455. # c_odd = 0
  1456. # for j in range(1, int(i ** 0.5) + 1):
  1457. # if i % j == 0:
  1458. # if j % 2 == 1:
  1459. # c_odd += 1
  1460. # if i // j != j:
  1461. # if (i // j) % 2 == 1:
  1462. # c_odd += 1
  1463. # if c_odd == 4:
  1464. # ans.append(i)
  1465. # #ans - массив чисел, у которых только 4 различных нечётных делителя
  1466. # delit = []
  1467. # for i in ans:
  1468. # summa = 0
  1469. # for j in range(1, int(i ** 0.5) + 1):
  1470. # if i % j == 0:
  1471. # if j % 2 == 1:
  1472. # summa += j
  1473. # if i // j != j:
  1474. # if (i // j) % 2 == 1:
  1475. # summa += (i // j)
  1476. # delit.append(summa)
  1477. # index_of_max = delit.index(max(delit))
  1478. # print(index_of_max)
  1479. # print(ans[index_of_max], max(delit))
  1480. # for i in range(len(delit)):
  1481. # if delit[i] == max(delit):
  1482. # print(i)
  1483. # break
  1484. # print(ans[429], max(delit))
  1485.  
  1486. # def is_prime(n):
  1487. # cntr = 0
  1488. # for j in range(1, int(n ** 0.5) + 1):
  1489. # if n % j == 0:
  1490. # cntr += 1
  1491. # if n // j != j:
  1492. # cntr += 1
  1493. # if cntr == 2:
  1494. # return 1
  1495. # else:
  1496. # return 0
  1497. #
  1498. # ans = []
  1499. # for i in range(194441, 196501):
  1500. # if is_prime(i) and i % 100 == 47:
  1501. # ans.append(i)
  1502. # ans.sort(reverse=True)
  1503. # print(ans)
  1504. # for i in ans:
  1505. # summa = 0
  1506. # work = i
  1507. # while work > 0:
  1508. # summa += work % 10
  1509. # work //= 10
  1510. # print(summa, i)
  1511.  
  1512. # def d(n):
  1513. # a = []
  1514. # summa = 0
  1515. # for i in range(2, int(n ** 0.5) + 1):
  1516. # if n % i == 0:
  1517. # if i % 2 == 1:
  1518. # summa += i
  1519. # a.append(i)
  1520. # if n // i != i:
  1521. # if (n // i) % 2 == 1:
  1522. # summa += (n // i)
  1523. # a.append(n // i)
  1524. # # a.sort()
  1525. # return sum(a)
  1526. # # print(a)
  1527. #
  1528. # # d(812322)
  1529. # begin = 812322
  1530. # c = 0
  1531. # while True:
  1532. # # print(d(begin))
  1533. # # c += 1
  1534. # # if c == 100:
  1535. # # break
  1536. # # begin += 1
  1537. # res = d(begin)
  1538. # if res % 205 == 21:
  1539. # print(begin, res)
  1540. # c += 1
  1541. # if c == 4:
  1542. # break
  1543. # begin += 1
  1544.  
  1545. # def d(n):
  1546. # a = []
  1547. # summa = 0
  1548. # for i in range(2, int(n ** 0.5) + 1):
  1549. # if n % i == 0:
  1550. # if i % 2 == 0:
  1551. # summa += i
  1552. # a.append(i)
  1553. # if n // i != i:
  1554. # if (n // i) % 2 == 0:
  1555. # summa += (n // i)
  1556. # a.append(n // i)
  1557. # # a.sort()
  1558. # return sum(a)
  1559. # # print(a)
  1560. #
  1561. # c = 0
  1562. # for i in range(468738, 10000000):
  1563. # res = d(i)
  1564. # if res % 412 == 78:
  1565. # print(i, res)
  1566. # c += 1
  1567. # if c == 7:
  1568. # break
  1569.  
  1570. # ans = []
  1571. # for i in range(222987, 223022):
  1572. # c = 0
  1573. # for j in range(1, int(i ** 0.5) + 1):
  1574. # if i % j == 0:
  1575. # c += 1
  1576. # if i // j != j:
  1577. # c += 1
  1578. # if c == 4:
  1579. # ans.append(i)
  1580. # work = ans[len(ans) - 1]
  1581. # print(ans)
  1582. # divs = []
  1583. # for i in range(1, int(work ** 0.5) + 1):
  1584. # if work % i == 0:
  1585. # divs.append(i)
  1586. # if work // i != i:
  1587. # divs.append(work // i)
  1588. # divs.sort()
  1589. # for i in divs:
  1590. # print(i, end=' ')
  1591.  
  1592. # def is_prime(n):
  1593. # c = 0
  1594. # for i in range(1, int(n ** 0.5) + 1):
  1595. # if n % i == 0:
  1596. # c += 1
  1597. # if n // i != i:
  1598. # c += 1
  1599. # if c == 2:
  1600. # return 1
  1601. # else:
  1602. # return 0
  1603. #
  1604. # ans = []
  1605. # for i in range(4671032, 4671107):
  1606. # if is_prime(i):
  1607. # ans.append(i)
  1608. # print(ans)
  1609. # ans.sort()
  1610. # for i in ans:
  1611. # print(i, end=' ')
  1612.  
  1613. # ans = []
  1614. # for i in range(135790, 163229):
  1615. # summa = 0
  1616. # for j in range(2, int(i ** 0.5) + 1):
  1617. # if i % j == 0:
  1618. # summa += j
  1619. # if (i // j) != j:
  1620. # summa += (i // j)
  1621. # if summa > 460000:
  1622. # ans.append(i)
  1623. # print(ans[1])
  1624. # work = ans[1]
  1625. # s = 0
  1626. # c = 0
  1627. # for i in range(2, int(work ** 0.5) + 1):
  1628. # if work % i == 0:
  1629. # c += 1
  1630. # s += i
  1631. # if work // i != i:
  1632. # c += 1
  1633. # s += (work // i)
  1634. # print(c, s)
  1635.  
  1636. # ans = []
  1637. # a = []
  1638. # for i in range(586132, 586431):
  1639. # c = 0
  1640. # for j in range(1, int(i ** 0.5) + 1):
  1641. # if i % j == 0:
  1642. # c += 1
  1643. # if i // j != j:
  1644. # c +=1
  1645. # ans.append(c)
  1646. # max_del = max(ans)
  1647. # print(max_del)
  1648. # for i in range(586132, 586431):
  1649. # c = 0
  1650. # for j in range(1, int(i ** 0.5) + 1):
  1651. # if i % j == 0:
  1652. # c += 1
  1653. # if i // j != j:
  1654. # c +=1
  1655. # if c == max_del:
  1656. # a.append(i)
  1657. # print(c)
  1658. #
  1659. # print(max(a), min(a))
  1660. #
  1661. # for i in range(max(a), 1, -1):
  1662. # if max(a) % i == 0:
  1663. # print(i, end=' ')
  1664. # print()
  1665. # for i in range(min(a), 1, -1):
  1666. # if min(a) % i == 0:
  1667. # print(i, end=' ')
  1668.  
  1669. # for a in range(2):
  1670. # for e in range(2):
  1671. # for f in range(2):
  1672. # for l in range(2):
  1673. # f = ((not(f)) and f) <= (not(((not(l)) or a)))
  1674.  
  1675. # for i in range(123450608, 123459698 + 1):
  1676. # num = str(i)
  1677. # if num[:5:] == "12345" and num[-3] == '6' and num[-1] == '8':
  1678. # if i % 17 == 0:
  1679. # print(i, i // 17, end=' ')
  1680.  
  1681. # 123?5?6?8
  1682.  
  1683. # for i in range(123050608, 123959698 + 1):
  1684. # num = str(i)
  1685. # if num[:3:] == '123' and num[-1] == '8' and num[-3] == '6' and num[-5] == '5':
  1686. # if i % 23 == 0 and num.count('6') > 2:
  1687. # print(i, i // 23, end=' ')
  1688. #
  1689. # 12?3*46
  1690. #
  1691.  
  1692. # from fnmatch import fnmatch #!!СПОСОБ ЧЕРЕЗ FNMATCH!!
  1693. # for i in range(120346, 12939946 + 1): #смотрим на ограничения числа
  1694. # if fnmatch(str(i), "12?3*46"):
  1695. # if i % 129 == 0:
  1696. # print(i, i // 129, end=' ')
  1697.  
  1698. # 12?3*46
  1699. # comb = [' ']
  1700. # for i in '0123456789':
  1701. # comb.append(i)
  1702. # for i in '0123456789':
  1703. # for j in '0123456789':
  1704. # comb.append(i + j)
  1705. # res = []
  1706. # for a in comb:
  1707. # for b in '0123456789':
  1708. # num = int(f'123{b}4{a}5'.replace(' ', ''))
  1709. # if num % 129 == 0:
  1710. # res.append((num, num // 129))
  1711. # print(num, num // 129)
  1712. # res.sort()
  1713. # print(* res)
  1714. # #num = '123' + b + '4' + a + '46'
  1715.  
  1716. # *?66?6
  1717.  
  1718. # def delit(n):
  1719. # summa = 0
  1720. # for i in range(1, int(n ** 0.5) + 1):
  1721. # if n % i == 0:
  1722. # summa += i
  1723. # if n // i != i:
  1724. # summa += (n // i)
  1725. # return summa
  1726.  
  1727. # comb = [' ']
  1728. # for i in '123456789':
  1729. # comb.append(i)
  1730. # for i in '123456789':
  1731. # for j in '0123456789':
  1732. # comb.append(i + j)
  1733. # cntr = 0
  1734. # res = []
  1735. # for a in comb:
  1736. # for b in '0123456789':
  1737. # for c in '0123456789':
  1738. # num = int(f'{a}{b}66{c}6'.replace(' ', ''))
  1739. # if num % 6 == 0 and num % 7 == 0 and num % 8 == 0:
  1740. # cntr += 1
  1741. # res.append(num)
  1742. # if cntr == 5:
  1743. # break
  1744. # res.sort()
  1745. # for i in res:
  1746. # print(i, delit(i), end=' ')
  1747. #
  1748. # ans = []
  1749. # from fnmatch import fnmatch
  1750. # for i in range(23213, 23999213 + 1):
  1751. # if fnmatch(str(i), "23*21*3"):
  1752. # if i % 1913 == 0:
  1753. # print(i, i // 1913)
  1754. # print(*ans)
  1755.  
  1756. # 12*45*
  1757. # from fnmatch import fnmatch
  1758. # for i in range(1245, 129945):
  1759. # if fnmatch(str(i), "12*45*"):
  1760. # if i % 51 == 0:
  1761. # print(i, i // 51, end=' ')
  1762.  
  1763. # ?3?2*4
  1764.  
  1765. # comb = [' ']
  1766. # for i in '0123456789':
  1767. # for j in '0123456789':
  1768. # for k in '0123456789':
  1769. # comb.append(i + j + k)
  1770. # ans = []
  1771. # for a in '123456789':
  1772. # for b in '0123456789':
  1773. # for c in comb:
  1774. # num = int(f'{a}3{b}2{c}4'.replace(' ', ''))
  1775. # if num % 49659 == 0:
  1776. # ans.append((num, num // 49659))
  1777. # ans.sort()
  1778. # print(*ans)
  1779.  
  1780. # 2?3?5?0
  1781. # ans = []
  1782. # for i in range(2030500, 2939590 + 1):
  1783. # c = 0
  1784. # a = '123456789'
  1785. # num = str(i)
  1786. # if num[0] == '2' and num[2] == '3' and num[4] == '5' and num[6] == '0':
  1787. # for j in a:
  1788. # if i % int(j + '2') == 0:
  1789. # c += 1
  1790. # if c >= 4:
  1791. # for j in a:
  1792. # if i % int(j + '2') == 0:
  1793. # ans.append((i, i // int(j + '2')))
  1794. # break
  1795. # ans.sort()
  1796. # print(*ans)
  1797.  
  1798. # from fnmatch import fnmatch
  1799. # ans = []
  1800. # for i in range(168, 199999959 + 1, 21):
  1801. # if fnmatch(str(i), '1*5*9'):
  1802. # work = str(i)
  1803. # flag = 1
  1804. # for j in range(len(work) - 1):
  1805. # if int(work[j]) >= int(work[j + 1]):
  1806. # flag = 0
  1807. # break
  1808. # if flag and i % 21 == 0:
  1809. # ans.append((i, i // 21))
  1810. # ans.sort()
  1811. # print(*ans)
  1812.  
  1813. # from fnmatch import fnmatch
  1814. # ans = []
  1815. # for i in range(2180782, 29123496 + 1):
  1816. # if fnmatch(str(i), "2*1234?6"):
  1817. # if i % 37 == 0:
  1818. # ans.append((i, i // 37))
  1819. # ans.sort()
  1820. # print(*ans)
  1821.  
  1822. # from fnmatch import fnmatch
  1823. # ans = []
  1824. # c = 0
  1825. # for i in range(700011, 10 ** 10, 13):
  1826. # if not (fnmatch(str(i), "*0??3*")) and not (fnmatch(str(i), "*4??2")) and not (fnmatch(str(i), "*1*")):
  1827. # c += 1
  1828. # ans.append(i)
  1829. # if c == 5:
  1830. # break
  1831. # for i in ans:
  1832. # x = i
  1833. # summa = 0
  1834. # while x > 0:
  1835. # summa += x % 10
  1836. # x //= 10
  1837. # print(i, summa)
  1838.  
  1839. # def dev_count(n):
  1840. # s = 0
  1841. # for i in range(2, int(n ** 0.5) + 1):
  1842. # if n % i == 0:
  1843. # s += i
  1844. # if n // i != i:
  1845. # s += (n // i)
  1846. # break
  1847. # return s
  1848. #
  1849. # begin = 452022
  1850. # cntr = 0
  1851. # while True:
  1852. # if cntr == 5:
  1853. # break
  1854. # if dev_count(begin) % 7 == 3:
  1855. # print(begin, dev_count(begin), end=' ')
  1856. # cntr += 1
  1857. # begin += 1
  1858.  
  1859. # def f(n):
  1860. # flag = 0
  1861. # for i in range(2, n - 1):
  1862. # if n % i == 0:
  1863. # if i % 10 == 8 and i != 8:
  1864. # flag = 1
  1865. # break
  1866. # return flag
  1867. #
  1868. # def exs(n):
  1869. # for i in range(2, n - 1):
  1870. # if n % i == 0:
  1871. # if i % 10 == 8 and i != 8:
  1872. # print(i, end=' ')
  1873. # break
  1874. #
  1875. # cntr = 0
  1876. # b = 500001
  1877. # while True:
  1878. # flagpole = f(b)
  1879. # if flagpole:
  1880. # print(b, end=' ')
  1881. # exs(b)
  1882. # cntr += 1
  1883. # if cntr == 5:
  1884. # break
  1885. # b += 1
  1886.  
  1887. # 12345?6?8
  1888. # from fnmatch import fnmatch
  1889. #
  1890. # for i in range(123450608, 123459698 + 1):
  1891. # if fnmatch(str(i), "12345?6?8"):
  1892. # if i % 17 == 0:
  1893. # print(i, i // 17, end=' ')
  1894.  
  1895. # from fnmatch import fnmatch
  1896. # for i in range(12408, 12349997 + 1, 141):
  1897. # if fnmatch(str(i), "1234*7"):
  1898. # if i % 141 == 0:
  1899. # print(i, i // 141, end=' ')
  1900.  
  1901. # from fnmatch import fnmatch
  1902. # for i in range(1097349, 1995499921 + 1, 3023):
  1903. # if fnmatch(str(i), "1?954*21"):
  1904. # if i % 3023 == 0:
  1905. # print(i, end=' ')
  1906.  
  1907. # print('a e f l')
  1908. # for a in range(2):
  1909. # for e in range(2):
  1910. # for f in range(2):
  1911. # for l in range(2):
  1912. # func = ((not f) and e) <= (not((not l) or a))
  1913. # if not func:
  1914. # print(l, a, e, f)
  1915.  
  1916. # def f(n):
  1917. # str_n = str(n)
  1918. # s1 = int(str_n[0]) + int(str_n[2]) + int(str_n[4])
  1919. # s2 = int(str_n[1]) + int(str_n[3])
  1920. # return str(min(s1, s2)) + str(max(s1, s2))
  1921. #
  1922. # for i in range(10000, 99999):
  1923. # if f(i) == '922':
  1924. # print(i)
  1925.  
  1926. # import turtle as t
  1927. #
  1928. # k = 20
  1929. # t.tracer(0,0)
  1930. # t.left(90)
  1931. #
  1932. # for i in range(2):
  1933. # t.forward(10 * k)
  1934. # t.right(90)
  1935. # t.forward(18 * k)
  1936. # t.right(90)
  1937. # t.up()
  1938. # t.back(6 * k)
  1939. # t.right(90)
  1940. # t.forward(14 * k)
  1941. # t.left(90)
  1942. # t.down()
  1943. # for i in range(2):
  1944. # t.forward(17 * k)
  1945. # t.right(90)
  1946. # t.forward(5 * k)
  1947. # t.right(90)
  1948. #
  1949. # t.up()
  1950. # for x in range(-20, 20):
  1951. # for y in range(-20, 20):
  1952. # t.goto(x * k, y * k)
  1953. # t.dot()
  1954. #
  1955. # t.update()
  1956. # t.mainloop()
  1957.  
  1958. # s = '2' * 19 + '5' + '3' * 10
  1959. # while '233' in s or '225' in s:
  1960. # if '233' in s:
  1961. # s = s.replace('233', '3', 1)
  1962. # if '225' in s:
  1963. # s = s.replace('225', '52', 1)
  1964. # print(s)
  1965.  
  1966. # for x in range(20, -1, -1):
  1967. # flag = 1
  1968. # for y in range(0, 21):
  1969. # m = 3 * 21 ** 4 + 6 * 21 ** 3 + y * 21 ** 2 + x * 21 ** 1 + 9 * 21 ** 0
  1970. # n = 1 * 21 ** 4 + 2 * 21 ** 3 + y * 21 ** 2 + 9 * 21 ** 1 + 9 * 21 ** 0
  1971. # if (n + m) % 18 != 0:
  1972. # flag = 0
  1973. # break
  1974. # if flag:
  1975. # m = 3 * 21 ** 4 + 6 * 21 ** 3 + 5 * 21 ** 2 + x * 21 ** 1 + 9 * 21 ** 0
  1976. # n = 1 * 21 ** 4 + 2 * 21 ** 3 + 5 * 21 ** 2 + 9 * 21 ** 1 + 9 * 21 ** 0
  1977. # print((m + n) // 18, (m + n) / 18, x)
  1978.  
  1979.  
  1980. # def f(n):
  1981. # if n <= 1:
  1982. # return 0
  1983. # if n > 1 and n % 6 == 0:
  1984. # return n + f(n // 6 - 2)
  1985. # if n > 1 and n % 6 != 0:
  1986. # return n + f(n + 6)
  1987. #
  1988. # print(f(4404))
  1989. # for i in range(10000):
  1990. # try:
  1991. # if f(i) > 4242:
  1992. # print(f(i), i)
  1993. # break
  1994. # except:
  1995. # pass
  1996.  
  1997. # a = []
  1998. # with open('17 (1).txt') as file:
  1999. # for line in file:
  2000. # a.append(int(line))
  2001. # res = 0
  2002. # for i in range(len(a)):
  2003. # if a[i] % 100 == 0:
  2004. # res += 1
  2005. # cntr = 0
  2006. # absolute_max = -10 ** 10
  2007. # for i in range(len(a) - 1):
  2008. # if (a[i] < 0 or a[i + 1] < 0) and (a[i] + a[i + 1]) < res:
  2009. # cntr += 1
  2010. # if a[i] + a[i + 1] > absolute_max:
  2011. # absolute_max = a[i] + a[i + 1]
  2012. # print(cntr, absolute_max)
  2013.  
  2014. # def func(f, e):
  2015. # if f == e:
  2016. # return 1
  2017. # if f > e or f == 21:
  2018. # return 0
  2019. # if f < e:
  2020. # return func(f + 3, e) + func(f * 2, e)
  2021. #
  2022. # print(func(6, 42))
  2023.  
  2024. # with open('24.txt') as file:
  2025. # s = file.readline()
  2026. # begin = 0
  2027. # cntr = 0
  2028. # max_len = 0
  2029. # while begin != len(s) - 1 or s[begin] != "!":
  2030. # if s[begin] in "AE" and s[begin + 1] in "BCD":
  2031. # print(begin)
  2032. # cntr += 1
  2033. # max_len = max(max_len, cntr)
  2034. # begin += 2
  2035. # # if begin + 2 != len(s):
  2036. # # begin += 2
  2037. # # else:
  2038. # # break
  2039. # else:
  2040. # cntr = 0
  2041. # begin += 1
  2042. # print(max_len)
  2043.  
  2044. # from fnmatch import fnmatch
  2045. # #?2*4*0 200 000 000 92 999 940 / // / / / 92 499 990
  2046. #
  2047. # for i in range(1260, 92999940, 42):
  2048. # if fnmatch(str(i), "?2*4*0") and not(fnmatch(str(i), "1*7*")) and i % 42 == 0:
  2049. # print(i, i // 42)
  2050.  
  2051. # def win(s1, s):
  2052. # return s1 + s >= 68
  2053. #
  2054. #
  2055. # def first(s1, s):
  2056. # return (win(s1 + 1, s) or win(s1, s + 1) or win(3 * s1, s) or win(s1, 3 * s)) and not (win(s1, s))
  2057. #
  2058. #
  2059. # def second(s1, s):
  2060. # return first(s1 + 1, s) and first(s1, s + 1) and first(3 * s1, s) and first(s1, 3 * s) and not (win(s1, s))
  2061. #
  2062. #
  2063. # def third(s1, s):
  2064. # return (second(s1 + 1, s) or second(s1, s + 1) or second(3 * s1, s) or second(s1, 3 * s)) and not (win(s1, s))
  2065. #
  2066. #
  2067. # def fourth(s1, s):
  2068. # return (third(s1 + 1, s) or first(s1 + 1, s)) and (third(s1, s + 1) or first(s1, s + 1)) and \
  2069. # (third(3 * s1, s) or first(3 * s1, s)) and (third(s1, 3 * s) or first(s1, 3 * s)) and not (win(s1, s))
  2070. #
  2071. #
  2072. # print("Ответы для 19")
  2073. # for i in range(1, 62):
  2074. # if third(6, i):
  2075. # print(i, end=' ')
  2076. # print()
  2077. # print("Ответы для 20")
  2078. # for i in range(1, 62):
  2079. # if fourth(6, i) and not(second(6, i)):
  2080. # print(i, end=' ')
  2081.  
  2082. # with open() as f:
  2083. # a = f.readlines()
  2084. # b = a.pop(0).split()
  2085. # s = int(b[0])
  2086. # n = int(b[1])
  2087. # for i in range(len(a)):
  2088. # a[i] = int(a[i])
  2089. # a.sort()
  2090. # max = 0
  2091. # res = 0
  2092. # sum = 0
  2093. # for i in range(len(a)):
  2094. # if a[i] + sum < s:
  2095. # res += 1
  2096. # sum += a[i]
  2097. # max = a[i]
  2098. # else:
  2099. # sum -= max
  2100. # if sum + a[i] <= s:
  2101. # max = a[i]
  2102. # sum += max
  2103. # print(res, max)
  2104.  
  2105. # with open('P1.txt') as f:
  2106. # a = f.readlines()
  2107. # m = a.pop(0).split(' ')
  2108. # s = int(m[0])
  2109. # n = int(m[1])
  2110. # for i in range(len(a)):
  2111. # a[i] = int(a[i])
  2112. # a.sort()
  2113. # max = 0
  2114. # res = 0
  2115. # sum = 0
  2116. # for i in range(len(a)):
  2117. # if a[i] + sum <= s:
  2118. # res += 1
  2119. # sum += a[i]
  2120. # max = a[i]
  2121. # else:
  2122. # sum -= max
  2123. # if sum + a[i] <= s:
  2124. # max = a[i]
  2125. # sum += max
  2126. # print(res, max)
  2127.  
  2128. # with open('P5.txt') as f:
  2129. # a = f.readlines()
  2130. # m = a.pop(0).split()
  2131. # n = int(m[0])
  2132. # k = int(m[1])
  2133. # for i in range(len(a)):
  2134. # a[i] = int(a[i])
  2135. # a.sort(reverse=True)
  2136. # counter = 0
  2137. # discount_sum = 0.0
  2138. # the_most_expensive = 0
  2139. # print(a)
  2140. # for i in range(len(a)):
  2141. # discount_sum += a[i] * 0.2
  2142. # counter += 1
  2143. # if counter == k:
  2144. # the_most_expensive = a[i]
  2145. # break
  2146. # print(discount_sum, the_most_expensive)
  2147.  
  2148.  
  2149. # with open('P2.txt') as f:
  2150. # a = f.readlines()
  2151. # n = int(a.pop(0))
  2152. # total_price = 0 #общая стоимость
  2153. # for i in range(len(a)):
  2154. # a[i] = int(a[i])
  2155. # if a[i] <= 150:
  2156. # total_price += a[i] #считает количество товаров, ст котор не прев 150
  2157. # array = []
  2158. # for i in range(len(a)):
  2159. # if a[i] > 150:
  2160. # array.append(a[i])
  2161. # array.sort()
  2162. # max_price = 0
  2163. # price_with_discount = 0
  2164. # for i in range(len(array) // 2):
  2165. # total_price += array[len(array) - i - 1]
  2166. # price_with_discount += array[i] * 0.8
  2167. # max_price = array[i]
  2168. # price_with_discount = math.ceil(price_with_discount)
  2169. # total_price = total_price + array[len(array) // 2] + price_with_discount
  2170. # print(total_price, max_price)
  2171.  
  2172. # with open('P4.txt') as f:
  2173. # a = f.readlines()
  2174. # n = int(a.pop(0))
  2175. #
  2176. # for i in range(len(a)):
  2177. # a[i] = int(a[i])
  2178. # even = []
  2179. # for i in range(len(a)):
  2180. # if a[i] % 2 == 0:
  2181. # even.append(a[i])
  2182. #
  2183. # a.clear()
  2184. #
  2185. # for i in range(len(even)):
  2186. # a.append(str(even[i]))
  2187. #
  2188. # for i in range(len(even)):
  2189. # even[i] = int(even[i])
  2190. #
  2191. # # print(a)
  2192. # # print(even)
  2193. #
  2194. # count = 0
  2195. # min_ans = 1000000000
  2196. #
  2197. # for i in range(len(even) - 1):
  2198. # for j in range(i + 1, len(even)):
  2199. # if str((even[i] + even[j]) // 2) in a:
  2200. # print((int(even[i]) + int(even[j])) // 2)
  2201. # count += 1
  2202. # min_ans = min(min_ans, (even[i] + even[j]) // 2)
  2203. # print(count, min_ans)
  2204.  
  2205.  
  2206. # count = 0
  2207. # for a in 'ЖАЛЕЙ':
  2208. # for b in 'ЖАЛЕЙ':
  2209. # for c in 'ЖАЛЕЙ':
  2210. # for d in 'ЖАЛЕЙ':
  2211. # for f in 'ЖАЛЕЙ':
  2212. # s = a + b + c + d + f
  2213. # if s.count('Й') == 1 and s[0] != 'Й' and s[4] != 'Й' and not('ЙЕ') in s and not('ЕЙ') in s:
  2214. # count += 1
  2215. # print(s)
  2216. # print(count)
  2217.  
  2218. # n = 6 ** 203 + 5 * 6 ** 405 - 3 * 6 ** 144 + 76
  2219. # c = ''
  2220. # while n > 0:
  2221. # c += str(n % 6)
  2222. # n //= 6
  2223. # summa = 0
  2224. # for i in c:
  2225. # summa += int(i)
  2226. # print(summa)
  2227.  
  2228. a = []
  2229. with open('17-1.txt') as f:
  2230. for line in f:
  2231. a.append(int(line))
  2232. average = sum(a) // len(a)
  2233. for i in range(len(a) - 3):
  2234. c = 0
  2235. if a[i] < average:
  2236. c += 1
  2237. if a[i + 1] < average:
  2238. c += 1
  2239. if a[i + 2] < average:
  2240. c += 1
  2241. if c
  2242.  
  2243. # print("x y z")
  2244. # for x in range(2):
  2245. # for y in range(2):
  2246. # for z in range(2):
  2247. # f = ((not x) and z) or ((not x) and (not y) and (not z))
  2248. # if f:
  2249. # print(x, y, z)
  2250.  
  2251. # def f(n):
  2252. # str_n = str(n) + str(n % 10)
  2253. # bin_str = bin(int(str_n)).removeprefix('0b')
  2254. #
  2255.  
  2256. # import turtle as t
  2257. #
  2258. # k = 30
  2259. # t.left(90)
  2260. # t.tracer(0, 0)
  2261. #
  2262. # t.forward(9 * k)
  2263. # t.right(90)
  2264. #
  2265. # for i in range(2):
  2266. # t.forward(3 * k)
  2267. # t.right(90)
  2268. # t.forward(3 * k)
  2269. # t.right(270)
  2270. #
  2271. # for i in range(2):
  2272. # t.forward(3 * k)
  2273. # t.right(90)
  2274. #
  2275. # t.forward(9 * k)
  2276. #
  2277. # t.up()
  2278. #
  2279. # for x in range(-20, 20):
  2280. # for y in range(-20, 20):
  2281. # t.goto(x * k, y * k)
  2282. # t.dot(4)
  2283. #
  2284. # t.update()
  2285. # t.mainloop()
  2286.  
  2287. # counter = 0
  2288. # for x in "БАНКИР":
  2289. # for y in "БАНКИР":
  2290. # for z in "БАНКИР":
  2291. # for q in "БАНКИР":
  2292. # for w in "БАНКИР":
  2293. # for e in "БАНКИР":
  2294. # string = x + y + z + q + w + e
  2295. # if string.count('А') <= 1 and string.count('И') <= 1:
  2296. # counter += 1
  2297. # print(counter)
  2298.  
  2299. # for i in range(31, 1000):
  2300. # s = i * "1"
  2301. # while "111" in s:
  2302. # s = s.replace("111", "2", 1)
  2303. # s = s.replace("222", '1', 1)
  2304. # if s == "211":
  2305. # print(i)
  2306. # break
  2307.  
  2308. # n = 3 * 11 ** 58 + 15 * 11 ** 55 - 99 * 11 ** 18 + 125 * 11 ** 9 + 381
  2309. # a = []
  2310. # while n > 0:
  2311. # if n % 11 not in a:
  2312. # a.append(n % 11)
  2313. # n //= 11
  2314. # print(len(a))
  2315.  
  2316. # for A in range(0, 1000):
  2317. # flag = 1
  2318. # for x in range(1, 100):
  2319. # for y in range(1, 100):
  2320. # f = ((x ** 2 - 10 * x + 16) > 0) or ((y ** 2 - 10 * y + 21) > 0) or ((x * y) < (2 * A))
  2321. # if not f:
  2322. # flag = 0
  2323. # break
  2324. # if flag:
  2325. # print(A)
  2326. # break
  2327.  
  2328. # def f(n):
  2329. # if n < 2:
  2330. # return 1
  2331. # if n >= 2 and n % 3 == 0:
  2332. # return f(n // 3) - 1
  2333. # if n >= 2 and n % 3 != 0:
  2334. # return f(n - 1) + 17
  2335. #
  2336. #
  2337. # for i in range(0, 1000000):
  2338. # if f(i) == 110:
  2339. # print(i, f(i))
  2340.  
  2341.  
  2342. # a = []
  2343. # ans = 0
  2344. # max_sum = -10 ** 10
  2345. # with open("17 (1).txt") as f:
  2346. # for line in f:
  2347. # a.append(int(line))
  2348. # average = sum(a) / len(a)
  2349. # for i in range(len(a) - 2):
  2350. # counter = 0
  2351. # if a[i] < average:
  2352. # counter += 1
  2353. # if a[i + 1] < average:
  2354. # counter += 1
  2355. # if a[i + 2] < average:
  2356. # counter += 1
  2357. # if counter >= 2:
  2358. # s1 = str(a[i])
  2359. # s2 = str(a[i + 1])
  2360. # s3 = str(a[i + 2])
  2361. # if "1" in s1 and "1" in s2 and "1" in s3:
  2362. # ans += 1
  2363. # max_sum = max(max_sum, a[i] + a[i + 1] + a[i + 2])
  2364. # print(ans, max_sum)
  2365.  
  2366. # from functools import lru_cache
  2367. #
  2368. #
  2369. # def moves(h):
  2370. # a, b = h
  2371. # return (a + 1, b), (a, b + 1), (a * 3, b), (a, b * 3)
  2372. #
  2373. #
  2374. # @lru_cache(None)
  2375. # def game(h):
  2376. # a, b = h
  2377. # if a + b >= 45:
  2378. # return 'W'
  2379. # if any(game(m) == 'W' for m in moves(h)):
  2380. # return 'P1'
  2381. # if any(game(m) == 'P1' for m in moves(h)):
  2382. # return 'B1'
  2383. # if all(game(m) == 'B1' for m in moves(h)):
  2384. # return 'P2'
  2385. # if all(game(m) == 'P2' or game(m) == 'P1' for m in moves(h)):
  2386. # return 'B2'
  2387. #
  2388. #
  2389. # for i in range(1, 41):
  2390. # h = 4, i
  2391. # if game(h) == 'B1':
  2392. # print(i, game(h))
  2393.  
  2394. # def f(x, y):
  2395. # if x == y:
  2396. # return 1
  2397. # if x > y:
  2398. # return 0
  2399. # if x < y:
  2400. # return f(x + 1, y) + f(x + 3, y) + f(x * 2, y)
  2401. #
  2402. # print(f(3, 9) * f(9, 12) * f(12, 20))
  2403.  
  2404. # def is_prime(n):
  2405. # c = 0
  2406. # for i in range(1, int(n ** 0.5) + 1):
  2407. # if n % i == 0:
  2408. # c += 1
  2409. # if n // i != i:
  2410. # c += 1
  2411. # if c == 2:
  2412. # return 1
  2413. # else:
  2414. # return 0
  2415. #
  2416. # def f(n):
  2417. # s = 0
  2418. # for i in range(2, int(n ** 0.5) + 1):
  2419. # if n % i == 0:
  2420. # if is_prime(i):
  2421. # s += i
  2422. # if n // i != i:
  2423. # if is_prime(n // i):
  2424. # s += (n // i)
  2425. # return s
  2426. #
  2427. #
  2428. # cntr = 0
  2429. # for i in range(499999, 0, -1):
  2430. # res = f(i)
  2431. # if cntr == 7:
  2432. # break
  2433. # if res != 0 and res % 10 == 0:
  2434. # print(i, res)
  2435. # cntr += 1
  2436.  
  2437. # def is_prime(n):
  2438. # c = 0
  2439. # for i in range(1, int(n ** 0.5) + 1):
  2440. # if n % i == 0:
  2441. # c += 1
  2442. # if n // i != i:
  2443. # c += 1
  2444. # if c == 2:
  2445. # return 1
  2446. # else:
  2447. # return 0
  2448. #
  2449. #
  2450. # def f(n):
  2451. # a = []
  2452. # for i in range(1, int(n ** 0.5) + 1):
  2453. # if n % i == 0:
  2454. # if n // i != i:
  2455. # if is_prime(i) and is_prime(n // i):
  2456. # a.append(i)
  2457. # a.append(n // i)
  2458. # break
  2459. # if n // i == i:
  2460. # if is_prime(i):
  2461. # a.append(i)
  2462. # a.append(i)
  2463. # break
  2464. # a.sort()
  2465. # return a
  2466. #
  2467. #
  2468. # for i in range(125697, 125722):
  2469. # q = f(i)
  2470. # if len(q) != 0:
  2471. # print(*q)
  2472.  
  2473.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement