Skip to content

Instantly share code, notes, and snippets.

@EugenyB
Created September 11, 2015 16:32
Show Gist options
  • Save EugenyB/eaf07588cbbca78700b2 to your computer and use it in GitHub Desktop.
Save EugenyB/eaf07588cbbca78700b2 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int k, n;
cin >> n >> k;
int t = n * 2 / k;
if (n*2 % k > 0) t++;
t *= 2;
if (t<4 && t!=0) t = 4;
cout << t << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment