Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- int main()
- {
- int lx = 7;
- int ly = 10;
- int lz = 17;
- int S = (lx + ly + lz);
- for (int K = 0; K < 1000;++K){
- int one = K * S;
- int add = S / 8;
- if (S % 8 != 0) add++;
- one += K * add;
- int two = K * S;
- int plus = (K*S) / 8;
- if ( (K*S) % 8 != 0) plus++;
- two += K * plus;
- if (two - one == 26 * 8){
- cout<<"K min = "<<K<<'\n';
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement