ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1820. Ural Steaks

[JAVA] Where is my mistake?
Posted by icytwister 5 Jun 2012 04:16
import java.util.*;
public class TimusUralBif
{
    int n;
    int k;
    int clock;
    public static void main(String [] args)
    {
        TimusUralBif b=new TimusUralBif();
        Scanner in=new Scanner(System.in);
        b.n=in.nextInt();
        if(b.n<1 || b.n>1000)
            return;

        b.k=in.nextInt();
        if(b.k<1 || b.k>1000)
            return;

        if(b.n%b.k==0)
            b.clock=((b.n/b.k)*2);
        else if(b.n/b.k==1)
            b.clock=b.n%b.k+2;
        else if(b.k>b.n)
            b.clock=2;
        else b.clock=b.n%b.k+2+(b.n/b.k);

        System.out.print(+b.clock);
    }
}

Help me, please :(

Edited by author 05.06.2012 18:21
Re: Where is my mistake?
Posted by Neofit 5 Jun 2012 12:03
Write your e-mail.
I help you.
Re: Where is my mistake?
Posted by Erop [USU] 5 Jun 2012 14:42
try test 9 5
ans: 4
Re: Where is my mistake?
Posted by icytwister 5 Jun 2012 14:44
ice.couples@gmail.com

Neofit thank you

Edited by author 05.06.2012 14:45