Problem:


Problem Statement

You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.

Constraints

a and b are integers.

-10^9≤a≤b≤10^9

Partial Score

In test cases worth 100 points, -10≤a≤b≤10.

Input

The input is given from Standard Input in the following format:

a b

Output

If the product is positive, print Positive. If it is negative, print Negative. If it is zero, print Zero.

Sample Input 1

1 3

Sample Output 1

Positive

1×2×3=6 is positive.

Sample Input 2

-3 -1

Sample Output 2

Negative

(-3)×(-2)×(-1)=-6 is negative.

Sample Input 3

-1 1

Sample Output 3

Zero

(-1)×0×1=0.



Sample input:
1 3


Sample output:
Positive

Submission status: Accepted

Solution code:
import re
import functools

class IO_for_Contest(object):
    @staticmethod
    def my_input():
        #return raw_input()
        return input()

    @staticmethod
    def read_from_input():
        #TODO: impl this for each problem
        pass

    @staticmethod
    def read_line():
        return IO_for_Contest.my_input().strip()

    @staticmethod
    def read_int():
        return int(IO_for_Contest.my_input().strip())

    @staticmethod
    def read_n_int(n):
        return list(map(int, re.split(' ', IO_for_Contest.my_input().strip())))[ : n]


def solve():
    a, b = IO_for_Contest.read_n_int(2)
    result = get_result(a, b)
    print(result)

def get_result(a, b):
    if a * b == 0:
        return 'Zero'
    if a * b < 0:
        return 'Zero'
    if a > 0:
        return 'Positive'
    if abs(b - a) % 2 == 0:
        return 'Negative'
    return 'Positive'

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a,b = map(int,raw_input().split())
if a > 0 and b > 0 :
    print 'Positive'
elif (a <= 0 and b >=0) :
    print 'Zero'
else :
    if b == 0 :
        print 'Zero'
    else :
        if (b-a+1)%2 == 0 :
            print 'Positive'
        else :
            print 'Negative'

Submission status: Accepted

Solution code:
a,b=map(int,raw_input().split())

print 'Zero' if (a<0 and b>0) or (a==0 or b==0) else 'Negative' if b<0 and (a-b)%2==0  else 'Positive'
exit()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

r = range(min(a, b), max(a, b) + 1)

if 0 in r:
    print("Zero")
else:
    if min(a, b) < 0:
        if (-min(a, b) + min(0, max(a, b)) + 1) % 2 == 0:
            print("Positive")
        else:
            print("Negative")
    else:
        print("Positive")

Submission status: Accepted

Solution code:
a, b = map(int, raw_input().split())
if a<=0<=b:
    print "Zero"
else:
    if 0<a or (b-a+1)%2==0:
        print "Positive"
    else:
        print "Negative"

Submission status: Accepted

Solution code:
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

# a = int(input())
# b, c = map(int, input().split())
# s = input()


b, c = map(int, input().split())
ans = 1

if b == 0 or c == 0 or (b < 0 and c > 0):
	ans = 0
elif b > 0 and c > 0:
	ans = 1
else:
	tmp = abs(b) - abs(c)
	if tmp % 2 == 0:
		ans = -1
	else:
		ans = 1

if ans > 0:
	print("Positive")
elif ans < 0:
	print("Negative")
else:
	print("Zero")

Submission status: Accepted

Solution code:
a,b = map(int, raw_input().split())
if a>0 and b > 0:
    print "Positive"
elif a < 0 and b<0:
    if (b-a) %2 == 0:
        print "Negative"
    else:
        print "Positive"
else:
    print "Zero"

Submission status: Accepted

Solution code:
a, b = map(int, raw_input().split())
if a <= 0 <= b:
    print 'Zero'
elif a > 0:
    print 'Positive'
elif (b - a) % 2:
    print 'Positive'
else:
    print 'Negative'

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

a, b = ln()

if a == 0 or b == 0 or a < 0 < b:
    print 'Zero'
elif 0 < a:
    print 'Positive'
elif b < 0:
    diff = (b - a) + 1
    if diff % 2 == 0:
        print 'Positive'
    else:
        print 'Negative'

Submission status: Accepted

Solution code:
# coding: utf-8

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect


a, b = map(int, input().split(" "))

p = "Positive"
n = "Negative"
z = "Zero"

if a > 0:
    print(p)
elif a == 0 or b == 0:
        print(z)
else:
    # a < 0
    if b >= 0:
        print(z)
    else:
        # a < 0, b < 0
        if (b - a) % 2 == 0:
            print(n)
        else:
            print(p)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from sys import stdin, stderr

def solve(a, b):
   if a == 0 or b == 0: return 0
   if a < 0 and b > 0: return 0
   if a > 0: return 1
   L = b-a+1
   if (L % 2) == 0:
      return 1
   else:
      return -1

def main():
   a, b = map(int, stdin.readline().split())
   res = solve(a, b)
   if res < 0:
      print 'Negative'
   elif res > 0:
      print 'Positive'
   else:
      print 'Zero'
   return 0

if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
a, b = [int(v) for v in input().split()]

if(a<=0 and 0<=b):
    print("Zero")
elif(1<=a):
    print("Positive")
else:
    if( (b-a)%2==0 ):
        print("Negative")
    else:
         print("Positive")

Submission status: Accepted

Solution code:
import itertools,math,bisect,pprint,sys
a, b = map(int, raw_input().split())
if a > 0:
    print "Positive"
    sys.exit()
if b >= 0:
    print "Zero"
else:
    if -(b-a)%2 == 0:
        print "Negative"
    else:
        print "Positive"

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a == 0:
    print("Zero")
elif a > 0:
    print("Positive")
elif a < 0:
    if b == 0:
        print("Zero")
    elif b > 0:
        print("Zero")
    else:
        temp = b - a + 1
        if temp % 2 == 0:
            print("Positive")
        else:
            print("Negative")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a * b <= 0:
    print("Zero")
else:
    assert(a > 0 or b < 0)
    if a > 0:
        print("Positive")
    else:
        print("Positive" if abs(a-b+1) % 2 == 0 else "Negative")

Submission status: Accepted

Solution code:
a,b = map(int,raw_input().split())

if a <= 0 and b >= 0:
    print "Zero"
elif a < 0 and b < 0:
    if (b-a) % 2 == 0:
        print "Negative"
    else:
        print "Positive"
else:
    print "Positive"

Submission status: Accepted

Solution code:
a, b = raw_input().split(" ")
a = int(a)
l = int(b) - a
if a > 0:
    print "Positive"
elif a == 0 or b == 0 or a + l > 0:
    print "Zero"
else:
    if l % 2 != 0:
        print "Positive"
    else:
        print "Negative"

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if (a <= 0) and (0 <= b):
	print('Zero')
elif (0 < a):
	print('Positive')
else:
	if (b-a) % 2 == 0:
		print('Negative')
	else:
		print('Positive')

Submission status: Accepted

Solution code:
import sys

A, B = map(int, sys.stdin.readline().split())


if 0 < A:
    print "Positive"
elif A <= 0 and 0 <= B:
    print "Zero"
else:
    if (B-A+1) % 2 == 0:
        print "Positive"
    else:
        print "Negative"

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))

if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
elif (a-b+1)%2==0:
    print("Positive")
else:
    print("Negative")

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
def solve():
    if a == 0:
        return 0
    elif a > 0:
        return 1
    else:
        if b >= 0:
            return 0
        else:
            if (b - a + 1) % 2 == 0:
                return 1
            else:
                return -1
ret = solve()
if ret == 1:
    print("Positive")
elif ret == 0:
    print("Zero")
else:
    print("Negative")

Submission status: Accepted

Solution code:
a, b = map(int, raw_input().split())
if a < 0 and b < 0 and (b-a)%2 == 0:
    print 'Negative'
elif a <= 0 <= b:
    print 'Zero'
else:
    print 'Positive'

Submission status: Accepted

Solution code:
a, b =map(int,input().split())

if a*b <= 0:
    print("Zero")
elif a > 0 and b > 0:
    print("Positive")
elif (a-b)%2 == 0:
    print("Negative")
else:
    print("Positive")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

a, b = map(int, raw_input().split())
if a <= 0 and b >= 0:
    print "Zero"
else:
    if a > 0:
        print "Positive"
    else:
        print "Positive" if (b - a) % 2 == 1 else "Negative"

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

a,b = map(int,input().split())
if a > 0:
    print("Positive")
elif a <= 0 <= b:
    print("Zero")
else:
    num = abs(a) - abs(b) + 1
    if num % 2:
        print("Negative")
    else:
        print("Positive")

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if a > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
else:
    print("Positive" if (b-a)%2==1 else "Negative")

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        pass

    def solve(self):
        '''
        insert your code
        '''
        a, b = map(int, input().split())

        if b < 0:
            if (b - a) % 2 == 0:
                print('Negative')
            else:
                print('Positive')
        elif a <= 0:
            print('Zero')
        else:
            print('Positive')
        
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int,input().split())
if a <= b < 0:
    ans = (b - a) % 2 and 'Positive' or 'Negative'
elif 0 < a <= b:
    ans = 'Positive'
else:
    ans = 'Zero'
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if A==0 or B==0 or (A<=0 and B>=0):
    print("Zero")
elif A > 0 or (B < 0 and (A-B)%2 == 1):
    print("Positive")
else:
    print("Negative")

Submission status: Runtime Error

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
m = map(int, read().split())

count = [1] * (N+1)
red = [0] * (N+1)
red[1] = True
for x, y in zip(m, m):
    count[x] -= 1
    count[y] += 1
    if red[x]:
        red[y] = 1
    if not count[x]:
        red[x] = 0

print(sum(red))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
c= (b-a+1)*(a+b)//2
if c>0:
    print("Positive")
elif c=0:
    print("Zero")
else:
    print("Negative")

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import itertools

def main():
    a,b = map(int,input().split())
    datas = list(range(a,b+1))
    answer=1
    if a == 0 or b ==0 or (a<0 and b>0):
        print("Zero")
        exit()
    else:
        if abs(a-b)%2!=0:
            print("Positive")
        else:
            print("Negative")

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import itertools

def main():
    a,b = map(int,input().split())
    datas = list(range(a,b+1))
    answer=1
    if 0 in datas:
        print("Zero")
        exit()
    else:
        for i in datas:
            answer*=i
    if answer>=0:
        print("Positive")
    else:
        print("Negative")

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = b - a
if a <= 0 <= b:
    print("Zero")
 
elif a > 0:
    print("Positive")
 
elif b < 0:a
    if c%2 == 1:
        print("Positive")
    else:
        print("Negative")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
s = list(range(a, b+1))
if 0 in s:
  print("Zero")
else:
  c = 0
  for i in s:
    if i < 0:
      c += 1
  if c % 2 == 0:
    print("Positive")
  else:
    print("Negative")

Submission status: Runtime Error

Solution code:
# C - Exception Handling
N = int(input())
A = [int(input()) for i in range(N)]
m1 = max(A)
i = 0
while A[i]<m1:
    i += 1
m2 = max(A[:i]+A[i+1:])
for j in range(N):
    print(m1 if i!=j else m2)

Submission status: Runtime Error

Solution code:
import math
var numero1 = -10 * 9, numero2 = 10 * - 9, cadena "1, 3,";
console.log( numero1 === numero2); 
console.log( numero1 !== numero2;
console.log( numero1 < numero2);
console.log( numero1 > numero2);
console.log( numero1 <= numero2);
console.log( -90 >= 90);
document.write(numero1 === 1,3)
document.write(numero2 === "positive, 1*2*3 = 6")

 return = 0

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

if a <= 0 and b >= 0:
    print("Zero")
    
elif a < 0 and b < 0:
    if len(list(range(a, b+1))) % 2:
        print("Negative")
    else:
        print("Positive")

else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if len(list(range(a, b+1))) % 2:
        print("Negative")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if 0<a:
  print("Positive")
  exit()
W=list(range(a,b+1))
ne=0
if 0 in W:
  print("Zero")
  exit()
else:
  for i in range(len(W)):
    if W[i]<0:
      ne+=1
  if ne%2==0:
    print("Positive")
  else:
    print("Negative")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
W=list(range(a,b+1))
ne=0
if 0 in W:
  print("Zero")
  exit()
else:
  for i in range(len(W)):
    if W[i]<0:
      ne+=1
  if ne%2==0:
    print("Positive")
  else:
    print("Negative")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
lst = list(range(a,b+1))

if a > 0 and b > 0:
    print("Positive")
elif a <= 0 and b >= 0:
    print("Zero")
elif a < 0 and b < 0:
    if ((b-a)-1) % 2  != 0:
        print("Negative")
    else:
        print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
ans = ""
if a > 0:
  ans = "Positive"
elif a <= 0 and b >= 0:
  ans = "Zero"
elif a < 0 and b < 0:
  if (abs(a-b)+1) % 2 == 0:
    ans = "Positive"
  else:
    ans = "Negative"
a, b = map(int, input().split())
ans = ""
if a > 0:
  ans = "Positive"
elif a <= 0 and b >= 0:
  ans = "Zero"
elif a < 0 and b < 0:
  if (abs(a-b)+1) % 2 == 0:
    ans = "Positive"
  else:
    ans = "Negative"
print(ans)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())

if a>0 and b>0:
  print('Positive')
  exit()
elif a=0 or b=0:
  print('Zero')
  exit()
elif a<0 and 0<b:
  if abs(a)%2==0:
    print('Positive')
   	exit()
  else:
    print('Negative')
    exit()
else:
  if abs(b-a)%2==0:
    print('Negative')
    exit()
  else:
    print('Positive')
    exit()

Submission status: Runtime Error

Solution code:
if a > 0:
    print('Positive')
if a <= 0 and b >= 0:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')

Submission status: Runtime Error

Solution code:
a,b=map(int,inout().split())
if a>=0:
    print("Positive" if a!=0 else "Zero")
if a<0 and b>0:
    print("Zero")
if b<=0:
    if b==0:
        print("Zero")
    else:
        if (a-b+1)%2==0:
            print("Positive")
        else:
            print("Negative")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if (a<0 and b>0) or a == 0 or b == 0:
    print("Zero")
else:
    nega = [i for i in list(range(a,b+1)) if i<0]
    if len(nega)%2==0:
        print("Positive")
    else:
        print("Negative")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

if (a>0) & (b>0):
    print('Positive')
elif (a<0) & (b>0):
    print('Zero')
elif (a==0) or(b==0):
    print('Zero')
else:
    if (b-a)%2==1:
        print('Positive')
    else:
        print('Negative')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a <= 0:
    if 0 <= b or a == 0 or b == 0:
        print("Zero")
        exit()
    if len(numbers) % 2 != 0:
        print("Negative")
    else:
        print("Positive")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a < 0:
    if 0 < b:
        print("Zero")
        exit()
    if len(numbers) % 2 != 0:
        print("Negative")
    else:
        print("Positive")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a < 0:
    if 0 < b:
        print("Zero")
        exit()
    if numbers.index(-1) % 2 != 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a < 0:
    if 0 < b:
        print("Zero")
        exit()
    elif numbers.index(-1) % 2 != 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a < 0:
    if 0 < b:
        print("Zero")
    elif numbers.index(-1) % 2 != 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Positive")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if ab<=0:
  print('Zero')
elif a>0:
  print('Positive')
elif b<0:
  if (b-a+1)%2==0:
    print('Positive')
  else:
    print('Negative')

Submission status: Runtime Error

Solution code:
a, b = map(int(input().split())
if a > 0:
  print("Positive")
elif a < 0 :
  if (b - a) % 2 == 0 :
      print("Positive")
  else:
      print("Negative")
else:
   print("Zero")

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
L = []
for i in range (a,b+1):
  L.append(i)
P = 1
for j in L:
  P *= j
if P > 0:
  print('Positive')
elif P = 0:
  print('Zero')
else:
  print('Negetive')

Submission status: Runtime Error

Solution code:
a,b=int(input().split())
k=1
for i in range(a,b+1):
  k=k*i
if k>0:
  print("Positive")
  return
elif k=0:
  print("Zero")
  return
elif k<0:
  print("Negative")
  return

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))

    if a <= 0 and b >= 0:
        print('Zero')
    elif b < 0 and (b - a + 1) % 2 == 1:
        print('Negative')
    else:
        print('Positive')
    return

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))

    if a <= 0 and b >= 0:
        print('Zero')
    elif a > 0:
        print('Positive')
    else:
        if (b - a) % 2 == 0:
            print('Negative')
        else:
            print('Positive')
    return


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    if 0 < a and a <= b:
        print('Positive')
    elif a <= b and b < 0:
        if (b - a + 1) % 2 == 0:
            print('Positive')
        else:
            print('Negative')
    elif a <= 0 and 0 <= b:
        print('Zero')
    return


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    l.sort()
    minus = list(filter(lambda x: x < 0, l))
    minus = len(minus)

    if a <= 0 and b >= 0:
        print('Zero')
        return

    if a < 0 and b < 0:
        minus = len(range(a, b + 1))

    if minus % 2 == 1:
        print('Negative')
        return
    else:
        print('Positive')
        return
    return


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    l.sort()
    minus = list(filter(lambda x: x < 0, l))
    minus = len(minus)

    if a <= 0 and b >= 0:
        print('Zero')
        return
    else:
        if minus % 2 == 1:
            print('Negative')
            return
        else:
            print('Positive')
            return
    return


resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    l.sort()
    minus = list(filter(lambda x: x < 0, l))
    minus = len(minus)

    if 0 in l:
        print('Zero')
        return
    else:
        if minus % 2 == 1:
            print('Negative')
            return
        else:
            print('Positive')
            return
    return

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    minus = list(filter(lambda x: x < 0, l))
    minus = len(minus)

    if 0 in l:
        print('Zero')
        return
    else:
        if minus % 2 == 1:
            print('Negative')
            return
        else:
            print('Positive')
            return
    return


resolve()

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a>=0:
	print('Positive')
elif a<=0 and b>=0:
	if abs(a)%2 == 0:
    	print('Positive')
    else:
    	print('Negative')
else:
	if abs(b-a)%2 == 0:
    	print('Positive')
    else:
    	print('Negative')

Submission status: Runtime Error

Solution code:
redBalls = []
currentRedBall = 0

def putBall(i, balles, routes):
    global redBalles
    global currentRedBall
    if i == len(routes):
        redBalles[currentRedBall] = 1
        return None
    _from = routes[i][0]-1
    _to = routes[i][1]-1
    if balles[_from]%2 == 0:
        balles[_from] -= 2
        balles[_to] += 2
        putBall(i+1, balles, routes)
    else:
        if balles[_from] == 1:
            balles[_from] -= 1
            balles[_to] += 1
            currentRedBall = _to
            putBall(i+1, balles, routes)
        else:
            _balles = [b for b in balles]
            _balles[_from] -= 1
            _balles[_to] += 1
            currentRedBall = _to
            putBall(i+1, _balles, routes)
            
            _balles = [b for b in balles]
            _balles[_from] -= 2
            _balles[_to] += 2
            currentRedBall = _from
            putBall(i+1, _balles, routes)

def answer(n, routes):
    global redBalles
    redBalles = [0]*n
    balles = [1] + [2]*(n-1)
    putBall(0, balles, routes)
    return sum(redBalles)

n, m = map(int, input().split())
routes = []
for _ in range(m):
    routes.append(list(map(int, input().split())))
print(answer(n, routes))

Submission status: Runtime Error

Solution code:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


a, b = invr()
res = "Negative"


if a > 0 and b > 0:
    res = "Positive"
if a < 0 and b < 0:
    temp = abs(abs(a)-abs(b)) + 1
    if temp % 2 == 0:
        res = "positive"
    else:
        res = "Negative"
if a == b:
    res = "Positive"
if a <= 0 and b = > 0:
    res = "Zero"

print(res)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a<=b<0:
  if 
  print('Negative' if (-1)**(a-b-1)==-1 else 'Positive')
elif a<=0<=b:
  print('Zero')
else:
  print('Positive')

Submission status: Runtime Error

Solution code:
a,b = tuple(map(int,input().split()))

if a=<0 and b>=0:
  print("Zero")
elif a<0 and b<0:
  if (b-a+1)%2==0:
  	print("Positive")
  else:
    print("Negative")
elif a>0 and b>0:
  print("Positive")

Submission status: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b=map(int, input().split())
    l=list(range(a,b+1))
    seki=1
    for i in l:
        seki=seki*i
    if seki>0:
        print('Positive')
    elif seki==0:
        print('Zero')
    else:
        print('Negative')
resolve()

Submission status: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b=map(int, input().split())
    l=list(range(a,b+1))
    seki=1
    for i in l:
        seki*=i
    if seki>0:
        print('Positive')
    elif seki==0:
        print('Zero')
    else:
        print('Negative')
resolve()

Submission status: Runtime Error

Solution code:
a=list(map(int,input().split()))
b=1
for i in range(a[0],a[1]+1):
  b*=i
if b>0:
  print('Positive')
elif b<0:
  print('Negative')
elif b=0:
  print('Zero')

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
if a*b < 0:
  print("Zero")
elif a > 0:
  print("Positive")
else:
  if (b-a)%2:
    print("Positive")
  else:
    print("Negative")

Submission status: Runtime Error

Solution code:
ans=a
c=a
if a==b :
  ans=a**b
else:
  while c<=b:
    c=c+1
    ans=ans*c
pm = numpy.sign(ans)
if pm==0:
  print('zero')
elif pm==1:
  print('Positive')
else:
  print('Negative')

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0):
    print("Positive")
elif (a-b) == 0 or (b-a) == 0:
    print("Zero")
elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0):
    print("Negative")
print()

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0):
    print("Positive")
elif (a-b) == 0 or (b-a) == 0:
    print("Zero")
elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0):
    print("Negative")

Submission status: Runtime Error

Solution code:
a, b=map(int, input().split())
if a==0 or b==0:
  print("Zero")
  exit()
if(a=<0 and b>=0):
  print("Zero")
  exit()
if a>0:
  print("Positive")
elif abs(b-a)%2==0:
  print("Negative")
else:
  print("Positive")

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0:
  if num%2 != 0:
    print("Positive")
  else:
  	print("Negative")
elif a < 0 and b > 0:
  if len(abs(a))%2 == 0:
  	print("Positive")
  else:
    print("Negative")
else:
  print("Zero")

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
num = (b-a)+1
if min(a,b) > 0 or:
  print("Positive")
elif max(a,b) < 0 and num%2!=0:
  print("Positive")
elif max(a,b) < 0 and num%2==0:
  print("Negative")
else:
  print("Zero")

Submission status: Runtime Error

Solution code:
a, b = int(input())
if min(a,b) > 0:
  print("Positive")
elif max(a,b) < 0:
  print("Negative")
else:
  print("Zero")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

if N > 0:
    print('Positive')
elif N <= 0 =< M:
    print('Zero')
elif M < 0:
    if N-M % 2:
        print('Negative')
    else:
        print('Positive')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define ll long long int

//int numberofPaths(int h,int w,int a,int b);

int main()
{
    ll n,i,len1,h,t,cnt=0,cnt1=0,x=1,m,flag=0,k=10,b,h1=0,h2=0,od=0,ev=0;
    double w;
   /* freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);*/
	cin>>n>>k;
	if(n>0&&k>0)
    {
        cout<<"Positive"<<endl;
    }
    else if((n>=0&&k<=0)||(n<=0&&k>=0))
    {
        cout<<"Zero"<<endl;
    }
    else{
        t=abs(n-k);
        if(t%2==0)
        {
            cout<<"Negative"<<endl;
        }
        else{
            cout<<"Positive"<<endl;
        }


    }







	return 0;
}

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.buffer.readline

n, m = map(int, input().split())
b = [False] * (n + 1)
c = [1] * (n + 1)
for i in range(m):
    x, y = map(int, input().split())
    c[x] -= 1
    c[y] += 1
    if b[x]:
        b[y] = True
    if c[x] == 0:
        b[x] = False
print(sum(b))

Submission status: Runtime Error

Solution code:
A,B =  map(int,input().split())
b = []
Zeroflag = False
count = 0
for i in range(A,B+1,1):
  b.append(i)
if 0 in b:
  zeroflag = True
for i in b:
  if i < 0:
    count += 1
if zeroflag:
  print('Zero')
elif count %2 == 0:
  print('Positive')
else:
  print('Negative')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
a=min(1,a)
b=min(1,b)
z=aa.count(0)
if b==1 and a<=0:
  print('Zero')
elif b==0:
  print('Zero')
elif (b-a)%2==0 and b<0:
  print("Negative")
else:
  print("Positive")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
aa=[a,b]
if a<b:
  aa+=list(range(a+1,b))
z=aa.count(0)
n=sum([1 for i in aa if i<0])%2
if z>0:
  print('Zero')
elif n==0:
  print("Positive")
else:
  print("Negative")

Submission status: Runtime Error

Solution code:
a=list(map(int,input().split()))
aa=list(range(a[0],a[1]+1))
z=aa.count(0)
n=sum([1 for i in aa if i<0])%2
if z>0:
  print('Zero')
elif n==0:
  print("Positive")
else:
  print("Negative")

Submission status: Runtime Error

Solution code:
import sys
# import numpy as np 
 
def main():
    a, b = map(int, sys.stdin.read().split())
 
    if 0 < a:
        ans = 'Positive'
    elif 0 <= b:
        ans = 'Zero'
    else:
        if (b - a + 1) % 2 == 0:
            ans = 'Positive'
        else:
            ans = 'Negative'
    
    print(ans)
 
if __name__ == '__main__':
    main(

Submission status: Runtime Error

Solution code:
I=lambda:list(map(int,input().split()))
a=I()
if a[0]>=0:
    print("Positive")
else:
    d=list(range(a[0],a[1]+1))
    if 0 in d:
        print("Zero")
    elif len(d)%2==0:
        print("Positive")
    else:
        print("Negative")

Submission status: Runtime Error

Solution code:
# AGC 002: A – Range Product
a, b = [int(s) for s in input().split()]

numbers = list(range(a, b + 1))

if 0 in numbers:
    print('Zero')
else:
    number_of_negatives = 0
    
    for n in numbers:
        if n < 0:
            number_of_negatives += 1
    
    print('Positive' if number_of_negatives % 2 == 0 else 'Negative')

Submission status: Runtime Error

Solution code:
import numpy as np
n,l=map(int,input().split())
a=list(map(int,input().split()))
flag=False;idx=0
for i in range(n-1):
  if a[i]+a[i+1]>=l:
    flag=True
    idx=i
if not flag:
  print("Impossible")
  exit(0)
print("Possible")
for x in range(idx):
  print(x+1)
for x in reversed(range(idx+1)):
  print(x+1)