CSES - COCI 2007/2008 #2 - Results
Submission details
Task:Crne
Sender:untokarila
Submission time:2019-07-29 16:23:23 +0300
Language:C++ (C++11)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.01 sdetails
#2ACCEPTED0.01 sdetails
#3ACCEPTED0.01 sdetails
#4ACCEPTED0.01 sdetails
#5ACCEPTED0.01 sdetails

Code

#include <iostream>

using namespace std;

int main(){

    int n, a, b;
    cin >> n;
    a = n/2;
    b = a;
    if(n&1) b++;

    cout << a*b+a+b+1;

    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
2

correct output
4

user output
4

Test 2

Verdict: ACCEPTED

input
5

correct output
12

user output
12

Test 3

Verdict: ACCEPTED

input
10

correct output
36

user output
36

Test 4

Verdict: ACCEPTED

input
59

correct output
930

user output
930

Test 5

Verdict: ACCEPTED

input
100

correct output
2601

user output
2601