Created
July 1, 2017 21:15
-
-
Save MohamedTaha98/5a5c94e22bdfe9cdf4830f0f81dca865 to your computer and use it in GitHub Desktop.
Problem Solving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
long long diplomas, certificates, n, k, nonwinners; | |
cin >> n >> k; | |
diplomas = (n / 2) / (k + 1); | |
certificates = k * diplomas; | |
nonwinners = n - (certificates + diplomas); | |
cout << diplomas << " " << certificates << " " << nonwinners; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment