Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def func():
- try:
- AnswrList=[]
- N=input().strip()
- Q=int(input().strip())
- if((len(N) in range(1,100001)) and (Q in range(1,100001))):
- for i in range(0,Q):
- s=input().strip()
- list1=s.split(" ")
- Li=int(list1[0])
- Ri=int(list1[1])
- if (Li in range(1,int(len(N))+1) and Ri in range(1,int(len(N))+1) and Li<=Ri):
- number=int(N[Li-1:Ri])
- if((number%7)==0):
- AnswrList.append("YES")
- else:
- AnswrList.append("NO")
- else:
- raise Exception("error")
- for i in AnswrList:
- print(i)
- else:
- raise Exception("error")
- except Exception as error:
- print(repr(error))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement