Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ar_count = 2
- ge_count = 2
- max_ar_count = 2
- max_ge_count = 2
- prev_elem = int(input())
- inp = int(input())
- d = inp - prev_elem
- q = inp / prev_elem
- while True:
- prev_elem = inp
- inp = int(input())
- if inp == 0:
- if ar_count > max_ar_count:
- max_ar_count = ar_count
- if ge_count > max_ge_count:
- max_ge_count = ge_count
- break
- if inp - prev_elem == d:
- ar_count += 1
- else:
- if ar_count > max_ar_count:
- max_ar_count = ar_count
- ar_count = 2
- d = inp - prev_elem
- if inp / prev_elem == q:
- ge_count += 1
- else:
- if ge_count > max_ge_count:
- max_ge_count = ge_count
- ge_count = 2
- q = inp / prev_elem
- print(max(max_ar_count, max_ge_count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement