Created
October 16, 2018 14:13
-
-
Save tabvn/ef5b3b37893a6289cd93f89c90d36fef to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
| #include <fstream> | |
| using namespace std; | |
| /* | |
| /Users/toan/ued/16-10-2018/SP | |
| */ | |
| ifstream fi ("SP.INP"); | |
| ofstream fo ("SP.OUT"); | |
| int main(){ | |
| int m,n,t; | |
| long int sum; | |
| /** | |
| goi x la so but can phai tra tien | |
| khi mua m chiec thi duoc tang 1 chiec, vay mua x chiec se dc tang x/m | |
| x + x/m = n | |
| => x = (n*m)/(m+1) | |
| */ | |
| fi >> m >> n >> t; | |
| sum = ((n*m)/(m+1)) *t; | |
| fo << sum; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment