SUMMER HEAT(COCONUT) Solution — Codechef JuneLong Challenge

Input

  • The first line contains an integer T, the number of test cases. Then the test cases follow.
  • Each test case contains a single line of input, four integers xa, xb, Xa, Xb.

Output

Constraints

  • 1≤T≤1500
  • 100≤xa≤200
  • 400≤xb≤500
  • 1000≤Xa≤1200
  • 1000≤Xb≤1500
  • xa divides Xa.
  • xb divides Xb.

Subtasks

Sample Input

3
100 400 1000 1200
100 450 1000 1350
150 400 1200 1200

Sample Output

13
13
11

Explanation

import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- >0){
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();

System.out.println((c/a) + (d/b));
}
}
}

--

--

--

Software Developer ,currently pursuing B.Tech in Information Technology. Electronic Dance Music is love.Also like all phone related technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Using PostgreSQL on a Windows 10 OS through Visual Studio Code via Windows Subsystem for Linux

A Detailed Information on the Top 9 Flutter Animation Packages

An overview of cybersecurity for web apps and built with Ruby on Rails

Called Shots

Modern enterprise integration patterns on AWS

Integrating Machine Learning & DevOps

The Multi-Eyed Monster

Design Patterns in iOS Swift

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anubhav Mishra

Anubhav Mishra

Software Developer ,currently pursuing B.Tech in Information Technology. Electronic Dance Music is love.Also like all phone related technologies

More from Medium

Why Learn Java in 2021

What You Need To Get About Git Before Gitting…GETTING Started

How Works Object Creation ?

Save Water and Electricity with IoT-based Alert System