Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- seq_a=list(map(int,input().split(',')))
- # print(seq_a)
- seq_a.sort(reverse=True)
- # print(seq_a)
- months=[None,None]
- days=[None,None]
- hrs=[None,None]
- mins=[None,None]
- #months
- for x in seq_a:
- if x <= 1:
- months[0]=x
- seq_a.remove(x)
- break
- if months[0] is not None:
- if months[0]==1:
- for x in seq_a:
- if x <= 2:
- months[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x>0 and x <= 9:
- months[1]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins)
- #days
- if months[1] is not None:
- month=int(str(months[0])+str(months[1]))
- # print(month)
- if month==2:
- for x in seq_a:
- if x <= 2:
- days[0]=x
- seq_a.remove(x)
- break
- if days[0] is not None:
- if days[0]==2:
- for x in seq_a:
- if x <= 7:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 9:
- days[1]=x
- seq_a.remove(x)
- break
- elif month<=7:
- if month%2==0:
- for x in seq_a:
- if x <= 3:
- days[0]=x
- seq_a.remove(x)
- break
- if days[0] is not None:
- if days[0]==3:
- for x in seq_a:
- if x == 0:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x > 0 and x <= 9:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 3:
- days[0]=x
- seq_a.remove(x)
- break
- if days[0] is not None:
- if days[0]==3:
- for x in seq_a:
- if x <= 1:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 9:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- if month%2==0:
- for x in seq_a:
- if x <= 3:
- days[0]=x
- seq_a.remove(x)
- break
- if days[0] is not None:
- if days[0]==3:
- for x in seq_a:
- if x <= 1:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 9:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 3:
- days[0]=x
- seq_a.remove(x)
- break
- if days[0] is not None:
- if days[0]==3:
- for x in seq_a:
- if x == 0:
- days[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 9:
- days[1]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins,"YOLO")
- #hrs
- if days[1] is not None:
- for x in seq_a:
- if x <= 2:
- hrs[0]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins)
- if hrs[0] is not None:
- if hrs[0]==2:
- for x in seq_a:
- if x < 4:
- hrs[1]=x
- seq_a.remove(x)
- break
- else:
- for x in seq_a:
- if x <= 9:
- hrs[1]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins)
- #mins
- if hrs[1] is not None:
- for x in seq_a:
- if x < 6:
- mins[0]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins)
- if mins[0] is not None:
- for x in seq_a:
- if x <= 9:
- mins[1]=x
- seq_a.remove(x)
- break
- # print(seq_a)
- # print(months,days,hrs,mins)
- if mins[1] is not None:
- print(str(months[0])+str(months[1])+'/'+str(days[0])+str(days[1])+' '+str(hrs[0])+str(hrs[1])+':'+str(mins[0])+str(mins[1]))
- else:
- print(0)
Add Comment
Please, Sign In to add comment