Skip to content

Commit

Permalink
28-B final
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey74ua committed Aug 13, 2022
1 parent 337a43c commit 08f18a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
36 changes: 0 additions & 36 deletions 28-B(5 тест память).py

This file was deleted.

13 changes: 13 additions & 0 deletions 28-B.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
T = int(input())
for i in range(T):
n, A = map(int, input().split())
R = 0
if len(str(A)) >= n-1:
for j in str(int(''.join(['1']*n))*A):
R += int(j)
else:
for j in str(int(''.join(['1']*len(str(A))))*A):
R += int(j)
s = int(''.join(['1']*(len(str(A))+2)))*A
R += (int(n)-len(str(A)))*int(str(s)[len(str(s))//2])
print(R)

0 comments on commit 08f18a6

Please sign in to comment.