#include <iostream>

using namespace std;

int main() {
    int t;
    int tj;
    int ooo = 30;
    int cnt=0;
    cin >> t >> tj;
    if(tj - 30 >= 0)
        tj = tj - 30;
    else {   
        if(t -1 < 0){
            t = 23;
            tj = tj+60-30;
        }
        else{
        t = t-1;
        tj = tj+60-30;
        }
    }

    cout << t << " "  << tj;
                                                       
    return 0;
}   

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: