Hanging Posters

  • + 0 comments

    Here's my code.Since I'm just a beginner so my coding style is quite simple and I'm working on my coding skills.So can anyone plz tell me which contest for beginners should I participate in to hone my skills.

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,h,i,res=0,temp;
        cin>>n>>h;
        int wall[n],poster[n];
        for(i=0;i<n;i++)
        cin>>wall[i];
        for(i=0;i<n;i++)
        {
            cin>>poster[i];
            temp=wall[i]-poster[i]/4;
            if(res<temp)
            res=temp;
        }
        if(res>h)
        cout<<res-h;
        else
        cout<<"0";
        return 0;
    }