---
# System prepended metadata

title: Thanh Hoa TP_12-21-22

---

# Thanh Hoa TP_12-21-22
##### bai 1:
```python=
import sys
sys.stdin = open('GHH.INP','r')
sys.stdout = open('GHH.OUT','w')
n = int(input())
a = [] ; li = [] ; count = 0
for _ in range(n):
    a.append(int(input()))
for i in range(len(a)):
    t = a[i]
    l =[]
    for j in range(1 , t + 1):
        if t % j == 0:
            l.append(j)
        if 2 * t <= sum(l):
            count += 1
            li.append(t)
print(count)
for i in range(len(li)):
    print(li[i])
```
#### bai 2:
```python=
n = int(input())
a = [int(i) for i in input().split()]
for i in range(len(a)):
    s = a.count(a[i])
    if s == 1:
        print(a[i])
```
#### bai 3:
```python=
import sys
sys.stdin = open('DIFFSSTR.INP','r')
sys.stdout = open('DIFFSSTR.OUT','w')
n = int(input())
s = input()
l = []
for i in range(n):
    for j in range(i , n):
        if j + i < n:
            t = s[i : j]
            l.append(t)
res = -9999
for i in range(len(l)):
    r = len(l[i])
    if r > res:
        res = r
print(res)
```
#### bai 4:
```python=
import sys
sys.stdin = open('DIV3.INP','r')
sys.stdout = open('DIV3.OUT','w')
n = int(input()) 
a =[int(i) for i in input().split()]
li =[]
for i in range(len(a)):
    for j in range(i,len(a)):
        if (a[i] + a[j]) % 3 == 0:
            li.append(i)
            li.append(j)
print(len(li) //2)
```
#### bai 5:
```python=
import sys
sys.stdin = open('CHIAHET.INP','r')
sys.stdout = open('CHIAHET.OUT','w')
n , m = map(int,input().split())
t = 1
for i in range(1,n+1):
    t *= i
for i in range(99999):
    res = pow(m,i)
    if t % res == 0 and t % (res - 1) != 0:
        print(i)
```
            
            
            