/*
Author: vpetrigo
Task:

               . 
      .        . 
   ,     .

  
      :        (   1000).

  
    -   .

*/

#include <iostream>

using namespace std;

int table_count(int st);

int main() {
    int a, b, c;

    cin >> a >> b >> c;

    cout << table_count(a) + table_count(b) + table_count(c) << endl;

    return 0;
}

int table_count(int st) {
    static const int p_t = 2;

    return (st + p_t - 1) / 2;
}
/*
Author: vpetrigo
Task:

               . 
      .        . 
   ,     .

  
      :        (   1000).

  
    -   .

*/

#include <iostream>

using namespace std;

int main() {
    int a, b, c;
    const int p_t = 2;

    cin >> a >> b >> c;
    
    int sum_p = a + b + c;

    cout << (sum_p + p_t - 1) / p_t << endl;

    return 0;
}
--- 
+++ 
@@ -18,15 +18,20 @@
 
 using namespace std;
 
+int table_count(int st);
+
 int main() {
     int a, b, c;
-    const int p_t = 2;
 
     cin >> a >> b >> c;
-    
-    int sum_p = a + b + c;
 
-    cout << (sum_p + p_t - 1) / p_t << endl;
+    cout << table_count(a) + table_count(b) + table_count(c) << endl;
 
     return 0;
 }
+
+int table_count(int st) {
+    static const int p_t = 2;
+
+    return (st + p_t - 1) / 2;
+}
Change task 8 a little
Previously it calculated quantity of tables for all studens without taking into account classes.
Now it calulates tables needed for each class and then summarise results.
