#include<bits/stdc++.h>
#include<algorithm>
#include<math>

using namesapce std;

int main(){
    char s[1001];
    gets(s);
    int count=0;
    int len;
    len=strlen(s);
    sort(s,s+len);
    for(int i=0;i<len;i++){
        if(s[i]>97 && s[i]<=122){
            count++;
            if(s[i]==s[i+1]){
                count--;
            }
        }
    }
    cout<<count<<endl;
    return 0;

}


#include<iostream>
#include<algorithm>
#include<math>

using namesapce std;

int main(){
    char s[1001];
    gets(s);
    int count=0;

    int len;
    len=strlen(s);
    sort(s,s+len);
    for(int i=0;i<len;i++){
        if(s[i]>97 && s[i]<=122){
            count++;
            if(s[i]==s[i+1]){
                count--;
            }
        }
    }
    cout<<count<<endl;
    return 0;

}


#include<bits/stdc++.h>
#include<algorithm>
#include<math>

using namesapce std;

int main(){
    char s[1001];
    gets(s);
    int count=0;

    int len;
    len=strlen(s);
    sort(s,s+len);
    for(int i=0;i<len;i++){
        if(s[i]>97 && s[i]<=122){
            count++;
            if(s[i]==s[i+1]){
                count--;
            }
        }
    }
    cout<<count<<endl;
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{

    int l,i,j,cn=0;
    char s[10000];
    gets(s);
    l=strlen(s);
    sort(s,s+l);
    for(i=0; i<l; i++)
    {
        if(s[i]>96&&s[i]<123)
        {
            cn++;
            if(s[i]==s[i+1])
                cn--;
        }

    }
    printf("%d\n",cn);
    cn=0;
}


# -*- coding: utf-8 -*-
"""
Created on Wed Jul  1 18:50:52 2020

@author: rishi
"""

t=int(input())
ans=[]
for i in range(t):
    n,r=input().split()
    n=int(n)
    r=int(r)
    summ=0
    for j in range(1,r+1):
        if(j<n):
            summ+=j
        if(j==n):
            summ+=1
        else:
            summ+=0
    ans.append(summ)

for an in ans:
    print(an)


# -*- coding: utf-8 -*-
"""
Created on Wed Jul  1 19:34:41 2020

@author: rishi
"""

# -*- coding: utf-8 -*-
"""
Created on Wed Jul  1 18:50:52 2020

@author: rishi
"""

t=int(input())
ans=[]
for i in range(t):
    n,r=input().split()
    n=int(n)
    r=int(r)
    summ=0

    if(n<r):
        r=n

    for j in range(1,r+1):
        if(j<n):
            summ+=j
        if(j==n):
            summ+=1
        if(j>n):
            break
    ans.append(summ)

for an in ans:
    print(an)


# -*- coding: utf-8 -*-
"""
Created on Wed Jul  1 19:34:41 2020

@author: rishi
"""

# -*- coding: utf-8 -*-
"""
Created on Wed Jul  1 18:50:52 2020

@author: rishi
"""

t=int(input())
ans=[]
for i in range(t):
    n,r=input().split()
    n=int(n)
    r=int(r)
    l=0

    if(n>r):
        l=(r)*(r+1)//2
    if(n<=r):
        l=(n)*(n-1)//2
        l+=1

    ans.append(l)

for an in ans:
    print(an)


t=int(input())
l=[]
for _ in range(t):
    n,r=map(int,input().split(" "))
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))//2)
    else:
        x=n-1
        ans=(x*(x+1))/2
        ans=ans+1
        l.append(ans)
for each in l:
    print(int(each))


t=int(input())
l=[]
for _ in range(t):
    n,r=map(int,input().split(" "))
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))//2)
    else:
        x=n-1
        ans=(x*(x+1))//2
        ans=ans+1
        l.append(ans)
for each in l:
    print(int(each))


t=int(input())
l=[]
for _ in range(t):
    n,r=map(int,input().split(" "))
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))/2)
    else:
        x=n-1
        ans=(x*(x+1))//2
        ans=ans+1
        l.append(ans)
for each in l:
    print(int(each))


t=int(input())
l=[]
for i in range(t):
    n,r=map(int,input().split())
    ans=0
    if n>r:
        l.append(r*(r+1)//2)
    else:
        x=n-1
        ans=x*(x+1)//2
        ans=ans+1
        l.append(ans)
for each in l:
    print(int(each))


import java.util.*;
public class MagicalCalendar{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		x=n-1
		while(t-->0){
			long n=sc.nextInt();
			long r=sc.nextInt();
			if(n>r)
				System.out.println(r*(r+1)/2);
			else
				System.out.println(x*(x+1)/2+1);
		}
	}
}


t=int(input())
l=[]
for _ in range(t):
    n,r=map(int,input().split())
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))/2)
    else:
        x=n-1
        ans=x*(x+1)//2
        ans=ans+1
        l.append(ans)
for each in l:
    print(each)


t=int(input())
l=[]
for _ in range(t):
    n=int(input())
    r=int(input())
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))/2)
    else:
        x=n-1
        ans=(x*(x+1))/2
        ans=ans+1
        l.append(ans)
for each in l:
    print(each)


t=int(input())
l=[]
for _ in range(t):
    n,r=map(int,input().split(" "))
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))/2)
    else:
        x=n-1
        ans=(x*(x+1))/2
        ans=ans+1
        l.append(ans)
for each in l:
    print(int(each))


t=int(input())
l=[]
for _ in range(t):
    n,r=int(input()).spilt(" ")
    ans=0
    #temp=0
    if n>r:
        l.append((r*(r+1))/2)
    else:
        x=n-1
        ans=(x*(x+1))/2
        ans=ans+1
        l.append(ans)
for each in l:
    print(each)


t = gets.to_i
t.times do
	n, r = gets.split.map &:to_i
	x = 0
	k = [r, n-1].min
	x += [0, (k+1)*k/2].max
	x += 1 if r >= n
	p x
end


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end
#####


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end
####


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end
#######


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end
##


require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
t = gets.chomp.to_i
t.times do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    puts num * (num+1) / 2
  else
    num = n - 1
    puts num * (num+1) / 2 + 1
  end
end
#


n = gets.chomp.to_i
n.times do
    n, r = gets.chomp.split(" ").map(&:to_i)
    if n > r
        arr = [*1..r]
        ans =  r * (1 + r)
        puts ans / 2
    elsif n <= r
        arr = [*1..n-1]
        ans = (n-1) * n
        puts ans / 2 + 1
    end
end


n = gets.chomp.to_i
n.times do
    n, r = gets.chomp.split(" ").map(&:to_i)
    if n > r
        arr = [*1..r]
        ans = arr.inject(:+)
        puts ans
    elsif n == r
        arr = [*1..r-1]
        ans = arr.inject(:+) + 1
        puts ans
    elsif n < r
        arr = [*1..n-1]
        ans = arr.inject(:+) + 1
        puts ans
    end
end


n = gets.chomp.to_i
n.times do
    n, r = gets.chomp.split(" ").map(&:to_i)
    if n > r
        ans =  r * (1 + r)
        puts ans / 2
    elsif n <= r
        ans = (n-1) * n
        puts ans / 2 + 1
    end
end


# this code is just to observe speed
t = gets.chomp.to_i
a = Array.new(t)
for i in 0..t-1 do
  n,r = gets.chomp.split.map(&:to_i)
  if n > r
    num = r
    a[i] = num * (num+1) / 2
  else
    num = n - 1
    a[i] = num * (num+1) / 2 + 1
  end
end

puts a.join("\n")


import sys
input = sys.stdin.readline

def solve(n, r):
	if n > r:
		return (r * (r+1)) // 2
	mi = n-1
	ans = (mi * (mi+1)) // 2
	return ans + 1

if __name__ == "__main__":
	t = int(input())
	for _ in range(t):
		[n, r] = map(int, input().split())
		print(solve(n, r))
'''
13 7
1 --> 1
2 --> 2
3 ---> 3
4 ---> 4
5 ---> 5
6 ---> 6
7 ---> 7

'''


for _ in range(input()):
    n,r=map(int,raw_input().split())
    if n<=r:
        t=n-1
        sm=t*(t+1)/2
        sm+=1
    else:
        sm=r*(r+1)/2
    print sm


for _ in range(input()):
    n,r=[int(i) for i in raw_input().split()]
    if r>=n:
        print (n*(n-1))/2+1
    else:
        print r*(r+1)/2


t = raw_input()
t = int(t)
n = []
r = []
for i in range(t):
    p = raw_input().split(' ')
    n.append(int(p[0]))
    r.append(int(p[1]))

for i in range(t):
    z = min(n[i], r[i])
    ans = (1 + z) * z / 2
    if n[i] <= r[i]:
        ans = ans - z + 1
    print(ans)


t=int(raw_input())
for r in range(t):
    n,r= map(long, raw_input().split(" "))
    #print n,r
    if n>=r:
        print ((r*(r+1))//2)
    else:
        print ((n*(n-1))//2)+1


t=int(raw_input())
for r in range(t):
    n,r= map(int, raw_input().split(" "))
    #print n,r
    if n>=r:
        print ((r*(r+1))//2)
    else:
        print ((n*(n-1))//2)+1


t=int(raw_input())
for r in range(t):
    n,r= map(long, raw_input().split(" "))
    #print n,r
    if n>r:
        print ((r*(r+1))//2)
    else:
        print ((n*(n-1))//2)+1


for i in range(input()):
    n, r = map(int, raw_input().split())
    if r < n:
        print ((r * (r + 1)) / 2)
    else:
        print ((n * (n - 1)) / 2) + 1


for i in range(input()):
    n, r = map(int, raw_input().split())
    if r < N:
		print ((r * (r + 1)) / 2)
	else:
		print ((n * (n - 1)) / 2) + 1


for _ in range(input()):
    n,r = map(int,raw_input().split())
    if n<=r:
        print(n*(n-1)/2 + 1)
    else:
        print r*(r+1)/2


t = int(raw_input())
for _ in xrange(t):
	n, r = map(int, raw_input().split())
	res = 0 if r < n else 1
	r = min(r, n - 1)
	res += r * (r + 1) // 2
	print res


#include <stdio.h>
#include <math.h>
#include <string.h>

int main ()
{
    int t, i, j;
    long long int n, r;
    scanf ("%d", &t);
    long long int arr [t][2];
    for (i = 0; i < t; i++) {
        for (j = 0; j < 2; j++) {
            scanf ("%lld", &arr [i][j]);
        }
    }
    for (i = 0; i < t; i++) {
        n = arr [i][0];
        r = arr [i][1];
        long long int ans;
        if (n > r) {
            if (r % 2 == 0) {
                ans = (r/2)*(r+1);
                printf ("%lld\n", ans);
            }
            else {
                ans = ((r+1)/2)*r;
                printf ("%lld\n", ans);
            }
        }
        else {
            if (n % 2 == 0) {
                ans = (n/2)*(n-1) + 1;
                printf ("%lld\n", ans);
            }
            else {
                ans = ((n-1)/2)*n + 1;
                printf ("%lld\n", ans);
            }
        }
    }
    return 0;
}


#include<stdio.h>
int main()
{
        long long int t,n,i,j,k,ans,r;
        scanf("%lld",&t);
        for(i=0;i<t;i++)
        {
		ans=0;
                scanf("%lld%lld",&n,&r);
		if(r>=n)
		{
			r=n-1;
			ans=1;
		}
		ans=ans+r*(r+1)/2;
		printf("%lld\n",ans);
        }
}


#include <stdio.h>
#include <stdlib.h>

typedef long long int lli;

#define in32(x) scanf("%d", &x)
#define out32(x) printf("%d\n", (x))
#define in64(x) scanf("%lld", &x)
#define out64(x) printf("%lld\n", (x))
#define outstr(x) printf("%s\n", (x))
#define fo3(a,b,c) for(a = (b); a <= (c); a++)
#define of3(a,b,c) for(a = (b); a >= (c); a--)

#define MIN(a,b) (((a)<(b))?(a):(b))

int main() {
    int n;
    lli a, b;
    in32(n);
    while(n-->0) {
        in64(a);
        in64(b);
        lli ans = (b * (b + 1)) >> 1;
        lli ans2 = 1 + ((a * (a - 1)) >> 1);
        if (ans > ans2) ans = ans2;
        out64(ans);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        unsigned long long int n,r;
        scanf("%llu%llu",&n,&r);
        unsigned long long int ans=0;
        if(n>r)
        {
            ans=(r*(r+1))/2;
        }
        else
        {
            ans=(n*(n-1))/2+1;
        }
        printf("%llu\n",ans);
    }
    return 0;
}


#include<stdio.h>

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
    	long long int n,r;
    	scanf("%lld %lld",&n,&r);
    	if(n>r)
    	printf("%lld\n",(r*(r+1))/2);
    	else
    	printf("%lld\n",(n*(n-1))/2+1);
    }
}


#include<stdio.h>
int main()
{
	int t;
	scanf("%d", &t);
	long long int n, r;
	for (; t > 0; t--)
	{
		scanf("%lld %lld", &n, &r);
		if (n < r)
			printf("%lld\n", n * (n - 1) / 2 + 1);
		else
			printf("%lld\n", r * (r + 1) / 2);
	}
	return 0;
}


#include<stdio.h>
int main()
{
	int t;
	scanf("%d", &t);
	long long int n, r;
	for (; t > 0; t--)
	{
		scanf("%lld %lld", &n, &r);
		if (n <= r)
			printf("%lld\n", n * (n - 1) / 2 + 1);
		else
			printf("%lld\n", r * (r + 1) / 2);
	}
	return 0;
}


#include<stdio.h>

int main(){
	int T;
	scanf("%d",&T);
	for (int i=0;i<T;i++){

	unsigned long long int n,r;
	scanf("%llu %llu",&n,&r);
	unsigned long long int ans = 0;

	//i>=n�� ���� 1������ ����

	//i<n�� ���
	if (r>=n)
		ans += (n)*(n-1)/2 + 1;
	else
		ans = ans + r*(r+1)/2;

	printf("%llu\n",ans);
	}
}


#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>
#include<math.h>
#define MAX 200001
typedef long long ll;

ll *result, count;

ll min(ll a, ll b)
{
    return (a < b)? a:b;
}

void solve()
{
    ll answer = 0;
    ll n, r;
    scanf("%lld %lld", &n, &r);
    ll limit = min(n-1, r);
    answer += limit*(limit + 1)/2;
    answer += (r >= n);
    result[count++] = answer;
}

int main()
{
    int t;
    count = 0;
    scanf("%d", &t);
    result = malloc(sizeof(ll) * t);
    while(t--){
        solve();
    }
    for(ll i = 0; i < count; i++)
        printf("%lld\n", result[i]);
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long n, r;
        scanf("%d%d", &n, &r);
        if(n == 1)
        {
            printf("1\n");
            continue;
        }
        if (n <= r)
        {
            printf("%lld\n", 1+(n*(n-1)/2));
        }
        else
        {
            printf("%lld\n", r*(r+1)/2);
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long n, r;
        scanf("%lld%lld", &n, &r);
        if(n == 1)
        {
            printf("1\n");
            continue;
        }
        if (n <= r)
        {
            printf("%lld\n", 1+(n*(n-1)/2));
        }
        else
        {
            printf("%lld\n", r*(r+1)/2);
        }
    }
}


#include <stdio.h>

int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n, r;
        scanf("%d%d", &n, &r);
        if(n == 1)
        {
            printf("1\n");
            continue;
        }
        if (n <= r)
        {
            printf("%d\n", 1 + (n * (n-1) / 2));
        }
        else
        {
            printf("%d\n", r*(r+1)/2);
        }
    }
}


#include<stdio.h>
int main()
{
	long long int tc;
	scanf("%lld",&tc);
	while (tc--)
    {
        long long int r, n;
        scanf("%lld %lld",&n,&r);
		long long int ans;
		if(r>=n){
			ans = (n-1) * n / 2 + 1;
			printf("%lld\n",ans);
		}
		else{
			ans = r * (r + 1) / 2;
			printf("%lld\n",ans);
		}
	}
 }


#include<stdio.h>
int main()
{
	long long int tc;
	scanf("%lld",&tc);
	while (tc--)
    {
        long long int r, n;
        scanf("%lld %lld",&n,&r);
		long long int ans;
		if(r>=n){
			ans = (n-1) * n / 2 + 1;
			printf("%lld",ans);
		}
		else{
			ans = r * (r + 1) / 2;
			printf("%lld",ans);
		}
	}
 }


#include<stdio.h>
int main()
{
 int t;
 scanf("%d",&t);
 while(t--)
 {
  long long int n,r;
  scanf("%lld %lld",&n,&r);
  if(n>r)
  printf("%lld\n",(r*(r+1))/2);
  else
  printf("%lld\n",(n*(n-1))/2+1);
 }
 return 0;
}


#include <stdio.h>

int main()
{
    int t, n, r;
    long long int count;
    scanf("%d", &t);
    for (int i = 0; i < t; i++) {
        count = 0;
        scanf("%d %d", &n, &r);
        for (int j = 1; j <= r; j++) {
            if (j == n) {
                count++;
                break;
            }
            count += (long long int)j;
        }
        printf("%lld\n", count);
    }
    return 0;
}


#include <stdio.h>

int main()
{
    int t, n, r;
    long long int count;
    scanf("%d", &t);
    for (int i = 0; i < t; i++) {
        count = 0;
        scanf("%d %d", &n, &r);
        if (n <= r)
            count = ((long long int)n - 1) * (long long int)n / 2 + 1;
        else
            count = (long long int)r * ((long long int)r + 1) / 2;
        printf("%lld\n", count);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long n,a,b,i;
    scanf("%lld",&n);
    for(i=0;i<n;i++)
    {
        scanf("%lld %lld",&a,&b);
        if(a>b)
            printf("%lld\n",(b*(b+1)/2));
        else
        {
            printf("%lld\n",(a*(a+1)/2)-a+1);

        }
    }return 0;
}


#include<stdio.h>
int main()
{
    int test,x,i,arr[1001],cout=1;
    scanf("%d",&test);
    while(test--)
    {

        scanf("%d",&x);
        for(i=1;i<=x;i++)
           {
            arr[i]=i;
           }
           for(i=1;i<=x;i++)
           {
               if((arr[i]+arr[i+1])<=x)
               {
                   cout++;
                  arr[i+1]=arr[i]+arr[i+1];

               }

           }
           printf("%d\n",cout);
           cout=1;

    }

}


#include<stdio.h>
int main()
{
    int test;
    scanf("%d",&test);
    long long n,r,x;
    while(test--)
    {
        scanf("%lld%lld",&n,&r);
        if(r<n)
            printf("%lld\n",(r*(r+1))/2);
        else
       {

        x=n-1;
        printf("%lld\n",(x*(x+1)/2)+1);
        }
    }

}


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long int a,b,n,i,k,j,r;
        scanf("%lld %lld",&n,&r);
        if(n>=r)
        {
            printf("%lld\n",(r*(r+1)/2));
        }
        else
        {
            printf("%lld\n",(n*(n-1)/2)+1);
        }
    }
    return 0;
}


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long int a,b,n,i,k,j,r;
        scanf("%lld %lld",&n,&r);
        if(n>r)
        {
            printf("%lld\n",(r*(r+1)/2));
        }
        else
        {
            printf("%lld\n",(n*(n-1)/2)+1);
        }
    }
    return 0;
}


#include<stdio.h>

int main(){
  long long n,l=1,r,t,res;
  scanf("%lld",&t);
  while(t>0){
    t--;
    res=0;
    scanf("%lld%lld",&n,&r);
    if(n<=l){printf("1\n");continue;}
    if(n<=r){r=n-1;res=1;}
    printf("%lld\n",res+((l+r)*(r-l+1))/2);
  }
  return 0;
}


#include <stdio.h>

int main() {
	//code
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    long long int a,c,as;
	    scanf("%lld%lld",&a,&c);
        as=((c+a)*(c-a+1))/2;
        printf("%lld\n",as);

	}
}


#include <stdio.h>
#include <stdlib.h>
#define N 109

// int cmpfunc (const void * a, const void * b) {
//    return ( *(int*)a - *(int*)b );
// }

   // qsort(values, 5, sizeof(int), cmpfunc);

int main() {
	int t;
	long long n, r, ans;

	scanf("%d", &t);
	while (t--){
		scanf("%lld%lld", &n, &r);
		if (n>r)
			ans = r*(r+1)/2;
		else
			ans =  n*(n-1)/2 +1;
		printf("%lld\n", ans);

	}

	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#define N 109

// int cmpfunc (const void * a, const void * b) {
//    return ( *(int*)a - *(int*)b );
// }

   // qsort(values, 5, sizeof(int), cmpfunc);

int main() {
	int t;
	long long n, r, ans;

	scanf("%d", &t);
	while (t--){
		scanf("%lld%lld", &n, &r);
		if (n>=r)
			ans = r*(r+1)/2;
		else
			ans =  n*(n-1)/2 +1;
		printf("%lld\n", ans);

	}

	return 0;
}


#include <stdio.h>

int main() {
  int t;
  scanf("%d", &t);
  while (t --) {
    int n, r;
    scanf("%d%d", &n, &r);
    long long ans;
    if (r >= n) ans = (long long)1 + (long long)n*(n-1)/2;
    else ans = (long long)(1 + r) * r / 2;
    printf("%lld\n", ans);
  }

  return 0;
}


#include <stdio.h>
int main()
{
	long long a,b,c,d,e,f,g,h,i,j,k,l;
	scanf("%lli",&a);
	for(;a>0;a--)
	{
		scanf("%lli%lli",&b,&c);
		d=c<b?((c+1)*c)/2:(((b-1)*b)/2)+1;
		printf("%lli\n",d);
	}
	return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    long long int n,r;
    int i;
    for(i=0;i<t;i++)
    {
    scanf("%lld%lld",&n,&r);
    long long int k;
    if(n>r)
    {
        k=(r*(r+1))/2;
        printf("%lld\n",k);
    }
    else
    {
        k=(n*(n-1))/2 + 1;
        printf("%lld\n",k);
    }
    }
    return 0;
}


#include <stdio.h>

int main()
{
    int N;
    long long n, r;
    long long res;
    scanf("%d", &N);
    while (N--) {
        res = 0;
        scanf("%lld %lld", &n, &r);
        if (r >= n) {
            res += 1;
            r = n - 1;
        }

        res = (r +  1) * r  / 2;

        printf("%lld\n", res);
    }

    return 0;
}


#include <stdio.h>

int main()
{
    int N;
    int n, r;
    long long res;
    scanf("%d", &N);
    while (N--) {
        res = 0;
        scanf("%d %d", &n, &r);
        if (r >= n) {
            res += 1;
            r = n - 1;
        }
        while (r--) {
            res += r + 1;
        }
        printf("%lld\n", res);
    }

    return 0;
}


#include <stdio.h>

int main()
{
    int N;
    long long n, r;
    long long res;
    scanf("%d", &N);
    while (N--) {
        res = 0;
        scanf("%lld %lld", &n, &r);
        if (r >= n) {
            res += 1;
            r = n - 1;
        }

        res = res + (r +  1) * r  / 2;

        printf("%lld\n", res);
    }

    return 0;
}


#include <stdio.h>

int main()
{
    int t,i;
        long long A[1005],B[1005];
    scanf("%d\n",&t);
    for(i=0;i<t;i++)
    {scanf("%lld %lld",&A[i],&B[i]);

    if (A[i]>B[i]) A[i]=(long long)B[i]*(B[i]+1)/2; else  A[i]=(long long)A[i]*(A[i]-1)/2+1;
    }
    for(i=0;i<t;i++)
    printf("%lld\n",A[i]);
    return 0;
}


#include<stdio.h>
int main ()
{
    unsigned long long int n;
    scanf("%llu",&n);

    while(n > 0)
    {
        unsigned long long int a,b;
        unsigned long long int i;
        scanf("%llu",&a);
        scanf("%llu",&b);

        unsigned long long int sum = 0;
        if(a < b)
        {
            sum = ((a-1)*(a))/2;
            sum++;
        }
        else
        {
            sum = (b*(b+1))/2;
        }

        printf("%llu\n",sum);

        n--;
    }

    return 0;
}


#include<stdio.h>
int main ()
{
    unsigned long int n;
    scanf("%lu",&n);

    while(n > 0)
    {
        unsigned long int a,b;
        unsigned long int i;
        scanf("%lu",&a);
        scanf("%lu",&b);

        unsigned long int sum = 0;
        if(a < b)
        {
            for(i =1; i <= a-1; i++)
            sum += i;
            sum++;
        }
        else
        {
            for(i = 1; i <= b; i++)
            sum += i;
        }

        printf("%lu\n",sum);

        n--;
    }

    return 0;
}


#include<stdio.h>
int main ()
{
    unsigned long long int n;
    scanf("%llu",&n);

    while(n > 0)
    {
        unsigned long long int a,b;
        unsigned long long int i;
        scanf("%llu",&a);
        scanf("%llu",&b);

        unsigned long long int sum = 0;
        if(a <= b)
        {
            sum = ((a-1)*(a))/2;
            sum++;
        }
        else
        {
            sum = (b*(b+1))/2;
        }

        printf("%llu\n",sum);

        n--;
    }

    return 0;
}


#include<stdio.h>
int main ()
{
    unsigned long int n;
    scanf("%lu",&n);

    while(n > 0)
    {
        unsigned long long int a,b;
        unsigned long long int i;
        scanf("%llu",&a);
        scanf("%llu",&b);

        unsigned long long int sum = 0;
        if(a < b)
        {
            for(i =1; i <= a-1; i++)
            sum += i;
            sum++;
        }
        else
        {
            for(i = 1; i <= b; i++)
            sum += i;
        }

        printf("%llu\n",sum);

        n--;
    }

    return 0;
}


#include <stdio.h>

int main() {
	//code
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++)
	{
	    long long int n,r,s=0;
	    scanf("%lld %lld",&n,&r);
	    if(r<n)
	    {
	        s=(r*(r+1))/2;
	    }
	    if(r>=n)
	    {
	        s=(n*(n-1))/2+1;
	    }
	    printf("%lld\n",s);
	}
	return 0;
}


#include <stdio.h>

int main() {
	//code
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++)
	{
	    long long int n,r,s=0;
	    scanf("%lld %lld",&n,&r);
	    for(int i=2;i<=r;i++)
	    {
	        if(i<n)
	        {
	            s=s+i;
	            /*if(n%i==0)
    	        {
    	            s=s+i;
    	        }
    	        else
    	        {
    	            s=s+i-1;
    	        }*/
	        }

	    }
	    if(r>=n)
	    {
	        s=s+1;
	    }
	    printf("%lld\n",s+1);
	}
	return 0;
}


    #include<stdio.h>

    int main(){
      long long n,l=1,r,t,res;
      scanf("%lld",&t);
      while(t>0){
        t--;
        res=0;
        scanf("%lld%lld",&n,&r);
        if(n<=l){printf("1\n");continue;}
        if(n<=r){r=n-1;res=1;}
        printf("%lld\n",res+((l+r)*(r-l+1))/2);
      }
      return 0;
    }


#include <stdio.h>
int main(){
    int t;
    scanf("%i",&t);
    while(t--){
        unsigned long long n,r,s=0ULL;
        scanf("%llu%llu",&n,&r);

        if(r<n)
            s = r*(r+1)/2ULL;
        else
            s = n*(n-1)/2 +1 ;
        printf("%llu\n",s);
    }
    return 0-0-0;
}


#include<stdio.h>
int main(){
     int t;
     scanf("%d",&t);
     for(int h=0;h<t;h++){
          int n,r;
          long long int count=0;
          scanf("%d%d",&n,&r);
          int k;
          if(r<n){
               count = ((long long int)r*(r+1))/2;
          }

          else if(r>=n){
               count = ((long long int)n*(n-1))/2 +1;
           }
          printf("%lld\n",count);
     }
     return 0;
}


#include<stdio.h>
int main(){
     int t;
     scanf("%d",&t);
     for(int h=0;h<t;h++){
          int n,r;
          long int count=0;
          scanf("%d%d",&n,&r);
          int k;
          if(r<n){
          for(k=1;k<r+1;k++){
               count = count + k;
          }
          }
          else if(r>=n){
               for(k=1;k<n;k++){
                    count = count + k;
          }
               count++;
          }
          printf("%ld\n",count);
     }
     return 0;
}


#include<stdio.h>
int main(){
     int t;
     scanf("%d",&t);
     for(int h=0;h<t;h++){
          int n,r;
          long long int count=0;
          scanf("%d%d",&n,&r);
          int k;
          if(r<n){
          for(k=1;k<r+1;k++){
               count = count + k;
          }
          }
          else if(r>=n){
               for(k=1;k<n;k++){
                    count = count + k;
          }
               count++;
          }
          printf("%lld\n",count);
     }
     return 0;
}


#include<stdio.h>
int main(){
     int t;
     scanf("%d",&t);
     for(int h=0;h<t;h++){
          int n,r;
          long int count=0;
          scanf("%d%d",&n,&r);
          int k;
          if(r<n){
          for(k=1;k<r;k++){
               count = count + k;
          }
          }
          else if(r>=n){
               for(k=1;k<n;k++){
                    count = count + k;
          }
               count++;
          }
          printf("%ld\n",count);
     }
     return 0;
}


#include <stdio.h>
int main() {
    long long int t, n, r;
    scanf("%lld", &t);
    while(t--) {
        scanf("%lld%lld", n, r);
        if(n > r)
            printf("%lld\n", (r * (r + 1))/2);
        else
            printf("%lld\n", (n * (n - 1))/2 + 1);
    }
    return 0;
}


#include <stdio.h>
int main() {
    long long int t, n, r;
    scanf("%lld", &t);
    while(t--) {
        scanf("%lld%lld", &n, &r);
        if(n > r)
            printf("%lld\n", (r * (r + 1))/2);
        else
            printf("%lld\n", (n * (n - 1))/2 + 1);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    long long int t,n,r,i;
    scanf("%lld",&t);
    for(i=0;i<t;i++)
    {
        scanf("%lld %lld",&n,&r);
        long long int p;
        if(n>r)
        {
            p=(r*(r+1))/2;
            printf("%lld\n",p);
        }
        else
        {
            p=(n*(n-1))/2;
            printf("%lld\n",p+1);
        }
    }
    return 0;
}


#include<stdio.h>

int main(){
  long long n,l=1,r,t,res;
  scanf("%lld",&t);
  while(t>0){
    t--;
    res=0;
    scanf("%lld%lld",&n,&r);
    if(n<=l){printf("1\n");continue;}
    if(n<=r){r=n-1;res=1;}
    printf("%lld\n",res+((l+r)*(r-l+1))/2);
  }
  return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        long long int n,r,ans=0;
        scanf("%lld%lld",&n,&r);
        for(long long int k=1;k<=r;k++)
        {
            if(k==1)
            {
                ans+=1;
            }
            else if(k==n)
            {
                ans+=1;
                break;
            }
            else if(k<n)
            {
                ans+=k;
            }
        }
        printf("%lld\n",ans);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        long long int n,r;
        long long int ans=0;
        scanf("%lld%lld",&n,&r);
        if(r<n)
        {
            ans+=(r*(r+1))/2;
        }
        else{
            ans+=(((n-1)*n)/2)+1;
        }
        printf("%lld\n",ans);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        long double n,r,ans=0;
        scanf("%Lf%Lf",&n,&r);
        if(r<n)
        {
            ans+=(r*(r+1)/2);
        }
        else{
            ans+=((n-1)*(n/2))+1;
        }
        printf("%Lf\n",ans);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        long double n,r;
        long int ans=0;
        scanf("%Lf%Lf",&n,&r);
        if(r<n)
        {
            ans+=(r*(r+1)/2);
        }
        else{
            ans+=((n-1)*(n/2))+1;
        }
        printf("%ld\n",ans);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
    {
        long double n,r;
        long long int ans=0;
        scanf("%Lf%Lf",&n,&r);
        if(r<n)
        {
            ans+=(r*(r+1)/2);
        }
        else{
            ans+=((n-1)*(n/2))+1;
        }
        printf("%lld\n",ans);
    }
    return 0;
}


/*
||-----------------------------------||
||        Rahat Khan Pathan          ||
||      BGC Trust University         ||
||       Department of CSE           ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define pub push_back
#define pi 3.14159265359
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define vpair vector<pair<ll,ll>>
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
void solve()
{
    ll n,l,k,s;
    cin>>n>>l>>k;
    ll ans=(k*l)+k-1;
    ans=(ans/(n-1));
    cout<<ans+k<<endl;
}
int main()
{
    fast;
    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


/*
||-----------------------------------||
||        Rahat Khan Pathan          ||
||      BGC Trust University         ||
||       Department of CSE           ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define pub push_back
#define pi 3.14159265359
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define vpair vector<pair<ll,ll>>
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
void solve()
{
    ll n,l,k;
    cin>>n>>l>>k;
    ll ans=((k*l)+k)-1;
    ans/=(n-1);
    cout<<ans<<endl;
}
int main()
{
    fast;
    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


/*
||-----------------------------------||
||        Rahat Khan Pathan          ||
||      BGC Trust University         ||
||       Department of CSE           ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define pub push_back
#define pi 3.14159265359
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define vpair vector<pair<ll,ll>>
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
void solve()
{
    ll n,l,k,s;
    cin>>n>>l>>k;
    ll ans=(k*l)+k-1;
    ans=ceil(ans*1.0/(n-1));
    cout<<ans+k<<endl;
}
int main()
{
    fast;
    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


/*
||-----------------------------------||
||        Rahat Khan Pathan          ||
||      BGC Trust University         ||
||       Department of CSE           ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define pub push_back
#define pi 3.14159265359
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define vpair vector<pair<ll,ll>>
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
void solve()
{
    ll n,l,k,s;
    cin>>n>>l>>k;
    ll ans=(k*l)+k-1;
    ans=(ans/(n-1));
    cout<<ans<<endl;
}
int main()
{
    fast;
    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


/*
||-----------------------------------||
||        Rahat Khan Pathan          ||
||      BGC Trust University         ||
||       Department of CSE           ||
||-----------------------------------||
*/
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define pub push_back
#define pi 3.14159265359
#define pob pop_back
#define puf push_front
#define pof pop_front
#define vi vector<int>
#define vll vector<ll>
#define All(X) (X).begin(),(X).end()
#define Unique(X) (X).erase(unique(All(X)),(X).end()))
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp make_pair
#define vpair vector<pair<ll,ll>>
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using namespace std;
void solve()
{
    ll n,l,k,v;
    cin>>n>>l>>k;
    ll ans=(k*l)+k-1;
    ans=(ans/(n-1));
    cout<<ans<<endl;
}
int main()
{
    //fast;
    ll t;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        double long x, y, k;
        cin >> x >> y >> k;
        double long a = y * k;
        long long c = ceil(((a + k) - 1) / (x - 1));
        cout << c + k << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        double long x, y, k;
        cin >> x >> y >> k;
        long long int a = y * k;
        double long c = ceil ((a + k)-1/ (x - 1));
        long long int z = c + k;
        cout << z << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        long long int x, y, k;
        cin >> x >> y >> k;
        long long int a = (y + 1) * k;
        long long int c = ((a + x - 3) / (x - 1));
        long long int z = c + k;
        cout << z << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        long long int x, y, k;
        cin >> x >> y >> k;
        long long int a = y * k;
        double long c = ceil((a + k) - 1 / (x - 1));
        long long int z = c + k;
        cout << z << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        long long x, y, k;
        cin >> x >> y >> k;
        double a = y * k;
        int c = ceil(((a + k) - 1) / (x - 1));
        cout << c + k << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y, k;
        cin >> x >> y >> k;
        int a = y * k;
        int c = (((a + k) - 1) / (x - 1));
        cout << c << endl;
    }
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        int x, y, k;
        cin >> x >> y >> k;
        long long ne = (long long) y * k;
        cout << k + (ne + k - 1 + x - 2) / (x - 1) << '\n';
}

int main() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        int x, y, k;
        cin >> x >> y >> k;
        long long ne = (long long) y * k;
        cout << k + (ne + k - 1 + x - 2) / (x - 1) << '\n';

}

int main() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        long long x, y, k;
        cin >> x >> y >> k;
        cout << k + (y * k + k - 1 + x - 2) / (x - 1) << endl;
}

int main() {
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        long long x, y, k;
        cin >> x >> y >> k;
        cout << k + (y * k + k - 1 + x - 2) / (x - 1) << endl;
}

int main() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        long long x, y, k;
        cin >> x >> y >> k;
        long long ne = y * k;
        cout << k + (ne + k - 1 + x - 2) / (x - 1) << '\n';
}

int main() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
using namespace std;

void solve() {
        long long x, y, k;
        cin >> x >> y >> k;
        cout << k + (y * k + k - 1 + x - 2) / (x - 1) << '\n';
}

int main() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int t;
        cin >> t;
        while (t --) {
                solve();
        }
        return 0;
}


#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		long double x, y, k;
		cin >> x >> y >> k;

		long double r = (y * k) + k;

		ll r1 = round(r/(x-1));

		if(x < k)
			r1--;
		else if(x > k)
			r1++;

		cout << r1+k << "\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		ll x, y, k;
		cin >> x >> y >> k;

		ll r = k + (y*k);
		r = r - x + 1;
		ll r1 = 1 + k;

		r1 += round(r/(x-1));

		if((x > k || y == k) && x-1 != 1)
			r1++;

		if(x-1 == 1)
			r1--;

		cout << r1 << "\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		long double x, y, k;
		cin >> x >> y >> k;

		long double r = (y * k) + k;

		ll r1 = round(r/(x-1));

		if(x < k)
			r1--;

		cout << r1 << "\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		long double x, y, k;
		cin >> x >> y >> k;

		long double r = (y * k) + k;

		ll r1 = round(r/(x-1));

		if(x < k)
			r1--;
		else if(x > k)
			r1++;

		cout << setprecision << "\n";
		cout << r1+k << "\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		ll x, y, k;
		cin >> x >> y >> k;

		ll p = (y*k)+(k-1);

		ll r = p/(x-1);

		if(p%(x-1))
			r++;

		cout << r+k << "\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
	ll t;
	cin >> t;
	while(t--)
	{
		ll x, y, k;
		cin >> x >> y >> k;

		double r = (y * k) + k;

		ll r1 = round(r/((double)x-1.0));

		if(x < k)
			r1--;
		else if(x > k || y == k)
			r1++;

		cout << r1+k << "\n";
	}

	return 0;
}


#include<iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    long long int t,x,y,k;
    cin>>t;
    while(t--)
    {
        long long c=0,l;
        cin>>x>>y>>k;
        c+=k;
        l = (k*(y+1)-x)/(x-1);
        c+=l;
        if((l%2==1 && k%2==0) || (l%2==0 && k%2==1))
            c+=1;
        c+=1;
        cout<<c<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    long long int t,x,y,k;
    cin>>t;
    while(t--)
    {
        long long int c=0,l;
        cin>>x>>y>>k;
        c+=k;
        l = (k*(y+1)-x)/(x-1);
        if(l==int(l))
        {
            c+=int(l)+1;
        }
        else
        {
            c+=int(l)+2;
        }
        cout<<c<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    long long int t,x,y,k;
    cin>>t;
    while(t--)
    {
        long long int c=0;
        cin>>x>>y>>k;
        c+=k;
        c+= int((k*y)/(k-1));
        c+=1;
        cout<<c<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    long long int t,x,y,k;
    cin>>t;
    while(t--)
    {
        long long int c=0,l;
        cin>>x>>y>>k;
        c+=k;
        l = (k*(y+1))/(x-1);
        if(l==int(l))
        {
            c+=int(l)+1;
        }
        else
        {
            c+=int(l)+2;
        }
        cout<<c<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    long double t,x,y,k;
    cin>>t;
    while(t--)
    {
        long double c=0,l;
        cin>>x>>y>>k;
        l = (k*(y+1)-x)/(x-1);
        long long int l1 = l;
        if(l1!=l && l>=0)
            l1+=1;
        l1+=k+1;
        cout<<l1<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    long double t,x,y,k;
    cin>>t;
    while(t--)
    {
        long double c=0,l;
        cin>>x>>y>>k;
        l = (k*(y+1)-x)/(x-1);
        long long int l1 = l;
        if(l1!=l)
            l1+=1;
        l1+=k+1;
        cout<<l1<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;
#define long long int ll;

int main()
{
    ll t,x,y,k;
    cin>>t;
    while(t--)
    {
        ll c=0;
        cin>>x>>y>>k;
        c+=k;
        c+= int((k*y)/(k-1));
        c+=1;
        cout<<c<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    long long int t,x,y,k;
    cin>>t;
    while(t--)
    {
        long long c=0,l;
        cin>>x>>y>>k;
        c+=k;
        l = (k*(y+1)-x)/(x-1);
        c+=l;
        if(l%2==1)
            c+=1;
        c+=1;
        cout<<c<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int g;
    cin>>g;
    while(g--){
        long long x,y,z,s,t;
        cin>>x>>y>>z;
        s=(z*(y+1))-1 ;
        t=(s/(x-1));
        long long b = s%(x-1);
        if(b)
            t++;
        cout<<t+z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int t;
    cin>>t;
    while(t--){
        long long x,y,z,s,t;
        cin>>x>>y>>z;
        t=y;
        s=z*(y+1);
        t=t+ s/(x-1);
        cout<<t<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int t;
    cin>>t;
    while(t--){
        long long x,y,z,s,t;
        cin>>x>>y>>z;
        t=y;
        s=k*(y+1);
        t=t+ s/(x-1);
        cout<<t<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int g;
    cin>>g;
    while(g--){
        long long x,y,z,s,t;
        cin>>x>>y>>z;
        s=(z*(y+1))-1 ;
        t=(s/(x-1));
        long long b = t%(x-1);
        if(b)
            t++;
        cout<<t+z<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int t;
    cin>>t;
    while(t--){
        ll x,y,z,s,t;
        t=y;
        s=k*(y+1);
        t=t+ s/(x-1);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    int t;
    cin>>t;
    while(t--){
        ll x,y,z,s,t;
        cin>>x>>y>>z;
        t=y;
        s=k*(y+1);
        t=t+ s/(x-1);
        cout<<t<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        long long x;
        int y,k;
        cin>>x>>y>>k;
        long long m,n;
        n=(k*y+k-1)/(x-1);
       if((k*y+k-1)%(x-1)==0)
        m=k + n;
        else
        m=k+n+1;
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        int x,y,k;
        cin>>x>>y>>k;
        long long m,n;
        n=(k*y+k-1)/(x-1);
        m=k*y + ceil(n);
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        int x,y,k;
        cin>>x>>y>>k;
        long long m,n;
        n=(k(y+1)-1)/(x-1);
        m=k*y + ceil(n);
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        int x,y,k;
        cin>>x>>y>>k;
        long long m;

        m=k + ceil( (k*y+k-1)/(x-1));
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        long long x,y,k;

        cin>>x>>y>>k;
        long long m,n;
        n=(k*y+k-1)/(x-1);
       if((k*y+k-1)%(x-1)==0)
        m=k + n;
        else
        m=k+n+1;
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        int x,y,k;
        cin>>x>>y>>k;
        long long m;
        m=k*y + ceil((k(y+1)-1)/(x-1));
        cout<<m<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin>>t;
    while(t--)
    {
        long long x;
        int y,k;
        cin>>x>>y>>k;
        long long m;

        m=k + ceil( (k*y+k)/(x-1));
        cout<<m<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long noOfTests;
    long long ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        long long totalSticks = torches*(1+sc);
        long long stickToSticks = ceil((double)(totalSticks-1)/(double)(ss-1));
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    long long ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        long long totalSticks = torches*(1+sc);
        long long stickToSticks = (double)(totalSticks+ss-3)/(double)(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long noOfTests;
    long ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        long totalSticks = torches*(1+sc);
        long stickToSticks = (totalSticks+ss-3)/(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    long long ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        long long totalSticks = torches*(1+sc);
        long long stickToSticks = (totalSticks+ss-3)/(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    int ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        int totalSticks = torches*(1+sc);
        int stickToSticks = ceil((double)(totalSticks-1)/(double)(ss-1));
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    int ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        int totalSticks = torches*(1+sc);
        int stickToSticks = totalSticks+ss-2/ss-1;
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    int ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        int totalSticks = torches*(1+sc);
        int stickToSticks = (totalSticks+ss-2)/(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    long ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        long long totalSticks = torches*(1+sc);
        long long stickToSticks = (totalSticks+ss-3)/(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int noOfTests;
    int ss,sc,torches;
    cin>>noOfTests;

    while(noOfTests--){
        cin>>ss>>sc>>torches;
        int totalSticks = torches*(1+sc);
        int stickToSticks = (totalSticks+ss-1)/(ss-1);
        cout<<stickToSticks+torches<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll sticks = k*b;
      sticks+=k;
      sticks--;
      ll get = sticks/(a-1);
      ll other = sticks%(a-1);
      if(other)
         get++;
      cout<<get+k<<N;
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll sticks = k*b;
      sticks+=k;
      sticks--;
      ll get = sticks/(a-1);
      ll other = sticks%(a-1);
      if(other)
         get++;
      cout<<total+k<<N;
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll sticks = k*b;
      sticks+=k;
      sticks--;
      ll get = sticks/(a-1);
      ll other = sticks%(a-1);
      if(get%2==0){
         cout<<get+k;
      }
      else{
         get++;
         cout<<get+k;
      }
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll ex = (b*k)+k;
      ll get = (ex-1)/(a-1);
      if(get%2==0){
         cout<<get+k;
      }
      else{
         cout<<get+k+1;
      }
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll sticks = (k*b)+k;
      //sticks+=k;
      //sticks--;
      ll get = (sticks-1)/(a-1);
      ll other = (sticks-1)%(a-1);
      if(other)
         get++;
      cout<<total+k<<N;
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll ex = (b*k)+k;
      ll get = (ex-1)/(a-1);
      if(get%2==0)
         cout<<get+k;
      else
         cout<<get+1+k;
   }
}


#include <bits/stdc++.h>
using namespace std;
const int NN = 1e5+5;
#define ll long long
#define N "\n"

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

   ios::sync_with_stdio(false);
   cin.tie(0);

   ll tc,a,b,k;
   cin>>tc;
   while(tc--){
      cin>>a>>b>>k;
      ll sticks = (k*b)+k;
      //sticks+=k;
      //sticks--;
      ll get = (sticks-1)/(a-1);
      ll other = (sticks-1)%(a-1);
      if(other)
         get++;
      cout<<get+k<<N;
   }
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans = (k*y + k - x)/(x-1);
    if(ans<=0)
    {
        ans = 1;
        ans+= k;
    }
    else
    {
        ans++;
        if((k*y + k - x)%(x-1))
            ans++;
        ans+= k;
    }
    cout<<ans<<"\n";
}

/*
1
1000000000 1 1
*/

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans = ceil( (k*y + k - x)*1.00/(x-1));
    if(ans<0)
    {
        ans = 1;
        ans+= k;
    }
    else
    {
        ans++;
//        if((k*y + k - x)%(x-1))
//            ans++;
        ans+= k;
    }
    cout<<ans<<"\n";
}

/*
1
1000000000 1 1
*/

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans = (k*y + k - x)/(x-1);
    if(ans<0)
        ans = 0;
    ans++;
    cout<<ans<<"\n";
}

/*

*/

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans = (k*y + k - x)/(x-1);
    if(ans<0)
    {
        ans = 1;
        ans+= k;
    }
    else
    {
        ans++;
        if((k*y + k - x)%(x-1))
            ans++;
        ans+= k;
    }
    cout<<ans<<"\n";
}

/*

*/

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans = (k*y + k - x)/(x-1);
    if(ans<0)
        ans = 0;
    ans++;
    if((k*y + k - x)%(x-1))
        ans++;
    ans+= k;
    cout<<ans<<"\n";
}

/*

*/

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define HERE cout<<"here - "<<__LINE__<<"\n";
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout<<endl;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cout << *it << " = " << a << " ";
    err(++it, args...);
}
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e6+5;
const ll mod = 1e9+7 ;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    ll x,y,k;
    cin>>x>>y>>k;
    ll ans =  (k*y + k - x + x - 1 - 1)/(x-1);
    if(ans<0)
    {
        ans = 1;
        ans+= k;
    }
    else
    {
        ans++;
        ans+= k;
    }
    cout<<ans<<"\n";
}

int main()
{
#ifndef APURBA
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    int t=1,cas=0;
    cin>>t;
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
        int t;
	cin>>t;
	while(t--)
	{
	    long long int x,y,k;
	    cin>>x>>y>>k;
	    unsigned long long int n,sum;
	    sum=k+y*k-x;
	    n = sum/(x-1);
	    if(sum % (x-1) <= 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
	    long long int x,y,k;
	    cin>>x>>y>>k;
	    unsigned long long int n,sum;
	    sum=k+y*k-x;
	    n = sum/(x-1);
	    if(sum % (x-1) == 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
        int t;
	cin>>t;
	while(t--)
	{
	    long long int x,y,k;
	    cin>>x>>y>>k;
	    signed long long int n,sum;
	    sum=k+y*k-x;
	    n = sum/(x-1);
	    if(sum % (x-1) <= 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
	    long int x,y,k;
	    cin>>x>>y>>k;
	    long long int n,sum;
	    sum=k+y*k-x;
	    n = sum/(x-1);
	    if(sum % (x-1) == 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
        int t;
	cin>>t;
	while(t--)
	{
	    long long int x,y,k;
	    cin>>x>>y>>k;
	    unsigned long long int n,sum;
	    sum=k+y*k-x;
            if(sum<=0)
               cout<<"2"<<endl;
            else {
	    n = sum/(x-1);
	    if(sum % (x-1) == 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
           }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	long int t;
	cin>>t;
	while(t--)
	{
	    unsigned long long int x,y,k;
	    cin>>x>>y>>k;
	    unsigned long long int n,sum;
	    sum=k+y*k-x;
	    n = sum/(x-1);
	    if(sum % (x-1) == 0)
	       cout<<(n+1+k)<<endl;
	    else
	       cout<<(n+2+k)<<endl;
	}
	return 0;
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define NEWLINE cout << '\n'
#define loop(n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define MULTI_TEST int t; cin >> t; while (t--)
#define INF 1000000000 // One billion

#define EXTERNAL_FILES 0
#if EXTERNAL_FILES
ifstream fin("avatar.in");
ofstream fout("avatar.in");
#define cin fin
#define cout fout
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<vi, int> msi;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

string binary(int n) {
	string bin;
	while (n) {
		bin += (n % 2 ? '1' : '0');
		n /= 2;
	}
	reverse(bin.begin(), bin.end());
	return bin;
}
bool isPalindrome(string s) {
	for (int i = 0, j = s.size() - 1; i < j; i++, j--)
		if (s[i] != s[j]) return 0;
	return 1;
}
bool isPrime(ll n) {
	if (n <= 1) return false;
	for (ll i = 2; i * i <= n; i++) {
		if (n % i == 0) return false;
	}
	return true;
}
inline vi sieve(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	vi primes;
	for (int i = 2; i <= n; i++)
		if (isPrime[i]) primes.push_back(i);
	return primes;
}

inline vi primeFactors(int n) {
	vi factors;
	vi primes = sieve(100000);
	int i = 0;
	while (n != 1 && i < primes.size()) {
		if (n % primes[i] == 0) {
			factors.push_back(primes[i]);
			n /= primes[i];
		}
		else {
			i++;
		}
	}
	return factors;
}

void shift_right(vi& A, int x) {
	int n = A.size();
	x %= n;
	vi B(n);
	for (int i = 0; i < n; i++)
		B[(i + x)%n] = A[i];
	A = B;
}
inline vector<bool> sieveQuery(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	return isPrime;
}

#define TEST_GENERATION_MODE 0
#if TEST_GENERATION_MODE
ifstream fin("output.txt");
#define cin fin
#endif

/*
int t; cin >> t;
while(t--) {
	int n; cin >> n;
	vi A(n); loop(n) cin >> A[i];

}
*/

#define EXTERNAL_OUT 1
#if EXTERNAL_OUT
ofstream fout("output.txt");
#define cout fout
#endif

int main()
{
	IOS;
	int t; cin >> t;
	while (t--) {
		long double x, y, k;
		cin >> x >> y >> k;
		//k-1 + yk         k(y+1)-1
		cout << ll(floor((y*k+k - 1.0 + (x - 1.0) - 1.0) / (x - 1.0))) << '\n';
	}

#if EXTERNAL_OUT
	fout.close();
	system("output.txt");
#endif
}

/*

*/


#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define NEWLINE cout << '\n'
#define loop(n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define MULTI_TEST int t; cin >> t; while (t--)
#define INF 1000000000 // One billion

#define EXTERNAL_FILES 0
#if EXTERNAL_FILES
ifstream fin("avatar.in");
ofstream fout("avatar.in");
#define cin fin
#define cout fout
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<vi, int> msi;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

string binary(int n) {
	string bin;
	while (n) {
		bin += (n % 2 ? '1' : '0');
		n /= 2;
	}
	reverse(bin.begin(), bin.end());
	return bin;
}
bool isPalindrome(string s) {
	for (int i = 0, j = s.size() - 1; i < j; i++, j--)
		if (s[i] != s[j]) return 0;
	return 1;
}
bool isPrime(ll n) {
	if (n <= 1) return false;
	for (ll i = 2; i * i <= n; i++) {
		if (n % i == 0) return false;
	}
	return true;
}
inline vi sieve(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	vi primes;
	for (int i = 2; i <= n; i++)
		if (isPrime[i]) primes.push_back(i);
	return primes;
}

inline vi primeFactors(int n) {
	vi factors;
	vi primes = sieve(100000);
	int i = 0;
	while (n != 1 && i < primes.size()) {
		if (n % primes[i] == 0) {
			factors.push_back(primes[i]);
			n /= primes[i];
		}
		else {
			i++;
		}
	}
	return factors;
}

void shift_right(vi& A, int x) {
	int n = A.size();
	x %= n;
	vi B(n);
	for (int i = 0; i < n; i++)
		B[(i + x)%n] = A[i];
	A = B;
}
inline vector<bool> sieveQuery(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	return isPrime;
}

#define TEST_GENERATION_MODE 0
#if TEST_GENERATION_MODE
ifstream fin("output.txt");
#define cin fin
#endif

/*
int t; cin >> t;
while(t--) {
	int n; cin >> n;
	vi A(n); loop(n) cin >> A[i];

}
*/

#define EXTERNAL_OUT 0
#if EXTERNAL_OUT
ofstream fout("output.txt");
#define cout fout
#endif

int main()
{
	IOS;
	int t; cin >> t;
	while (t--) {
		long double x, y, k;
		cin >> x >> y >> k;
		//k-1 + yk         k(y+1)-1
		cout <<
			ll(
				long double(y*k+k - 3.0 + x) /
				long double(x - 1.0) + k
			)
			<< '\n';
		// (k + k * y - 1 + x - 2) / (x - 1) + k
	}

#if EXTERNAL_OUT
	fout.close();
	system("output.txt");
#endif
}

/*

*/


#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define NEWLINE cout << '\n'
#define loop(n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define MULTI_TEST int t; cin >> t; while (t--)
#define INF 1000000000 // One billion

#define EXTERNAL_FILES 0
#if EXTERNAL_FILES
ifstream fin("avatar.in");
ofstream fout("avatar.in");
#define cin fin
#define cout fout
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<vi, int> msi;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

string binary(int n) {
	string bin;
	while (n) {
		bin += (n % 2 ? '1' : '0');
		n /= 2;
	}
	reverse(bin.begin(), bin.end());
	return bin;
}
bool isPalindrome(string s) {
	for (int i = 0, j = s.size() - 1; i < j; i++, j--)
		if (s[i] != s[j]) return 0;
	return 1;
}
bool isPrime(ll n) {
	if (n <= 1) return false;
	for (ll i = 2; i * i <= n; i++) {
		if (n % i == 0) return false;
	}
	return true;
}
inline vi sieve(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	vi primes;
	for (int i = 2; i <= n; i++)
		if (isPrime[i]) primes.push_back(i);
	return primes;
}

inline vi primeFactors(int n) {
	vi factors;
	vi primes = sieve(100000);
	int i = 0;
	while (n != 1 && i < primes.size()) {
		if (n % primes[i] == 0) {
			factors.push_back(primes[i]);
			n /= primes[i];
		}
		else {
			i++;
		}
	}
	return factors;
}

void shift_right(vi& A, int x) {
	int n = A.size();
	x %= n;
	vi B(n);
	for (int i = 0; i < n; i++)
		B[(i + x)%n] = A[i];
	A = B;
}
inline vector<bool> sieveQuery(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	return isPrime;
}

#define TEST_GENERATION_MODE 0
#if TEST_GENERATION_MODE
ifstream fin("output.txt");
#define cin fin
#endif

/*
int t; cin >> t;
while(t--) {
	int n; cin >> n;
	vi A(n); loop(n) cin >> A[i];

}
*/

#define EXTERNAL_OUT 0
#if EXTERNAL_OUT
ofstream fout("output.txt");
#define cout fout
#endif

int main()
{
	IOS;
	int t; cin >> t;
	while (t--) {
		ll x, y, k;
		cin >> x >> y >> k;	//k/x + ceil(y*k/x)
		cout << ll(ceil(k / (x - 1.0))) + ll(ceil(y * k / (x - 1.0))) - 1LL << '\n';
	}

#if EXTERNAL_OUT
	fout.close();
	system("output.txt");
#endif
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define NEWLINE cout << '\n'
#define loop(n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define MULTI_TEST int t; cin >> t; while (t--)
#define INF 1000000000 // One billion

#define EXTERNAL_FILES 0
#if EXTERNAL_FILES
ifstream fin("avatar.in");
ofstream fout("avatar.in");
#define cin fin
#define cout fout
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<vi, int> msi;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

string binary(int n) {
	string bin;
	while (n) {
		bin += (n % 2 ? '1' : '0');
		n /= 2;
	}
	reverse(bin.begin(), bin.end());
	return bin;
}
bool isPalindrome(string s) {
	for (int i = 0, j = s.size() - 1; i < j; i++, j--)
		if (s[i] != s[j]) return 0;
	return 1;
}
bool isPrime(ll n) {
	if (n <= 1) return false;
	for (ll i = 2; i * i <= n; i++) {
		if (n % i == 0) return false;
	}
	return true;
}
inline vi sieve(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	vi primes;
	for (int i = 2; i <= n; i++)
		if (isPrime[i]) primes.push_back(i);
	return primes;
}

inline vi primeFactors(int n) {
	vi factors;
	vi primes = sieve(100000);
	int i = 0;
	while (n != 1 && i < primes.size()) {
		if (n % primes[i] == 0) {
			factors.push_back(primes[i]);
			n /= primes[i];
		}
		else {
			i++;
		}
	}
	return factors;
}

void shift_right(vi& A, int x) {
	int n = A.size();
	x %= n;
	vi B(n);
	for (int i = 0; i < n; i++)
		B[(i + x)%n] = A[i];
	A = B;
}
inline vector<bool> sieveQuery(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	return isPrime;
}

#define TEST_GENERATION_MODE 0
#if TEST_GENERATION_MODE
ifstream fin("output.txt");
#define cin fin
#endif

/*
int t; cin >> t;
while(t--) {
	int n; cin >> n;
	vi A(n); loop(n) cin >> A[i];

}
*/

#define EXTERNAL_OUT 0
#if EXTERNAL_OUT
ofstream fout("output.txt");
#define cout fout
#endif

int main()
{
	IOS;
	int t; cin >> t;
	while (t--) {
		long double x, y, k;
		cin >> x >> y >> k;
		//k-1 + yk         k(y+1)-1
		cout << ll(floor((y*k+k - 1.0 + (x - 1.0) - 1.0) / (x - 1.0))) << '\n';
	}

#if EXTERNAL_OUT
	fout.close();
	system("output.txt");
#endif
}

/*

*/


#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <string.h>
#include <cstring>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define NEWLINE cout << '\n'
#define loop(n) for(int i = 0; i < n; i++)
#define all(a) a.begin(), a.end()
#define MULTI_TEST int t; cin >> t; while (t--)
#define INF 1000000000 // One billion

#define EXTERNAL_FILES 0
#if EXTERNAL_FILES
ifstream fin("avatar.in");
ofstream fout("avatar.in");
#define cin fin
#define cout fout
#endif

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<vi, int> msi;

ll gcd(ll a, ll b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

string binary(int n) {
	string bin;
	while (n) {
		bin += (n % 2 ? '1' : '0');
		n /= 2;
	}
	reverse(bin.begin(), bin.end());
	return bin;
}
bool isPalindrome(string s) {
	for (int i = 0, j = s.size() - 1; i < j; i++, j--)
		if (s[i] != s[j]) return 0;
	return 1;
}
bool isPrime(ll n) {
	if (n <= 1) return false;
	for (ll i = 2; i * i <= n; i++) {
		if (n % i == 0) return false;
	}
	return true;
}
inline vi sieve(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	vi primes;
	for (int i = 2; i <= n; i++)
		if (isPrime[i]) primes.push_back(i);
	return primes;
}

inline vi primeFactors(int n) {
	vi factors;
	vi primes = sieve(100000);
	int i = 0;
	while (n != 1 && i < primes.size()) {
		if (n % primes[i] == 0) {
			factors.push_back(primes[i]);
			n /= primes[i];
		}
		else {
			i++;
		}
	}
	return factors;
}

void shift_right(vi& A, int x) {
	int n = A.size();
	x %= n;
	vi B(n);
	for (int i = 0; i < n; i++)
		B[(i + x)%n] = A[i];
	A = B;
}
inline vector<bool> sieveQuery(int n) {
	vector<bool> isPrime(n + 1, true);
	for (int i = 2; i <= sqrt(n); i++) {
		if (isPrime[i])
			for (int j = 2 * i; j <= n; j += i) {
				isPrime[j] = false;
			}
	}
	return isPrime;
}

#define TEST_GENERATION_MODE 0
#if TEST_GENERATION_MODE
ifstream fin("output.txt");
#define cin fin
#endif

/*
int t; cin >> t;
while(t--) {
	int n; cin >> n;
	vi A(n); loop(n) cin >> A[i];

}
*/

#define EXTERNAL_OUT 0
#if EXTERNAL_OUT
ofstream fout("output.txt");
#define cout fout
#endif

int main()
{
	IOS;
	int t; cin >> t;
	while (t--) {
		long double x, y, k;
		cin >> x >> y >> k;
		//k-1 + yk         k(y+1)-1
		cout <<
			ll(
				(y*k+k - 3.0 + x) /
				(x - 1.0) + k
			)
			<< '\n';
		// (k + k * y - 1 + x - 2) / (x - 1) + k
	}

#if EXTERNAL_OUT
	fout.close();
	system("output.txt");
#endif
}

/*

*/


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);
   sn++;
    if(ceil(((cn+k-x))/((x-1)*1.0))==floor(((cn+k-x))/((x-1)*1.0))){
        cout<<sn+k<<endl;
    }else
    cout<<sn+k+1<<endl;
    }

}


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);
    sn++;
    if(ceil(((cn+k-x)*1.0)/((x-1)*1.0))==floor(((cn+k-x)*1.0)/((x-1)*1.0))){
        cout<<sn+k<<endl;
    }else
    cout<<sn+k+1<<endl;
    }

}


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);
    sn++;
    if(ceil(((cn+k-x)*1.0)/((x-1)*1.0))==floor(((cn+k-x)*1.0)/((x-1)*1.0))){
        cout<<sn+k+1<<endl;
    }else
    cout<<sn+k+2<<endl;
    }

}


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);
    sn++;
    if(ceil(((cn+k-x)*1.0)/((x-1)*1.0))==floor(((cn+k-x)*1.0)/((x-1)*1.0))){
        cout<<sn+k<<endl;
    }else
    cout<<sn+k<<endl;
    }

}


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);

    if(ceil(((cn+k-x))/((x-1)*1.0))==floor(((cn+k-x))/((x-1)*1.0))){
        cout<<sn+k+1<<endl;
    }else
    cout<<sn+k+2<<endl;
    }

}


#include <bits/stdc++.h>
  #define ll long long
using namespace std;

int main()
{
   int t;
   cin>>t;
   while(t--){
   long long  x,y,k;
    cin>>x>>y>>k;
    long long cn=y*k;
    long long sn=(cn+k-x)/(x-1);
   sn++;
   if((ceil((cn+k-x)/(x-1))*(x-1))+x>=(cn+k)){
       cout<<sn+k<<endl;
   }else cout<<sn+k+1<<endl;

    }

}


 #include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )(pow(x,a)+(long double)0.5)-1)/(x-1);

            long long  r=d-(long long)(pow(x,a)+(long double)0.5);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


 #include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )(pow((long double)x,(long double)a)+(long double)0.5)-1)/(x-1);

            long long  r=d-(long long)(pow((long double)x,(long double)a)+(long double)0.5);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


 #include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )(pow(x,a)+0.5)-1)/(x-1);

            long long  r=d-(long long)(pow(x,a)+0.5);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


    #include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )pow(x,a)-1)/(x-1);

            long long  r=d-pow(x,a);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


#include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )(pow((long double)x,(long double)a)+0.5)-1)/(x-1);

            long long  r=d-(long long)(pow((long double)x,(long double)a)+0.5);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


#include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            long long  a=log(d)/log(x);

            ans+=((long long )(pow((long double)x,(long double)a)-1)/(x-1);

            long long  r=d-(long long)(pow((long double)x,(long double)a);
           long long l;

            l=(r+x-2)/(x-1);
            ans+=l+k;
            cout<< ans<<endl;
        }
        return 0;
    }


    #include<iostream>
    #include<cmath>

    using namespace std;
    int main()
    {
        int t;
        cin>>t;
        while(t--)
        {
        long long  x,y,k;
            cin>>x>>y>>k;
            long long  d=(y+1)*k;
            long long  ans=0;
            ans+=(d+x-3)/(x-1)+k;
            cout<< ans<<endl;
        }
        return 0;
    }


#include<iostream>
#include<cmath>

using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
    long long  x,y,k;
        cin>>x>>y>>k;
        long long  d=(y+1)*k;
        long long  ans=0;
        long long  a=log(d)/log(x);

        ans+=((long long )pow(x,a)-1)/(x-1);

        long long  r=d-pow(x,a);
       long long l;

       if(r%(x-1)==0)

        l=r/(x-1);
        else
        l=r/(x-1)+1;

        ans+=l+k;
        cout<< ans<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay;
        if ((y * k + k - 1) % (x-1) == 0) cay = (y * k + k - 1)/(x-1) + k;
        else cay = (y * k + k - 1)/(x-1) + k + 1;
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + (unsigned long long)ceil(((y * k + k-1)*1.0)/(x-1));
        if (ceil(((y * k + k-1)*1.0)/(x-1)) == ((y * k + k+1))/(x-1)) cay-=1;
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + (unsigned long long)ceil(((y * k + k)*1.0)/(x-1));
        if (ceil(((y * k + k-1)*1.0)/(x-1)) == ((y * k + k-1))/(x-1)) cay-=1;
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + (unsigned long long)ceil(((y * k + k)*1.0)/(x-1));
        if (ceil(((y * k + k)*1.0)/(x-1)) == ((y * k + k))/(x-1)) cay-=1;
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + ceil(((y * k + k - 1)*1.0)/(x-1));
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + (unsigned long long)ceil(((y * k + k - 1)*1.0)/(x-1));
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t; cin >> t;
    while (t--) {
        unsigned long long x, y, k;
        cin >> x >> y >> k;
        unsigned long long cay = k + (unsigned long long)ceil(((y * k + k-1)*1.0)/(x-1));
        if (ceil(((y * k + k)*1.0)/(x-1)) == ((y * k + k+1))/(x-1)) cay-=1;
        printf("%lld\n", cay);
    }
}


#include <bits/stdc++.h>
using namespace std;
#define INF 100000005
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define pb push_back
#define endl '\n'
#define PI 3.14159265358979323846
#define all(v) (v).begin(), (v).end()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(c) ((int)c.size())
#define ff first
#define ss second
#define EPS 1E-9
#define debug(s) cout<< #s <<" = "<< s <<endl
#define debugarr(arr, n) cout<< #arr << " = "; for(int i = 0; i < n; i++) {cout<<arr[i]<<" \n"[i == n - 1]; }
#define debugc(c) cout << #c << " = "; for(auto x : c) cout<<x<<" "; cout << endl
const int maxN = 1e6+5, MOD = 1e9+7, eps = 1e-7;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

ll n, a, b, m, k, q, s, d, x;
int qx, qy, kx, ky, tx, ty;
bool vis[105][105];

int dr[] = {1,1,0,-1,-1,-1, 0, 1};
int dc[] = {0,1,1, 1, 0,-1,-1,-1};

bool attacked(int qx, int qy, int tx, int ty){
    if(qx == tx || qy == ty){
        return true;
    }
    return (tx - qx == ty - qy);
}

bool bfs(){

    vis[kx][ky] = true;
    queue<ii> Q;
    Q.push({kx, ky});

    while(Q.size()){
        ii aux = Q.front(); Q.pop();
        int r = aux.ff;
        int c = aux.ss;
        FOR(i,0,8){
            int rr = r + dr[i];
            int cc = c + dc[i];
            if(rr > 0 && rr <= n && cc > 0 && cc <= n && !vis[rr][cc] && !attacked(qx, qy, rr, cc)){
                vis[rr][cc] = true;
                Q.push({rr, cc});
            }
        }
    }

    return vis[tx][ty];
}

int main() {
    //ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    //ofstream cout("datos.txt");

    cin >> n;

    cin >> qx >> qy >> kx >> ky >> tx >> ty;

    /*
    if( (qx > kx && qx < tx) ||  (qy > ky && qy < ty)   ){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }
    */

    if(bfs()){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 100000005
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define pb push_back
#define endl '\n'
#define PI 3.14159265358979323846
#define all(v) (v).begin(), (v).end()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(c) ((int)c.size())
#define ff first
#define ss second
#define EPS 1E-9
#define debug(s) cout<< #s <<" = "<< s <<endl
#define debugarr(arr, n) cout<< #arr << " = "; for(int i = 0; i < n; i++) {cout<<arr[i]<<" \n"[i == n - 1]; }
#define debugc(c) cout << #c << " = "; for(auto x : c) cout<<x<<" "; cout << endl
const int maxN = 1e6+5, MOD = 1e9+7, eps = 1e-7;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

ll n, a, b, m, k, q, s, d, x;
int qx, qy, kx, ky, tx, ty;
bool vis[1005][1005];

int dr[] = {1,1,0,-1,-1,-1, 0, 1};
int dc[] = {0,1,1, 1, 0,-1,-1,-1};

bool attacked(int qx, int qy, int tx, int ty){
    if(qx == tx || qy == ty){
        return true;
    }
    return (tx - qx == ty - qy);
}

bool bfs(){

    vis[kx][ky] = true;
    queue<ii> Q;
    Q.push({kx, ky});

    while(Q.size()){
        ii aux = Q.front(); Q.pop();
        int r = aux.ff;
        int c = aux.ss;
        FOR(i,0,8){
            int rr = r + dr[i];
            int cc = c + dc[i];
            if(rr > 0 && rr <= n && cc > 0 && cc <= n && !vis[rr][cc] && !attacked(qx, qy, rr, cc)){
                vis[rr][cc] = true;
                Q.push({rr, cc});
            }
        }
    }

    return vis[tx][ty];
}

int main() {
    //ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    //ofstream cout("datos.txt");

    cin >> n;

    cin >> qx >> qy >> kx >> ky >> tx >> ty;

    /*
    if( (qx > kx && qx < tx) ||  (qy > ky && qy < ty)   ){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }
    */

    if(bfs()){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}