From 5cc6a34093905bba142df7bd88bfa7267d1792b4 Mon Sep 17 00:00:00 2001 From: Varun kumar Date: Fri, 2 Oct 2020 10:20:22 +0530 Subject: [PATCH] added solution to atcoder beginner contest 157A --- atcoder/contest157/157A.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 atcoder/contest157/157A.cpp diff --git a/atcoder/contest157/157A.cpp b/atcoder/contest157/157A.cpp new file mode 100644 index 0000000..66ff11f --- /dev/null +++ b/atcoder/contest157/157A.cpp @@ -0,0 +1,29 @@ +/* +Problem Statement + +Takahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper. +At least how many sheets of paper does he need? + +Constraints +N is an integer. +1 ≤ N ≤ 100 + +link - https://atcoder.jp/contests/abc157/tasks/abc157_a +*/ + +#include +using namespace std; + +int main() +{ + int n; + cin >> n; + if (n % 2 == 0) + { + cout << n / 2; + } + else + { + cout << (n + 1) / 2; + } +} \ No newline at end of file