I would like to make a little comment regarding Task#1.
In the task is given that Giant could step over each K-th stair.
In this case, the answer to the question of how many stairs will Giant step in total is N - N/K.
(He steps over each K-th stair, then in total he steps over N/K stairs. That means that he steps N - N/K stairs.)
But, according to the given examples, he steps over K stairs on each step. In my code, I provide solution for this case.
- Task-1
g++ task1.cpp -o steps
./steps $N $K
- Task-2
g++ task2.cpp -o cables
./cables $N $D
- Task-3
g++ task3.cpp -o ls
./ls -la
./ls -l
./ls -a
- Task-4
g++ task4.cpp -o extract
./extract file.img somedir