n = 1000
z = 0
a = '4200 800 2500 1500 1100 2800 200 3900 200 400 500 3600 1800 4500 4000 3500 1000 3100 2600 4800 4800 1600 800 800 600 3000 2800 1300 3900 1500 500 2500 4800 2600 2800 2600 600 3600 300 3000 4100 3700 4400 2300 2500 1100 2900 2300 2000 4300 2100 400 1200 800 1700 1400 2700 2300 100 200 300 2300 3300 100 1600 3100 3200 200 3200 4200 200 500 1200 4800 1400 1800 1900 1600 1400 2000 1000 700 3600 2800 4200 3700 100 4700 2600 3300 900 2000 300 400 4300 2400 600 3900 4000 4400 4800 1000 100 400 3200 3500 800 600 3700 400 2300 3100 3800 3600 1100 2300 4700 4100 3800 500 4600 4800 1100 900 700 1000 3600 1900 2600 2400 700 2800 1800 700 4000 400 2000 4400 4000 2500 1200 2900 3300 3300 1500 1200 4200 800 4700 2400 1800 200 1000 4000 100 100 2100 2100 1500 2500 300 1000 3000 500 300 3800 3300 4900 1700 100 2300 800 100 2400 700 3200 4700 2300 1900 700 900 2700 3300 300 2700 4400 100 3300 3500 1500 2400 3300 3500 3000 3600 3600 300 4300 500 4900 1800 3600 700 400 1000 500 4100 700 1800 2000 3200 500 4800 1500 300 1800 3300 800 3500 4400 1800 400 4800 2600 800 1600 1400 3700 2500 2700 3300 3400 2700 4200 3300 3200 1500 4800 2900 400 2500 1900 2500 4800 3000 4100 2700 1400 4400 1100 3300 800 2600 4100 4900 4200 1600 3100 1600 1700 1100 1200 3600 4900 4800 2300 4300 3400 3500 4000 4900 2600 400 4100 3400 3000 1500 400 2100 3600 2900 3700 4400 1400 3100 2500 400 4600 3500 1600 3500 4700 3800 1400 4900 700 4100 3500 3400 600 4000 4400 600 4600 4200 4400 1100 2800 2700 1400 2900 2200 2600 3600 1200 2900 1500 3700 2100 4500 1400 2400 3600 4200 800 4800 3400 2200 4000 3600 1800 900 4800 4200 400 2300 1200 1500 3600 1700 3600 1000 2000 2500 3600 2700 4700 1600 3900 2600 4600 2800 2900 700 2100 1900 1700 4900 400 600 4200 2000 4500 1100 2600 2200 2700 1800 2200 1100 2100 2100 500 3500 3400 1700 1600 600 4800 4200 4600 1600 2900 700 3900 1400 3600 200 600 3400 700 1600 600 4400 3300 3200 2700 700 4500 4700 200 4200 1300 3600 2700 4900 1600 3000 3400 4500 2300 1000 3700 1500 4500 2700 900 600 1300 2300 400 2100 3300 4800 3900 2500 100 1800 100 1100 3100 3900 2700 4000 2700 4700 4100 4800 1300 100 2400 1100 3200 400 2000 1100 4900 2500 4600 4200 2100 2600 3500 500 2500 2100 4900 4600 3800 600 3600 2500 1300 1400 3500 2100 4600 3200 3700 400 2100 2400 300 3200 4700 4200 1100 2000 2700 3500 500 1700 1200 1600 4300 4200 4600 900 1500 2400 900 4400 2400 1100 4700 2300 4600 4300 100 4700 1100 3800 3000 1500 1500 4900 2500 1700 2500 4100 3700 2700 2800 4800 300 4700 4300 3400 1300 2900 600 700 2500 900 1200 1600 400 1700 2300 4700 1700 1400 800 1500 2600 600 4400 1000 1700 400 2500 3600 4500 1700 2400 600 3000 4500 3600 1100 4500 2600 2200 3500 1600 3900 4400 1500 4800 2100 2700 2400 2400 200 100 3900 1600 2100 700 1100 2500 2400 3900 500 3200 2900 1100 4000 1100 1700 3600 2000 1300 3600 4300 2100 1500 4700 2400 2200 3800 2700 1500 1400 1300 2700 2700 3800 1100 4000 4100 4000 400 800 1000 100 3200 400 1600 1100 1000 2000 1600 4800 1900 3000 2200 2500 3600 3000 4500 500 3200 4200 4400 1700 1900 3500 4000 700 1300 4400 1900 1100 2500 4500 3500 4500 1500 1500 2000 2700 3000 3900 2800 1700 300 2200 4400 500 2600 1100 4400 700 1500 3200 2500 1800 2500 3100 2800 500 800 1700 1000 700 3900 3100 1700 1000 1200 800 3100 800 400 1800 4300 1700 2100 4300 3700 1800 900 100 4000 3800 3300 2800 2100 1300 2700 700 4800 900 3400 1000 700 3600 1600 3200 1200 2900 2600 600 500 4400 4800 1900 3600 800 4700 2800 1400 1200 800 800 3900 4000 800 2600 3100 3400 1100 2700 4000 2900 3400 1900 2700 1300 400 3400 3900 2500 600 3500 2700 700 1400 3000 2300 2800 3900 3500 2600 500 2900 2100 4200 1700 200 4300 2600 1100 3700 4700 4100 400 4500 2500 600 2100 4900 2600 600 3700 2300 200 500 3100 700 400 1300 3600 2400 4100 3700 3000 3400 500 3600 3500 400 3500 2600 100 100 2200 3200 3500 2700 1700 3200 1700 4400 2200 2400 3400 1900 3300 4300 4000 3500 4000 2600 1200 2300 600 3600 2500 2200 3900 1000 3700 2600 3700 2000 4500 2000 700 3000 2700 500 1000 2800 100 3300 1500 700 2000 1600 4200 2200 2300 200 400 3500 3900 1600 4000 1000 3100 3800 3500 3600 4800 2700 4200 4600 700 1000 1700 2800 1000 3200 1800 1200 500 800 4100 3900 200 3600 100 3400 2600 2100 3200 4400 1200 1500 2700 4400 3500 4800 2400 3200 3300 3600 3900 2300 4100 1900 3700 1500 3200 4300 3600 4100 1400 2800 3000 2800 1300 2400 1400 1700 2800 4200 4800 4600 4400 4300 500 1900 4400 1400 2300 1700 1300 300 500 3100 3600 1200 2200 4100 1100 2400 2100 3600 1200 3100 2400 500 4000 2500 1400 2500 3000 3200 700 3500 4200 4500 2000 400 1300 400 4000 1000 4600 800 1300 2100 3900 2200 3900 1700 1600 4900 2100 3800 4300 4100 500 1500 600 2100 1700 3800 1600 1600 2900 4200 4000 4700 700 1500 1700 2700 2500 3800 1300 1500 1000 3800 4800 3200 2900 1800 4600 3000 100 1400 3300 3900 3200 2000 4200 2600 2900 2900 4900 600 500 3000 100 2200 500'
b = a.split()
b = list(map(int,b))
print(b)
for i in b:
    for x in range(1,n):
        c = i+b[x]
        
            
        if c == 5000:
            z = z+1
print(z)
if z == 0:
    print(-1) 

Python Online Compiler

Write, Run & Share Python code online using OneCompiler's Python online compiler for free. It's one of the robust, feature-rich online compilers for python language, supporting both the versions which are Python 3 and Python 2.7. Getting started with the OneCompiler's Python editor is easy and fast. The editor shows sample boilerplate code when you choose language as Python or Python2 and start coding.

Taking inputs (stdin)

OneCompiler's python online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample python program which takes name as input and print your name with hello.

import sys
name = sys.stdin.readline()
print("Hello "+ name)

About Python

Python is a very popular general-purpose programming language which was created by Guido van Rossum, and released in 1991. It is very popular for web development and you can build almost anything like mobile apps, web apps, tools, data analytics, machine learning etc. It is designed to be simple and easy like english language. It's is highly productive and efficient making it a very popular language.

Tutorial & Syntax help

Loops

1. If-Else:

When ever you want to perform a set of operations based on a condition IF-ELSE is used.

if conditional-expression
    #code
elif conditional-expression
    #code
else:
    #code

Note:

Indentation is very important in Python, make sure the indentation is followed correctly

2. For:

For loop is used to iterate over arrays(list, tuple, set, dictionary) or strings.

Example:

mylist=("Iphone","Pixel","Samsung")
for i in mylist:
    print(i)

3. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while condition  
    #code 

Collections

There are four types of collections in Python.

1. List:

List is a collection which is ordered and can be changed. Lists are specified in square brackets.

Example:

mylist=["iPhone","Pixel","Samsung"]
print(mylist)

2. Tuple:

Tuple is a collection which is ordered and can not be changed. Tuples are specified in round brackets.

Example:

myTuple=("iPhone","Pixel","Samsung")
print(myTuple)

Below throws an error if you assign another value to tuple again.

myTuple=("iPhone","Pixel","Samsung")
print(myTuple)
myTuple[1]="onePlus"
print(myTuple)

3. Set:

Set is a collection which is unordered and unindexed. Sets are specified in curly brackets.

Example:

myset = {"iPhone","Pixel","Samsung"}
print(myset)

4. Dictionary:

Dictionary is a collection of key value pairs which is unordered, can be changed, and indexed. They are written in curly brackets with key - value pairs.

Example:

mydict = {
    "brand" :"iPhone",
    "model": "iPhone 11"
}
print(mydict)

Supported Libraries

Following are the libraries supported by OneCompiler's Python compiler

NameDescription
NumPyNumPy python library helps users to work on arrays with ease
SciPySciPy is a scientific computation library which depends on NumPy for convenient and fast N-dimensional array manipulation
SKLearn/Scikit-learnScikit-learn or Scikit-learn is the most useful library for machine learning in Python
PandasPandas is the most efficient Python library for data manipulation and analysis
DOcplexDOcplex is IBM Decision Optimization CPLEX Modeling for Python, is a library composed of Mathematical Programming Modeling and Constraint Programming Modeling