using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp == hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    var times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(Fraction left, Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(Fraction left, Fraction right) => left + -right;
            public static Fraction operator *(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(Fraction right) => right;
            public static Fraction operator -(Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(Fraction left, Fraction right) => left.Equals(right);
            public static bool operator !=(Fraction left, Fraction right) => !(left == right);
            public static implicit operator double(Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public int CompareTo(Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp == hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    var times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(Fraction left, Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(Fraction left, Fraction right) => left + -right;
            public static Fraction operator *(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(Fraction right) => right;
            public static Fraction operator -(Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(Fraction left, Fraction right) => left.Equals(right);
            public static bool operator !=(Fraction left, Fraction right) => !(left == right);
            public static implicit operator double(Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public override int GetHashCode() => HashCode.Combine(Numerator, Denominator);
            public int CompareTo(Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp == hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    var times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public readonly struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(in Fraction left, in Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(in Fraction left, in Fraction right) => left + -right;
            public static Fraction operator *(in Fraction left, in Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(in Fraction left, in Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(in Fraction right) => right;
            public static Fraction operator -(in Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(in Fraction left, in Fraction right) => left.Equals(right);
            public static bool operator !=(in Fraction left, in Fraction right) => !(left == right);
            public static implicit operator double(in Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public override int GetHashCode() => HashCode.Combine(Numerator, Denominator);
            public int CompareTo([System.Diagnostics.CodeAnalysis.AllowNull] Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp == hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    decimal lastTemp = hotTemp;
                    var times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = (decimal)(hotTemp * times + coldTemp * (times - 1)) / (2 * times - 1);
                        if (temp <= targetTemp)
                        {
                            if (Math.Abs(lastTemp - targetTemp) <= Math.Abs(temp - targetTemp))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }
    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp >= hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    long times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(Fraction left, Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(Fraction left, Fraction right) => left + -right;
            public static Fraction operator *(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(Fraction right) => right;
            public static Fraction operator -(Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(Fraction left, Fraction right) => left.Equals(right);
            public static bool operator !=(Fraction left, Fraction right) => !(left == right);
            public static implicit operator double(Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator} = {(double)Numerator/Denominator:0.00}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public int CompareTo(Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp >= hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    long times = (hotTemp - targetTemp) / (2 * targetTemp - hotTemp - coldTemp) / 2;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(Fraction left, Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(Fraction left, Fraction right) => left + -right;
            public static Fraction operator *(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(Fraction right) => right;
            public static Fraction operator -(Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(Fraction left, Fraction right) => left.Equals(right);
            public static bool operator !=(Fraction left, Fraction right) => !(left == right);
            public static implicit operator double(Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator} = {(double)Numerator/Denominator:0.00}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public int CompareTo(Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using EducationalCodeforcesRound088Div2.Extensions;
using EducationalCodeforcesRound088Div2.Questions;

namespace EducationalCodeforcesRound088Div2.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var tests = inputStream.ReadInt();
            for (int t = 0; t < tests; t++)
            {
                var (hotTemp, coldTemp, targetTemp) = inputStream.ReadValue<int, int, int>();

                if (targetTemp >= hotTemp)
                {
                    yield return 1;
                }
                else if (targetTemp * 2 <= (hotTemp + coldTemp))
                {
                    yield return 2;
                }
                else
                {
                    var lastTemp = new Fraction(hotTemp, 1);
                    var times = 1;
                    while (true)
                    {
                        times += 1;
                        var temp = new Fraction(hotTemp * times + coldTemp * (times - 1), 2 * times - 1);
                        if (temp.Numerator <= targetTemp * temp.Denominator)
                        {
                            var lastTempTuubun = lastTemp.Numerator * temp.Denominator;
                            var tempTuubun = temp.Numerator * lastTemp.Denominator;
                            var targetTempTuubun = targetTemp * lastTemp.Denominator * temp.Denominator;
                            if (Math.Abs(lastTempTuubun - targetTempTuubun) <= Math.Abs(tempTuubun - targetTempTuubun))
                            {
                                yield return 2 * times - 3;
                            }
                            else
                            {
                                yield return 2 * times - 1;
                            }
                            break;
                        }
                        else
                        {
                            lastTemp = temp;
                        }
                    }
                }
            }
        }

        public struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
        {
            /// 分子
            public long Numerator { get; }
            /// 分母
            public long Denominator { get; }

            public static Fraction Nan => new Fraction(0, 0);
            public static Fraction PositiveInfinity => new Fraction(1, 0);
            public static Fraction NegativeInfinity => new Fraction(-1, 0);
            public bool IsNan => Numerator == 0 && Denominator == 0;
            public bool IsInfinity => Numerator != 0 && Denominator == 0;
            public bool IsPositiveInfinity => Numerator > 0 && Denominator == 0;
            public bool IsNegativeInfinity => Numerator < 0 && Denominator == 0;

            ///
            /// <c>Fraction</c>クラスの新しいインスタンスを生成します。
            ///
            /// <param name="numerator">分子</param>
            /// <param name="denominator">分母</param>
            public Fraction(long numerator, long denominator)
            {
                if (denominator == 0)
                {
                    Numerator = Math.Sign(numerator);
                    Denominator = 0;
                }
                else if (numerator == 0)
                {
                    Numerator = 0;
                    Denominator = 1;
                }
                else
                {
                    var sign = Math.Sign(numerator) * Math.Sign(denominator);
                    numerator = Math.Abs(numerator);
                    denominator = Math.Abs(denominator);
                    var gcd = Gcd(numerator, denominator);
                    Numerator = sign * numerator / gcd;
                    Denominator = denominator / gcd;
                }
            }

            public static Fraction operator +(Fraction left, Fraction right)
            {
                if (left.IsNan || right.IsNan)
                {
                    return Nan;
                }
                else if (left.IsInfinity || right.IsInfinity)
                {
                    if (!right.IsInfinity)
                    {
                        return left;
                    }
                    else if (!left.IsInfinity)
                    {
                        return right;
                    }
                    else
                    {
                        return new Fraction(left.Numerator + right.Numerator, 0);
                    }
                }
                else
                {
                    var lcm = Lcm(left.Denominator, right.Denominator);
                    return new Fraction(left.Numerator * (lcm / left.Denominator) + right.Numerator * (lcm / right.Denominator), lcm);
                }
            }
            public static Fraction operator -(Fraction left, Fraction right) => left + -right;
            public static Fraction operator *(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Numerator, left.Denominator * right.Denominator);
            public static Fraction operator /(Fraction left, Fraction right) => new Fraction(left.Numerator * right.Denominator, left.Denominator * right.Numerator);
            public static Fraction operator +(Fraction right) => right;
            public static Fraction operator -(Fraction right) => new Fraction(-right.Numerator, right.Denominator);
            public static bool operator ==(Fraction left, Fraction right) => left.Equals(right);
            public static bool operator !=(Fraction left, Fraction right) => !(left == right);
            public static implicit operator double(Fraction right)
            {
                if (right.IsNan)
                {
                    return double.NaN;
                }
                else if (right.IsPositiveInfinity)
                {
                    return double.PositiveInfinity;
                }
                else if (right.IsNegativeInfinity)
                {
                    return double.NegativeInfinity;
                }
                else
                {
                    return (double)right.Numerator / right.Denominator;
                }
            }

            public override string ToString()
            {
                if (IsNan)
                {
                    return "NaN";
                }
                else if (IsPositiveInfinity)
                {
                    return "Inf";
                }
                else if (IsNegativeInfinity)
                {
                    return "-Inf";
                }
                else
                {
                    return $"{Numerator}/{Denominator} = {(double)Numerator/Denominator:0.00}";
                }
            }

            public override bool Equals(object obj) => obj is Fraction fraction && Equals(fraction);
            public bool Equals(Fraction other) => Numerator == other.Numerator && Denominator == other.Denominator;
            public int CompareTo(Fraction other) => ((double)this).CompareTo(other);

            static long Gcd(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (a < b)
                {
                    (a, b) = (b, a);
                }

                while (b != 0)
                {
                    (a, b) = (b, a % b);
                }
                return a;
            }

            static long Lcm(long a, long b)
            {
                if (a <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(a), $"{nameof(b)}は正の整数である必要があります。");
                }
                if (b <= 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(b), $"{nameof(b)}は正の整数である必要があります。");
                }

                return a / Gcd(a, b) * b;
            }

        }

    }
}

namespace EducationalCodeforcesRound088Div2
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();
            var answers = question.Solve(Console.In);

            var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(writer);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
            Console.Out.Flush();
        }
    }
}

#region Base Class

namespace EducationalCodeforcesRound088Div2.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }
}

#endregion

#region Extensions

namespace EducationalCodeforcesRound088Div2.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);

        // Supports primitive type only.
        internal static T1 ReadValue<T1>(this TextReader reader) => (T1)Convert.ChangeType(reader.ReadLine(), typeof(T1));

        internal static (T1, T2) ReadValue<T1, T2>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            return (v1, v2);
        }

        internal static (T1, T2, T3) ReadValue<T1, T2, T3>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            return (v1, v2, v3);
        }

        internal static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            return (v1, v2, v3, v4);
        }

        internal static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            return (v1, v2, v3, v4, v5);
        }

        internal static (T1, T2, T3, T4, T5, T6) ReadValue<T1, T2, T3, T4, T5, T6>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            return (v1, v2, v3, v4, v5, v6);
        }

        internal static (T1, T2, T3, T4, T5, T6, T7) ReadValue<T1, T2, T3, T4, T5, T6, T7>(this TextReader reader, char separator = ' ')
        {
            var inputs = ReadStringArray(reader, separator);
            var v1 = (T1)Convert.ChangeType(inputs[0], typeof(T1));
            var v2 = (T2)Convert.ChangeType(inputs[1], typeof(T2));
            var v3 = (T3)Convert.ChangeType(inputs[2], typeof(T3));
            var v4 = (T4)Convert.ChangeType(inputs[3], typeof(T4));
            var v5 = (T5)Convert.ChangeType(inputs[4], typeof(T5));
            var v6 = (T6)Convert.ChangeType(inputs[5], typeof(T6));
            var v7 = (T7)Convert.ChangeType(inputs[6], typeof(T7));
            return (v1, v2, v3, v4, v5, v6, v7);
        }
    }
}

#endregion