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

Room monitoring and controlling system with ESP32, BME280, and Web Server

Building My First Web Application, Trashare

Getting started with Redis

How to Schedule Your Python Scripts to Run Automatically

The Growth of DevOps and It’s trends in 2019

Growth of DevOps and its trends

Refrigerator Repair Services

Recycling an old laptop screen

How to write formulas using HTML

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

Aiming for object-oriented design elegance

Overriding .equals method for inheriting classes in Java

Java 學習記錄109 — Introduction to SQLite

Queues in Java