Загрузка данных


# for n in range(1, 100):
#     s = bin(n)[2:]
#     if s.count("1") % 2 == 0:
#         s += "0"
#     else:
#         s += "1"
#     if s.count("1") % 2 == 0:
#         s += "0"
#     else:
#         s += "1"
#     if int(s, 2) > 170:
#         print(n)
#         break
from yaml import full_load_all


# for n in range(1, 100):
#     s = bin(n)[2:]
#     s += str(s.count("1") % 2)
#     s += str(s.count("1") % 2)
#     if int(s, 2)> 130:
#         print(int(s, 2))
#         break

# for n in range(1, 100):
#     s = bin(n)[2:]
#     s += s[-1]
#     if s.count("1") % 2 == 0:
#         s += "0"
#     else:
#         s += "1"
#     if s.count("1") % 2 == 0:
#         s += "0"
#     else:
#         s += "1"
#     if int(s, 2) > 130:
#         print(int(s, 2))
#         break
#

# k = 0
# for n in range(1, 100):
#      s = bin(n)[2:]
#      s += str(s.count('1') % 2)
#      s += str(s.count('1') % 2)
#      if 210 <= int(s, 2) <= 260:
#          k += 1
# print(k)

# for n in range(500, 0, -1):
#     s = bin(n)[2:]
#     if int(s[::-1], 2) == 13:
#         print(n)


# for n in range(1, 256):
#     s = bin(n)[2:].zfill(8)
#     s1 = " "
#     for i in s:
#         if i == "1":
#             s1 += "0"
#         else:
#             s1 += "1"
#     if int(s1, 2) - int(s, 2) == 45:
#         print(n)

# for n in range(1, 256):
#     s = bin(n)[2:].zfill(8)
#     s1 = " "
#     for i in s:
#         if i == "1":
#             s1 += "0"
#         else:
#             s1 += "1"
#     if int(s1, 2) == 193:
#         print(n)
# for n in range(1, 100):
#     s = bin(n)[2:]
#     if n % 2 == 0:
#         s += "01"
#     else: s += "10"
#     if int(s, 2) > 138:
#         print(n)
# k = 0
# for n in range(2, 1000):
#     s = bin(n)[2:]
#     s += s[-2]
#     s += s[1]
#     if 150 <= int(s, 2) <= 200:
#         k += 1
# print(k)
# k = set()
# for n in range(4, 1000):
#     s = bin(n)[2:]
#     if s.count('1') >  s.count("0"):
#         s += "0"
#     else: s += '1'
#     a = len(s) // 2
#     if len(s) % 2 == 0:
#         s = s[:a-1] + s[a+1:]
#     else:
#         s = s[:a-1] + s[a+2:]
#     if int(s, 2) == 58:
#         k.add(n)
# print(len(k))

# for n in range(2, 1000):
#     s = bin(n)[2:]
#     if s.count('0') == s.count('1'):
#         s += s[-1]
#     else:
#         if s.count('0') > s.count('1'):
#             s += '1'
#         if s.count('0') < s.count('1'):
#             s += '0'
#     if s.count('0') == s.count('1'):
#         s += s[-1]
#     else:
#         if s.count('0') > s.count('1'):
#             s += '1'
#         if s.count('0') < s.count('1'):
#             s += '0'
#     if s.count('0') == s.count('1'):
#         s += s[-1]
#     else:
#         if s.count('0') > s.count('1'):
#             s += '1'
#         if s.count('0') < s.count('1'):
#             s += '0'
#     if int(s, 2) % 4 == 0:
#         print(n)


# for n in range(1, 1000):
#     s = bin(n)[2:]
#     if n % 2 == 0:
#         s += bin(s.count('1'))[2:]
#     else:
#         s = "1" + s +'00'
#     if int(s, 2) > 215:
#         print(n)
#         break

# for n in range(1, 10000):
#     s = bin(n)[2:]
#     if s.count('1') % 2 == 0:
#         s = '10' + s[2:] + '0'
#     else:
#         s = '11' +s[2:]+'1'
#     if int(s, 2) > 480:
#         print(n)1
#
# l = []
# for n in range(1, 10000):
#     s = bin(n)[2:]
#     x1 = int(s, 2)
#     if ((x1 % 10) + (x1 / 10 //10) + (x1 //10 % 10)) % 2 == 0:
#         s += "0"
#     else: s += '1'
#     x2 = int(s, 2)
#     if ((x2 % 10) + (x2 / 10 //10) + (x2 //10 % 10)) % 2 == 0:
#         s += "0"
#     else: s += '1'
#     x3 = int(s, 2)
#     if ((x3 % 10) + (x3 / 10 //10) + (x3 //10 % 10)) % 2 == 0:
#         s += "0"
#     else: s += '1'
#     result = int(s, 2)
#     if result > 1028:
#         l.append(result)
# print(min(l))

    
# def three(x):
#     th = []
#     while x:
#         th.append(x % 3)
#         x //= 3
#     return  th[::-1]
#
#
# print(three(789))



#Функция которая переводит в 20 СС
# def f(x):
#     a = '0123456789abcdefghij'
#     if x < 20: return a[x]
#     return f(x // 20) + a[x % 20]
#
# s = f(25)
# print(type(s))
#
# print(f(456))
# for n in range(1, 1000000):
#     s = str(n)[::-1]
#     s1 = sum(int(n) for i in s if i in '13579')
#     s2 = sum(int(s[i]) for i in range(0, len(s), 2))
#     if abs(s2 - s1) == 29:
#         print(n)
# l = []
# for n in range(1, 100000):
#     s = bin(n)[2:]
#     for j in range(2):
#         if s.count('1') % 2 == 0:
#             s += '0'
#         else:
#             s+= "1"
#     if int(s, 2) > 77:
#         l.append(n)

# def f(x):
#     s = ''
#     while x:
#         s += str(x % 5)
#         x //= 5
#     return s[::-1]
# for n in range(1, 1000):
#     summ = 1
#     a = f(n)
#     l = []
#     for i in a:
#         l.append(int(i))
#     for j in range(len(l)):
#         if l[j] == 0:
#             l[j] = 1
#     for g in l:
#         summ *= g
#     if summ % 3 == 0:
#         a += '21'
#     else:
#         a += '12'
#     r = int(a, 4)
#     if r <= 280:
#         print(r)
# k = 0
# for line in open('9_3__3h2vp.csv'):
#     nums = [int(x) for x in line.split(';')]
#     l = []
#     for i in range(len(nums)):
#         l.append(sum(map(int, str(nums[i]))))
#     if sum(l) < min(nums) and sum(map(int, str(max(nums)))) == max(nums) % 2:
#         k += 1
# print(k)

# k = 0
# for n in range(1000, 9999):
#     s = str(n)
#     if int(s[0]) % 4 == 0:
#         s = s.replace(s[0], '9', 1)
#     if int(s[0]) % 2 == 0 and int(s[0]) % 4 != 0:
#         s = s.replace(s[0], '3', 1)
#     if s[0] == '9' and oct(int(s))[2:][-1] == '4':
#         k += 1
# print(k)