Skip to content

Instantly share code, notes, and snippets.

@MohamedTaha98
Created July 1, 2017 21:15
Show Gist options
  • Save MohamedTaha98/5a5c94e22bdfe9cdf4830f0f81dca865 to your computer and use it in GitHub Desktop.
Save MohamedTaha98/5a5c94e22bdfe9cdf4830f0f81dca865 to your computer and use it in GitHub Desktop.
Problem Solving
#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