URI Beecrowd 1116 Dividing X by Y Solution

URI Beecrowd 1116 Dividing X by Y Solution

URI BEECROWD Problems Solution

In this article, we will be discussing the solution to a coding problem that involves dividing X by Y. We will be using the programming languages C, C++, and Python to provide you with a solution that is not only accurate but also easy to understand.

The problem we will be solving is called the Uri Beecrowd 1116 – Dividing X by Y” problem. The objective of this problem is to divide two integers X and Y and output the quotient and remainder of the division. This problem can be solved using the modulus operator and integer division.

To start, we will first provide a brief overview of the problem statement and the input and output format. This will ensure that you have a clear understanding of the problem before we dive into the solution.

Problem Statement

Given two integers X and Y, you have to find the quotient and remainder of the division of X by Y.

Input Format

The input consists of two integers X and Y, where X is the dividend, and Y is the divisor.

Output Format

The output consists of two integers, the quotient, and the remainder of the division of X by Y.

Now that we have a clear understanding of the problem, let’s dive into the solution.

Solution

To solve this problem, we will use the modulus operator and integer division. The modulus operator gives us the remainder of the division, while integer division gives us the quotient.

C++ Solution

#include <iostream>

using namespace std;

int main() {
 int a;
 cin>>a;
 double d,b,c;
 for(int i=0;i<a;i++)
 {
    cin>>b>>c;
    d=b/c;
    if(c==0) {
            cout<<"divisao impossivel"<<endl;
    }
    else
    {
printf("%.1f\n",d);
    }

 }


    return 0;
}


Conclusion

In this article, we discussed the solution to the Uri Beecrowd 1116 – Dividing X by Y problem using the programming language C++. We provided a clear and concise explanation of the problem, the input and output format, and the solution using

Previous problem:Beecrowd 1049 Animal Solution

1 thought on “URI Beecrowd 1116 Dividing X by Y Solution”

  1. Pingback: Beecrowd 1026 To Carry or Not to Carry Solution - Free Code Center

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck