Skip to content
UPEEC

RC Charging

Medium#engineering#electronics#math· solved by 0 · time limit 2.0 s

A capacitor CC charges from 0 V through resistor RR from a supply VV. The time constant is τ=RC\tau = RC and vC(t)=V(1−e−t/τ)v_C(t) = V\left(1 - e^{-t/\tau}\right). Print τ\tau in milliseconds and vCv_C at time tt, both with 3 decimals.

Input

RR (Ω), CC (µF), VV (volts), tt (seconds).

Output

τ\tau in ms and vC(t)v_C(t).

Constraints

All values positive; t≥0t \ge 0; R⋅C≥10−6R \cdot C \ge 10^{-6} s.

Sample 1

Input

10000 100 5 1

Output

1000.000 3.161

Sample 2

Input

1000 10 12 0.05

Output

10.000 11.919

Sign in or join free to run and submit your solution.