Which Mixture Solution

Problem

Chef has A units of solid and B units of liquid. He combines them to create a mixture. What kind of mixture does Chef produce: a solution, a solid, or a liquid?

A mixture is called :

  1. solution if A \gt 0 and B \gt 0,

  2. solid if B = 0, or

  3. liquid if A = 0.

Input Format

  • The first line contains T denoting the number of test cases. Then the test cases follow.
  • Each test case contains two space-separated integers A and B on a single line.

Output Format

For each test case, output on a single line the type of mixture Chef produces, whether it is a SolutionSolid, or LiquidThe output is case sensitive.

Constraints

  • 1 \leq T \leq 20
  • 0 \leq A, B \leq 100
  • A + B \gt 0

Subtasks

  • Subtask 1 (100 points): Original constraints

Sample 1:

Input
Output
3
10 5
0 3
3 0
Solution
Liquid
Solid

Explanation:

Test case 1: Chef adds both solid and liquid to the mixture, hence the mixture is a solution.

Test case 2: Chef does not add solid to the mixture, hence the mixture is liquid.

Test case 3: Chef does not add liquid to the mixture, hence the mixture is solid.




Program :


 /* package codechef; // don't place package name! */


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();

    if(a>0 && b>0)

    {

        System.out.println("Solution");

    }

    else if(b==0)

    {

        System.out.println("Solid");

    }

    else

    {

        System.out.println("Liquid");

    }

}

}

}


Post a Comment

0 Comments