Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace No1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int l, n, v, t;
- String[] s1;
- using (StreamReader r = new StreamReader("input.txt"))
- {
- s1 = r.ReadLine().Split(' ');
- l = int.Parse(s1[0]);
- n = int.Parse(s1[1]);
- v = int.Parse(s1[2]);
- t = int.Parse(s1[3]);
- }
- int length = l / n;
- int cur_length = v * t;
- while (cur_length > l)
- {
- cur_length -= l;
- }
- int count = cur_length / length + 1;
- if (count > l)
- {
- count = l - count;
- }
- using (StreamWriter w = new StreamWriter("output.txt"))
- {
- w.WriteLine(Math.Abs(count));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement