Problem:
Score : 100 points

Problem Statement

A biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.

Find the total number of biscuits produced within T + 0.5 seconds after activation.

Constraints

All values in input are integers.

1 \leq A, B, T \leq 20

Input

Input is given from Standard Input in the following format:

A B T

Output

Print the total number of biscuits produced within T + 0.5 seconds after activation.

Sample Input 1

3 5 7

Sample Output 1

10

Five biscuits will be produced three seconds after activation.

Another five biscuits will be produced six seconds after activation.

Thus, a total of ten biscuits will be produced within 7.5 seconds after activation.

Sample Input 2

3 2 9

Sample Output 2

6

Sample Input 3

20 20 19

Sample Output 3

0

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)

using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var last = input.Last();
        
        var list = new List<int>();
        if (N == 2) {
            var target = input[0] >= input[1] ? input[0] : input[1];
            Console.WriteLine(target);
        } else {
            if (input.Distinct().Count() == 2) {
                Console.WriteLine(input[0]);
                return;
            }

            for (var i = 1; i <= last / 2; i++) {
                if (last % i == 0) {
                    list.Add(i);
                }
            }
            
            list.Add(last);
            list.Reverse();
            var target = 1;
            for (var i = 0; i < list.Count; i++) {
                var cnt = hoge(input, list[i]);
                if (cnt <= 1) {
                    target = list[i];
                    break;
                }
            }            
            Console.WriteLine(target);
        }
    }
    
    public static int hoge(int[] input, int target) {
        var cnt = 0;
        for (var i = 0; i < input.Length - 1; i++) {
            if (input[i] % target != 0) {
                cnt++;
            }
            if (cnt > 1) break;
        }
        return cnt;
    }
}