---
# System prepended metadata

title: Kattis intro

---

# Getting started with Kattis

## Example problem

We will use the following problem: [Leggja saman](https://open.kattis.com/problems/leggjasaman)

First, a description of the problem is presented.

![image](https://hackmd.io/_uploads/Hy6avRq6gl.png)

Then, a description of the problem's input format follows.

![image](https://hackmd.io/_uploads/HkmWORq6xg.png)

This means that the input is two integers, one on each line. For each, it is guaranteed that it is in the interval $2 \leq n \leq 1000$. You do not need to verify this; it is guaranteed to hold.

The way you read the input in this case is as follows:

```python
n=int(input())
m=int(input())
```

Then, the output format is presented:

![image](https://hackmd.io/_uploads/rkSuuA5Tge.png)

This means that you should print the answer to the console. To do this, do

```python
print(n+m)
```

Finally, some sample cases are also presented. Each one means "if your program is run with this input, it should give this output".

![image](https://hackmd.io/_uploads/S1VoO0caxl.png)

Thus, a working solution to this problem can be obtained by combining the input and output sections:
```python
n=int(input())
m=int(input())
print(n+m)
```

## Common errors

If you solution is incorrect, it will look something like this.

![image](https://hackmd.io/_uploads/ryOQY096ee.png)

If present, look at the "debugging hints" tab (this only exists for open.kattis, not po.kattis). If you fail the sample test cases, Kattis will show you what you output compared to the correct output.

![image](https://hackmd.io/_uploads/rJJLYCcaxl.png)

In this instance, the program accidentally also prints "give the first number".
```python
n=int(input("give the first number"))
m=int(input())
print(n+m)
```

It is very important that you only print the desired output- nothing more, nothing less.
