2 solutions

  • 0
    @ 2023-10-21 12:47:54
    #include <stdio.h>
    int main()
    {
        int x,y;
        int k=50;
        int sum=160;
        int j;
        for(x=1;x<=k;x++)
        {
            y=k-x;
            if(2*x+4*y==sum)
                {
                    printf("%d %d",x,y);
                    j=1;
                    break;
                }
           if(j==1)
           break;
        }
        return 0;
    }
    

    Information

    ID
    347
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    3
    Tags
    # Submissions
    147
    Accepted
    76
    Uploaded By